I’m a complete noob here, so forgive me if the answer to this is obvious, but I’m working on a looping script that will change the color of some rgb lights slowly over time as long as Spotify is playing.
The issue I’m running into is that scripts with random numbers in them just aren’t firing. I’m copying the syntax from other examples that people have posted, so I’m not quite sure what exactly I’m doing wrong.
officelights_green:
alias: Office Tiki Lights (Cyan)
sequence:
- service: homeassistant.turn_on
data:
entity_id: light.officeclosetlamp
rgb_color: [0, 100, 200]
- service: script.turn_on
data:
entity_id: script.officelights_green_loop
This script turned the light cyan, just as I’m intending it to, but for some reason the next script does nothing.
officelights_green_loop:
alias: Office Tiki Lights (Green) - loop
sequence:
- service: homeassistant.turn_on
data:
entity_id: light.officeclosetlamp
rgb_color: ['{{ (range(0, 255)|random }}', 100, 100]
- service: script.turn_on
data:
entity_id: script.officelights_green
It also drops the loop between the two scripts. There’s no errors in the log, and the YAML complies, so I’m not sure what’s wrong.
As best as I can find, that’s the correct formatting for a random number, but maybe it’s a simple mistake I can’t seem to be able to see.
Any help with this?