Automation To Set Lights after Power Outage

First let me say that my Home Assistant is running on a VM on an Unraid server which is connected to UPS. The Home Assistant Instance is protected from power blips and will remain up and functional as long as the UPS can supply power. Unraid is also set up to power down gracefully when the batteries reach a low level. I have had many power Blips (Momentary Drop Outs) over the past few weeks resulting in all of my Zigbee Bulbs turning on while everyone is asleep. Not popular with the wife for sure!

So I devised a plan to create a Power Monitor to detect outages and set the state of the lights to on or off depending on the time of day with a few automations. My AC monitor was constructed with an AC DPDT relay whose Normally Open contacts were soldered to the reed points (Reed removed) on aa Aqara door Sensor. I used an AC relay as I did not want to add another power supply in the mix (12 volt for example) which might hold a charge too long to see a momentary outage. This gets plugged into the wall and I tested this design and set up by simply unplugging my newly constructed monitor and seeing if the lights switched to the state I wanted throughout the house with the automations. Worked Perfectly!!!

However, it dawned on me that the many of my lights are connected through repeaters which themselves might be slow to recover in the event of an actual outage to the house that brought the repeaters down as well. So I started looking at adding “If Then”, conditions or loops in my automations but this seemed to be complicating things. Since my concern is at night when folks are sleeping I want to have the light set to off as quickly as possible so folks will hopefully not be woken up. Loops and delays of time seemed to not be ideal.

I tried to see if I could determine that state of the Repeaters to see if they had come back up before setting the lights but was unsure how to do this??? So any suggestions would be greatly appreciated. BTW I am very new to Home Assistant so sorry for what might be a simple question.

1 Like