I use a configuration to change brightness depending on the time of day.
Now i want to add a color to it at the same way, but it gives me errors.
Who can see what’s wrong wit this?
I get this error:
Invalid service data for light.turn_on: None for dictionary value @ data[‘rgb_color’]. Got ‘255,209,0’
- alias: "Testlamp kleur"
trigger:
- platform: state
entity_id: input_boolean.test_knop
from: 'off'
to: 'on'
action:
- service: light.turn_on
data_template:
entity_id: light.staande_lamp
brightness: >
{%- if now().strftime('%H')| int >= 21 %}
100
{%- elif now().strftime('%H')| int < 7 %}
100
{%- elif now().strftime('%H')| int >= 7 %}
250
{%- endif %}
rgb_color: >
{%- if now().strftime('%H')| int >= 21 %}
[255,0,0]
{%- elif now().strftime('%H')| int < 7 %}
[255,0,0]
{%- elif now().strftime('%H')| int >= 7 %}
[255,209,0]
{%- endif %}