I’m starting to get into the more advanced features of Home Assistant, but still a novice so excuse the simple question.
I have a pair of RGB light bulbs in the front of the house. I’d like to specify a starting color and then cycle them between three pre-defined colors every 30 seconds. Is there a post or can someone provide some sample code to help me do this?
I know I’ll need a script or combination of scripts but I’m not exactly sure what I need. I found this block of code that picks a random color from a set of pre-defined colors, but it doesn’t cycle through them continuously (it only picks one random color from the pre-defined colors when I run script.loop_lights
and then leaves that color on):
light_cycle:
sequence:
- service: homeassistant.turn_on
entity_id: light.wifi_light_bulb_3
data_template:
brightness: 250
color_name: >
{% set colors = ['orange', 'purple' , 'green'] %}
{{ colors|random }}
- service: script.loop_lights
loop_lights:
sequence:
- delay: '00:00:02'
- service: script.light_cycle
Really appreciate the help in advance!