UniFi G4 Doorbell Chimes When Reconnecting to WiFi

Like many others, I have an automation running for when my Unifi G4 Doorbell is pressed, a chime plays through multiple Google Home / Nest devices through my home. I have this working well, however when the doorbell disconnects and reconnects to WiFi (such as during an update, or occasionally in my case due to WiFi coverage issues), the automation will activate and then my Google Home devices will chime. This has happened at 3:30am or 4:30am waking the whole house up.

This is my trigger, I feel the issue lies in the fact it states “changes state or any attributes”, but I don’t know how to change this. I may also be completely wrong that this is the issue.

Any help appreciated!

Check out Automation Trigger - Home Assistant

You’ll want to add:

      from: "off"
      to: "on"

Thank you!
I have made this change and it seems to be working well for the last few days. Much appreciated.