I have tried to make an automation that turns on some RGB light with a random color each time.
It works very well when using color names but as soon as i replace it with rgb colors I get erros.
Someone can see what is wrong?
ERROR (MainThread) [homeassistant.core] Invalid service data for light.turn_on: None for dictionary value @ data[‘rgb_color’]. Got ‘[000,255,255]’
action:
- service: light.turn_on
entity_id: light.ur
data_template:
rgb_color: >
{{ [
“[255,000,000]”,
“[000,255,000]”,
“[000,000,255]”,
“[255,165,000]”,
“[000,255,255]”,
“[255,000,255]”,
“[070,000,255]”
] |random }}
brightness: 20
action:
- service: light.turn_on
entity_id: light.ur
data_template:
color_name: >
{{ [
“blue”,
“red”,
“green”,
“orange”,
“cyan”,
“magenta”,
“darkviolet”,
“purple”
] |random }}
brightness: 20