Hello,
I do have an automation I hope never need to be triggered. Water leak alert and ligths flash for “bit of a fun”. When there is a leak I know where and respective light flashes in red. It is toggling the light on and off - not working as quick as I imagined but still good enough.
The only thing which really does not work (well in 30% of my tests) is turning the lights off when I “handle” the situation. Which is telling me there is something wrong in the logic. It is hard to recreate the situation as sometimes lights turn off and sometimes they stays on. I added a delay before turning them off as I thought that is the issue but it is still the same. Can you see what is wrong?
alias: voda_flash
description: ""
mode: single
triggers:
- entity_id:
- input_boolean.voda_helper
to: "on"
id: mokro
trigger: state
- entity_id:
- input_boolean.voda_helper
to: "off"
id: sucho
trigger: state
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- mokro
sequence:
- repeat:
sequence:
- choose:
- conditions:
- condition: and
conditions:
- condition: trigger
id:
- mokro
- condition: state
entity_id: binary_sensor.sensor_kuchyn_vlhkost_water_leak
state: "on"
- condition: state
entity_id: binary_sensor.sensor_koupelna_vlhkost_water_leak
state: "on"
sequence:
- action: light.toggle
target:
entity_id:
- light.svetlo_kuchyn_ledpasek_linka
- light.svetlo_kuchyn_linka
- light.svetlo_chodba_koupelna
data:
rgb_color:
- 255
- 0
- 0
brightness_pct: 100
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- conditions:
- condition: and
conditions:
- condition: trigger
id:
- mokro
- condition: state
entity_id: binary_sensor.sensor_koupelna_vlhkost_water_leak
state: "on"
sequence:
- action: light.toggle
target:
entity_id:
- light.svetlo_chodba_koupelna
data:
brightness_pct: 100
rgb_color:
- 255
- 0
- 0
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 500
- conditions:
- condition: and
conditions:
- condition: trigger
id:
- mokro
- condition: state
entity_id: binary_sensor.sensor_kuchyn_vlhkost_water_leak
state: "on"
sequence:
- action: light.toggle
target:
entity_id:
- light.svetlo_kuchyn_ledpasek_linka
- light.svetlo_kuchyn_linka
data:
rgb_color:
- 255
- 0
- 0
brightness_pct: 100
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 500
while:
- condition: trigger
id:
- mokro
- conditions:
- condition: trigger
id:
- sucho
sequence:
- delay:
hours: 0
minutes: 0
seconds: 3
milliseconds: 0
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id:
- light.svetlo_kuchyn_linka
- light.svetlo_kuchyn_ledpasek_linka
- light.svetlo_chodba_koupelna