Hi have an automation where i try to set rob value depending on selected value.
alias: Küche Untergrund Beleuchtung - Ändere Farb Profil
hide_entity: true
trigger:
- platform: state
entity_id: input_select.lightprofile_select
action:
- service: input_boolean.turn_off
entity_id: input_boolean.random_color
- service: light.turn_on
data_template:
entity_id: light.kitchen_underground_switch_level_25_0_2
rgb_color: >
{% if is_state("input_select.lightprofile_select", "Rot") %}
[255,0,0]
{% elif is_state("input_select.lightprofile_select", "Grün") %}
[0,255,0]
{% elif is_state("input_select.lightprofile_select", "Blau") %}
[0,0,255]
{% elif is_state("input_select.lightprofile_select", "Warm") %}
[242,101,27]
{% endif %}
There is no error when starting hass or checking the config files, also the input_boolean.random_color turn off is working. The only thing i can not get working here is setting the rgb_color by template.
btw: the automation works when i f remove the template thing and just write
rgb_color: [255,0,0]