Passing a List in a Service Call

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]"

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'

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.

Hi,
maybe you can use json encoded structure?

Best regards

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.