Hi community, as I’m new to all of this, I ask if someone can point me to a solution.
I have a entity (it’s a mover) with different states. Here is what I coded so far:
- platform: template
sensors:
lieschen_status_friendly:
friendly_name: "Lieschen Status"
value_template: >-
{% if is_state("sensor.lieschen_status_raw", "0") -%}
kein Strom
{% elif is_state("sensor.lieschen_status_raw", "1") -%}
geparkt
{% elif is_state("sensor.lieschen_status_raw", "2") -%}
mäht
{% elif is_state("sensor.lieschen_status_raw", "4") -%}
laden
{% elif is_state("sensor.lieschen_status_raw", "5") -%}
sucht
{% elif is_state("sensor.lieschen_status_raw", "17") -%}
schläft
{% elif is_state("sensor.lieschen_status_raw", "3") -%}
Heimweg
{% elif is_state("sensor.lieschen_status_raw", "7") -%}
Kollision
{% elif is_state("sensor.lieschen_status_raw", "16") -%}
Hauptschalter AUS
{% else -%}
Figure out what state {{ states("sensor.lieschen_status_raw") }} means
{%- endif %}
Now I want to change the color of an LED stripe (Arilux-LC06) depending on the state. I.e. if status_raw = 2 then light.statuslight.color = green.
What’s best to do this?