IF Abfrage für binären Sensor:
{% if is_state('input_boolean.lab_schalter_2', 'on') %}
an
{% else %}
aus
{% endif %}IF Abfrage für Zahlenwerte
{% if states('input_number.batterie_test') | int <=50 %}
<50
{% elif states('input_number.batterie_test') | int >50 and states('input_number.batterie_test') | int < 80 %}
>50 <80
{% else %}
>=80
{% endif %}Karte anpassen:
card_mod:
style: |
ha-card {
font-size: 30px;
zoom: 80%;
background: transparent;
}Entitäten anpassen Beispiele:
type: entities
entities:
- entity: light.bed_light
card_mod:
style: |
:host {
color: red;
--card-mod-icon: mdi:bed;
}
card_mod:
style: |
:host {
{% if is_state('input_boolean.lab_schalter_2', 'on') %}
color: green;
--card-mod-icon: mdi:light-switch;
--card-mod-icon-color: green;
{% else %}
color: red;
--card-mod-icon: mdi:light-switch-off;
--card-mod-icon-color: red;
{% endif %}
}
card_mod:
style: |
:host { {% if states('input_number.batterie_test') | int <=50 %}
color: red;
--card-mod-icon-color: red;
--card-mod-icon: mdi:battery-30;
{% elif states('input_number.batterie_test') | int >50 and states('input_number.batterie_test') | int < 80 %}
color: yellow;
--card-mod-icon-color: yellow;
--card-mod-icon: mdi:battery-50;
{% else %}
color: green;
--card-mod-icon-color: green;
--card-mod-icon: mdi:battery;
{% endif %}
}