10/11/2024, 12:07:45
Voici les éléments à créer dans les "entrées" de HA (ici pour 2 étages de filtration, à répéter au besoin donc)
Le script qui est lancé :
Le code de la tuile concernée (ici double étage de filtration toujours)
Le script qui est lancé :
Code :
alias: Set Change Filtres Cuve1-2
sequence:
- if:
- condition: and
conditions:
- condition: not
conditions:
- condition: state
entity_id: input_select.liste_type_filtre_eau_cuve_1_nouveau
state: Pas de changement de filtre
- condition: not
conditions:
- condition: state
entity_id: input_select.liste_type_filtre_eau_cuve_2_nouveau
state: Pas de changement de filtre
then:
- action: calendar.create_event
target:
entity_id: calendar.filtres_eau
data:
summary: Changement filtres cuve
description: >
Premiere filtration - Le {{
states('input_select.liste_type_filtre_eau_cuve_1_courant') }} a
duré {{ (now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
}} jours/{{ (states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') | int)
}} Litres
Deuxième filtration - Le {{
states('input_select.liste_type_filtre_eau_cuve_2_courant') }} a
duré {{ (now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
}} jours/{{ (states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') | int)
}} Litres
start_date: |
{{ now().date() }}
end_date: |
{{ now().date() + timedelta(days=1) }}
- action: input_select.select_option
metadata: {}
data:
option: "{{states('input_select.liste_type_filtre_eau_cuve_1_nouveau')}}"
target:
entity_id: input_select.liste_type_filtre_eau_cuve_1_courant
- action: input_button.press
target:
entity_id: input_button.sensor_date_filtre_eau_cuve_1
data: {}
- action: input_number.set_value
target:
entity_id: input_number.volume_changement_filtre_cuve_1_litre
data:
value: "{{ states('sensor.volume_cuve_litre') }}"
- action: input_select.select_option
metadata: {}
data:
option: "{{states('input_select.liste_type_filtre_eau_cuve_2_nouveau')}}"
target:
entity_id: input_select.liste_type_filtre_eau_cuve_2_courant
- action: input_button.press
target:
entity_id: input_button.sensor_date_filtre_eau_cuve_2
data: {}
- action: input_number.set_value
target:
entity_id: input_number.volume_changement_filtre_cuve_2_litre
data:
value: "{{ states('sensor.volume_cuve_litre') }}"
- if:
- condition: and
conditions:
- condition: not
conditions:
- condition: state
entity_id: input_select.liste_type_filtre_eau_cuve_1_nouveau
state: Pas de changement de filtre
- condition: state
entity_id: input_select.liste_type_filtre_eau_cuve_2_nouveau
state: Pas de changement de filtre
then:
- action: calendar.create_event
target:
entity_id: calendar.filtres_eau
data:
summary: Changement filtres cuve
description: >-
Premiere filtration - Le {{
states('input_select.liste_type_filtre_eau_cuve_1_courant') }} a
duré {{ (now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
}} jours/{{ (states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') | int)
}} Litres
start_date: |
{{ now().date() }}
end_date: |
{{ now().date() + timedelta(days=1) }}
- action: input_select.select_option
metadata: {}
data:
option: "{{states('input_select.liste_type_filtre_eau_cuve_1_nouveau')}}"
target:
entity_id: input_select.liste_type_filtre_eau_cuve_1_courant
- action: input_button.press
target:
entity_id: input_button.sensor_date_filtre_eau_cuve_1
data: {}
- action: input_number.set_value
target:
entity_id: input_number.volume_changement_filtre_cuve_1_litre
data:
value: "{{ states('sensor.volume_cuve_litre') }}"
- if:
- condition: and
conditions:
- condition: not
conditions:
- condition: state
entity_id: input_select.liste_type_filtre_eau_cuve_2_nouveau
state: Pas de changement de filtre
- condition: state
entity_id: input_select.liste_type_filtre_eau_cuve_1_nouveau
state: Pas de changement de filtre
then:
- action: calendar.create_event
target:
entity_id: calendar.filtres_eau
data:
summary: Changement filtre cuve
description: >-
Deuxième filtration - Le {{
states('input_select.liste_type_filtre_eau_cuve_2_courant') }} a
duré {{ (now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
}} jours/{{ (states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') | int)
}} Litres
start_date: |
{{ now().date() }}
end_date: |
{{ now().date() + timedelta(days=1) }}
- action: input_select.select_option
metadata: {}
data:
option: "{{states('input_select.liste_type_filtre_eau_cuve_2_nouveau')}}"
target:
entity_id: input_select.liste_type_filtre_eau_cuve_2_courant
- action: input_button.press
target:
entity_id: input_button.sensor_date_filtre_eau_cuve_2
data: {}
- action: input_number.set_value
target:
entity_id: input_number.volume_changement_filtre_cuve_2_litre
data:
value: "{{ states('sensor.volume_cuve_litre') }}"
description: Creer une entrée agenda pour le changement des filtre eau de Cuve 1 et 2
icon: mdi:calendar-check-outline
Le code de la tuile concernée (ici double étage de filtration toujours)
Code :
- type: custom:mushroom-template-card
icon: mdi:air-filter
icon_color: blue
name: Filtre changé ?
layout: vertical
primary: Etat filtres eau de cuve
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: Changement des filtres d'eau de cuve
content:
type: custom:vertical-stack-in-card
cards:
- type: horizontal-stack
cards:
- type: vertical-stack
cards:
- type: custom:mushroom-title-card
title: null
subtitle: >-
Choisir les types de filtres qui seront
utilisés pour le remplacement puis valider.
card_mod:
style: |
ha-card {
margin-left: 30px;
margin-right: 30px;
}
- type: custom:mushroom-select-card
entity: >-
input_select.liste_type_filtre_eau_cuve_1_nouveau
name: >-
Type de filtre qui sera installé en première
filtration ?
secondary_info: none
card_mod:
style: |
ha-card {
margin-left: 30px;
margin-right: 30px;
}
- type: custom:mushroom-select-card
entity: >-
input_select.liste_type_filtre_eau_cuve_2_nouveau
name: >-
Type de filtre qui sera installé en seconde
filtration ?
secondary_info: none
card_mod:
style: |
ha-card {
margin-left: 30px;
margin-right: 30px;
}
- type: horizontal-stack
cards:
- type: custom:gap-card
- type: custom:mushroom-template-card
icon: mdi:tooltip-check-outline
primary: Valider
fill_container: false
icon_color: green
tap_action:
action: call-service
confirmation:
text: >-
Valider le changement du/des filtre(s)
d'eau de cuve maintenant ?
service: script.set_change_filtres_cuve1_2
card_mod:
style:
.: |
ha-card {
margin-top: 30px;
margin-bottom: 30px;
}
- type: custom:gap-card
secondary: "{% if ((now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days > 180) and ((now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days > 180) %}\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\n Vie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³\n Filtre à changer !\n{% elif ((now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days > 180) %}\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\n Vie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³\n Filtre 1 à changer !\n{% elif ((now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days > 180) %}\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\n Vie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³\n Filtre 2 à changer !\n{% elif ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) > 10000 ) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) > 10000 ) %}\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\n Vie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³\n Filtre à changer !\n{% elif ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) > 10000 ) %}\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\n Vie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³\n Filtre 1 à changer !\n{% elif ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) > 10000 ) %}\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\n Vie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³\n Filtre 2 à changer !\n{% elif ((((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) < 10000) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) > 8000))) or ((((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) < 10000) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) > 8000))) %}\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\n Vie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³\n Changement Filtres à prévoir\n{% elif (((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) < 10000) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) > 8000)) %}\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\n Vie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³\n Changement Filtre 1 à prévoir\n{% elif (((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) < 10000) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) > 8000)) %}\t\t\t\t\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\nVie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³ Changement Filtre 2 à prévoir {% else %}\n Vie filtre 1 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int)) / 1000) }} m³\nVie filtre 2 : {{ (now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days }} jour(s) / {{ '%0.2f' | format(((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int)) / 1000) }} m³ {% endif %}\n"
badge_icon: >
{% if ((now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
> 180) and ((now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
> 180) %}
mdi:alert
{% elif ((now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
> 180) %}
mdi:alert
{% elif ((now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
> 180) %}
mdi:alert
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) > 10000 ) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) > 10000 ) %}
mdi:alert
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) > 10000 ) %}
mdi:alert
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) > 10000 ) %}
mdi:alert
{% elif ((((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) < 10000) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) > 8000))) or ((((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) < 10000) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) > 8000))) %}
mdi:information-symbol
{% elif (((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) < 10000) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) > 8000)) %}
mdi:information-symbol
{% elif (((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) < 10000) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) > 8000)) %}
mdi:information-symbol
{% endif %}
badge_color: >
{% if ((now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
> 180) and ((now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
> 180) %}
red
{% elif ((now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
> 180) %}
red
{% elif ((now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
> 180) %}
red
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) > 10000 ) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) > 10000 ) %}
red
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) > 10000 ) %}
red
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) > 10000 ) %}
red
{% elif ((((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) < 10000) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) > 8000))) or ((((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) < 10000) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) > 8000))) %}
amber
{% elif (((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) < 10000) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre') |
int) > 8000)) %}
amber
{% elif (((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) < 10000) and ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre') |
int) > 8000)) %}
amber
{% endif %}
multiline_secondary: true
card_mod:
style:
.: >
{% if ((now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
> 180) and ((now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
> 180) %}
ha-card {
animation: ping 1s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
> 180) %}
ha-card {
animation: ping 1s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
> 180) %}
ha-card {
animation: ping 1s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre')
| int) > 10000 ) and ((states('sensor.volume_cuve_litre') |
int) -
(states('input_number.volume_changement_filtre_cuve_2_litre')
| int) > 10000 ) %}
ha-card {
animation: ping 1s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre')
| int) > 10000 ) %}
ha-card {
animation: ping 1s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre')
| int) > 10000 ) %}
ha-card {
animation: ping 1s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% else %}
ha-card {
padding-bottom: 15px !important;
}
{% endif %}
mushroom-badge-icon$: >
{% if ((now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
> 180) and ((now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
> 180) %}
.badge {
animation: ping 1s infinite;
--badge-icon-size: 22px;
--badge-size: 30px;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
50% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((now() -
states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days
> 180) %}
.badge {
animation: ping 1s infinite;
--badge-icon-size: 22px;
--badge-size: 30px;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
50% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((now() -
states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days
> 180) %}
.badge {
animation: ping 1s infinite;
--badge-icon-size: 22px;
--badge-size: 30px;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
50% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre')
| int) > 10000 ) and ((states('sensor.volume_cuve_litre') |
int) -
(states('input_number.volume_changement_filtre_cuve_2_litre')
| int) > 10000 ) %}
.badge {
animation: ping 1s infinite;
--badge-icon-size: 22px;
--badge-size: 30px;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
50% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre')
| int) > 10000 ) %}
.badge {
animation: ping 1s infinite;
--badge-icon-size: 22px;
--badge-size: 30px;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
50% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre')
| int) > 10000 ) %}
.badge {
animation: ping 1s infinite;
--badge-icon-size: 22px;
--badge-size: 30px;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
50% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
{% elif ((((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre')
| int) < 10000) and ((states('sensor.volume_cuve_litre') |
int) -
(states('input_number.volume_changement_filtre_cuve_1_litre')
| int) > 8000))) or ((((states('sensor.volume_cuve_litre') |
int) -
(states('input_number.volume_changement_filtre_cuve_2_litre')
| int) < 10000) and ((states('sensor.volume_cuve_litre') |
int) -
(states('input_number.volume_changement_filtre_cuve_2_litre')
| int) > 8000))) %}
.badge {
--badge-icon-size: 40px;
--badge-size: 30px;
{% elif (((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_1_litre')
| int) < 10000) and ((states('sensor.volume_cuve_litre') |
int) -
(states('input_number.volume_changement_filtre_cuve_1_litre')
| int) > 8000)) %}
.badge {
--badge-icon-size: 40px;
--badge-size: 30px;
{% elif (((states('sensor.volume_cuve_litre') | int) -
(states('input_number.volume_changement_filtre_cuve_2_litre')
| int) < 10000) and ((states('sensor.volume_cuve_litre') |
int) -
(states('input_number.volume_changement_filtre_cuve_2_litre')
| int) > 8000)) %}
.badge {
--badge-icon-size: 40px;
--badge-size: 30px;
{% endif %}
mushroom-shape-icon$: |
.shape {
--icon-symbol-size: 40px;
--icon-size: 60px;
}
mushroom-state-info$: "{% if ((now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days > 180) and ((now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days > 180) %}\n.container {\n --card-secondary-color: red;\n}\n{% elif ((now() - states('input_button.sensor_date_filtre_eau_cuve_1')|as_datetime).days > 180) %}\n.container {\n --card-secondary-color: red;\n}\n{% elif ((now() - states('input_button.sensor_date_filtre_eau_cuve_2')|as_datetime).days > 180) %}\n.container {\n --card-secondary-color: red;\n}\n{% elif ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) > 10000 ) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) > 10000 ) %}\n.container {\n --card-secondary-color: red;\n}\n{% elif ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) > 10000 ) %}\n.container {\n --card-secondary-color: red;\n}\n{% elif ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) > 10000 ) %}\n.container {\n --card-secondary-color: red;\n}\n{% elif ((((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) < 10000) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) > 8000))) or ((((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) < 10000) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) > 8000))) %}\n.container {\n --card-secondary-color: orange;\n}\n{% elif (((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) < 10000) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_1_litre') | int) > 8000)) %}\n.container {\n --card-secondary-color: orange;\n}\n{% elif (((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) < 10000) and ((states('sensor.volume_cuve_litre') | int) - (states('input_number.volume_changement_filtre_cuve_2_litre') | int) > 8000)) %}\t\t\t\t\n.container {\n --card-secondary-color: orange;\n}\n{% endif %}\n"