do_lai
January 7, 2025, 6:06pm
1
Hello. This, I think, is a syntax question. How do I pass a list (in this case, an RGB color) back to Home Assistant?
This, and a number of other variations, don’t work:
on_short_click:
- homeassistant.action:
action: light.toggle
data:
entity_id: ${entity_id}
brightness_pct: '100'
rgb_color: "[255,255,255]"
EBME2
(Ebme2)
January 7, 2025, 7:39pm
2
Hi
Have you tried as per documentation?
# In some trigger
on_...:
- homeassistant.action:
action: script.set_light_rgb
data:
light_name: 'my_light'
red: '255'
green: '199'
blue: '71'
do_lai
January 7, 2025, 8:45pm
3
Ah, thanks. Somehow my searching didn’t turn this up.
So, the documentation says that data structures are not possible.
What I did is similar to what the documentation recommends: created a script in HA, then called with each of the parameters.
IgorZg
(Igor Simić)
January 8, 2025, 11:29am
4
Hi,
maybe you can use json encoded structure?
Best regards
do_lai
January 17, 2025, 1:43am
5
Oh, neat. That looks like a solution that may work well, too. I may try that next time since it would allow for more flexibility. Thank you.