Power Failure Detection with SmartThings and webCoRE

The freezer in my garage is on the same GFCI circuit as my Christmas lights, which occasionally trip the GFCI, cutting power to my freezer. I want to monitor my freezer and have SmartThings notify me when it goes offline.

Unfortunately, none of the built-in options for SmartThings such as Smart Home Monitor will work correctly for this, so this article will describe how I accomplished it. Here’s a diagram:

I’m using a Zooz ZEN15 ZWave Power Switch (about $40), which is SmartThings compatible and reports both power (current watts) and total energy (kwh). I use webCoRE as the automation/rules engine to monitor the ZEN15 and send a text notification to my phone if the freezer power appears to be out.

Complications

Unfortunately, the ZEN15 has a couple quirks that make this more complicated than you’d think:

If the GFCI circuit trips and cuts power to the ZEN15, it doesn’t show ‘offline’ in SmartThings for many hours. It just sits there, reporting ‘online’, and the power and energy readings stay the same as they were when the power was cut. So, if the last power reading was 84 when the GFCI tripped, it’ll still say 84 in the SmartThings app even though the freezer’s down. This is why a normal Smart Home Monitor automation won’t work.

Using webCoRE

webCoRE allows you to write more sophisticated monitoring scripts, so I configured it according to the instructions on their Wiki. The logic is roughly as follows:

  • Every 15 minutes:
    • If the freezer’s offline, notify
    • If the current power reading hasn’t changed in 2 hours, notify
    • Remember the last power reading and time changed

In my case, this all works, because my freezer never goes for more than an hour or so before it kicks on and runs, drawing power. If your freezer is newer or more efficient, you might have to tweak some of the settings to avoid false notifications. This has been running for a couple weeks for me and has been working well.

Script

http://wp.bitrazor.com/wp-content/uploads/2020/12/piston-image-1.png

http://wp.bitrazor.com/wp-content/uploads/2020/12/piston-image-1.png

One reply on “Power Failure Detection with SmartThings and webCoRE”

Comments are closed.