Hi!
I have an automation that groups together two switches (one ESPHome and one Zigbee2MQTT) and a light (Zigbee2MQTT) so they keep their state in sync. It works really well other than very occasionally going rogue and getting into a loop where everything tries to continuously switch on and off as fast as possible. The only way to resolve it is to disable the automation.
Here is the automation config:
id: '1732099708681'
alias: Turn off/on Patio Lights
description: ''
triggers:
- entity_id:
- switch.patio_light
- switch.laundry_switch_bottom
from:
- 'off'
- 'on'
to:
- 'off'
- 'on'
trigger: state
conditions: []
actions:
- target:
entity_id:
- light.patio_lights
- switch.patio_light
- switch.laundry_switch_bottom
action: homeassistant.turn_{{ trigger.to_state.state }}
mode: single
Both times the loop has happened we were attempting to turn the light on using the ESPHome device (switch.patio_light).
The Trace Timeline has the following in the first event:
(switch.patio_light) turned on
Then the second event has this weirdness:
(light.patio_lights) turned on
(switch.laundry_switch_bottom) turned off
(switch.laundry_switch_bottom) turned on
(switch.laundry_switch_bottom) turned off
(switch.laundry_switch_bottom) turned on
Any ideas what could be causing this?
Thank you!