Hello!
So I’m trying to make a “disco-mode” automation. I’m using an input boolean to trigger the automation. When the automation is turned on it should turn off some lights, disable circadian lighting, start an effect on my led-strip, and start a repeat-loop changing the colors of my zigbee-bulbs one at a time to a random color. When it is turned off it should turn on circadian lighting (which makes all the lights white again), turn back on some lights and change the effect of the led strip.
The automation works as expected when I turn it on. Turning it off stops the color-changing of the zigbee-bulbs, but nothing else. If I remove the repeat-part the automation works as expected.
I anyone can help me out it would be greatly appreciated.
alias: DISCOMODUS
description: ""
trigger:
- platform: state
entity_id:
- input_boolean.discomodus
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.discomodus
state: "off"
sequence:
- service: switch.turn_on
data: {}
target:
entity_id: switch.circadian_lighting_circadian_lighting
- service: light.turn_on
data: {}
target:
entity_id:
- light.taklampe_stue
- light.bokhyllelys
- light.lysspisebord
- service: light.turn_on
data:
effect: Solid@;!;
target:
entity_id: light.hyllelys_2
- conditions:
- condition: state
entity_id: input_boolean.discomodus
state: "on"
sequence:
- service: switch.turn_off
data: {}
target:
entity_id: switch.circadian_lighting_circadian_lighting
- service: light.turn_off
data: {}
target:
entity_id:
- light.taklampe_stue
- light.bokhyllelys
- light.lysspisebord
- service: light.turn_on
data:
effect: Rainbow@!,Size;1,2,3;!
target:
entity_id: light.hyllelys_2
- repeat:
until:
- condition: state
entity_id: input_boolean.discomodus
state: "off"
sequence:
- service: light.turn_on
data:
hs_color: |
[ {{ range(10,300) | random }}, 100 ]
target:
entity_id: light.kjokkenspot_1
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- service: light.turn_on
data:
hs_color: |
[ {{ range(10,300) | random }}, 100 ]
target:
entity_id: light.kjokkenspot_2
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- service: light.turn_on
data:
hs_color: |
[ {{ range(10,300) | random }}, 100 ]
target:
entity_id: light.kjokkenspot_3
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- service: light.turn_on
data:
hs_color: |
[ {{ range(10,300) | random }}, 100 ]
target:
entity_id: light.tv_lys_1
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- service: light.turn_on
data:
hs_color: |
[ {{ range(10,300) | random }}, 100 ]
target:
entity_id: light.tv_lys_2
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 500
- service: light.turn_on
data:
hs_color: |
[ {{ range(10,300) | random }}, 100 ]
target:
entity_id: light.tv_lys_3
mode: single