Hi.
I’m trying to use my living room light as a notification for various events, by flashing different colors.
For testing I setup an automation that calls a script when an input_boolean is triggered, and passes the rgb color to the script.
Nothing happens. I tried to put/remove brackets etc. but I didn’t find the correct syntax.
The original idea was that the automation calls a script passing the color, and this script calls the abobe script 3 times, repassing to it the same color parameter, and so flashing 3 times.
But first I must make the direct script call working with the parameter…
Can someone help me?
Thanks.
The gist of the problem is, in the script the color variable will contain a list. However, when you use it in a template, the template will convert it to a string. So rgb_color: "{{ color }}" results in the string:
'[0,255,0]'
not the list:
[0,255,0]
The rgb_color parameter requires a list, not a string that looks like a list.
My typical suggestion is to use color_name instead of rgb_color.
Ok, I tried and it worked at first attempt.
I already introduced the second script, and it immediately worked too.
I didn’t know about color_name, it’s very easy and handy.
The other solution will be useful too.
So thank you again for the help and the explanation.