Method of reporting to Hubitat whether or not a device has power?

I'm trying to figure out if there is a way, with the devices I have (ie not buying a new power monitoring plug) to let Hubitat know that the outlet a device is plugged into has no power.
The device already connected to HE is a Sonoff S31 Lite plug. I also have a Roku Streaming Stick+ and an Asus router acting as a mesh repeater; if there is a way to connect those to HE and get a report of no power from them that would also work.

This is my use case:
Due to many recent storms, I've experienced many recent power blips. I've got a whole house surge protector on the main panel, but the electrician recommended that more sensitive equipment such as TV/stereo, etc also be plugged into a surge strip. All the above listed devices are plugged to a surge strip, however, some of these devices are part of automations, so when the surge strip is off, the devices have no power and the automations do not fire....

The nature of the storms is such that the surge strip trips. Thinking it was a bad strip, I switched it out with a Belkin strip that has an RF remote to reset it when it trips. The Belkin also trips, so I've concluded the strip is doing its protection thing. Since the Belkin RF capability is recognized by Bond Bridge, I could use the Hubitat to send an ON command, via the Bond, 2 minutes after the surge strip trips. That would turn things back on and make them ready for automations. The Bond would be plugged into one of the two constant on outlets on the strip that does not constantly trip. My TV is plugged into the other; I'm reluctant to plug that into one of the outlets that always trips because I suspect that is not good for the TV...

Is this doable with the current drivers and if so, how?

If this device is unpowered, it cannot communicate with the hub to indicate it has no power.

These are IP-connected devices. If you setup a rule on the hub to periodically ping the ASUS router, you can interpret the lack of a ping response from the router to indicate it has lost power. There are other reasons this could happen, but they are likely to be rare.

2 Likes

If this device is unpowered, it cannot communicate with the hub to indicate it has no power.

Agreed. I was hoping there was some way that HE would know a device is not connected (via zwave, zigbee or wifi). The Sonoff is very chatty - it checks in with the hub every 5 minutes and logs whether it is on or off, so I thought there may be some way to leverage a missing "check in."

These are IP-connected devices. If you setup a rule on the hub to periodically ping the ASUS router, you can interpret the lack of a ping response from the router to indicate it has lost power. There are other reasons this could happen, but they are likely to be rare.

Sounds promising. Can you point me to a thread from which I could learn more about how to start going about this?

Rule Machine has the ping capability. Just set the rule trigger to "periodic schedule", set it to something like 5 minutes, and have the first action ping the device. From there, you'll need to set a variable to the ping response and setup your notification. Here's a good start:

2 Likes

There is, with an app like Device Activity Check, for example.

As @aaiyar cautioned with the other method, a missed check-in does not guarantee that the underlying event was a power loss.

But the only way to know for certain would probably require a new device that can report whether it’s on mains or battery power.

2 Likes

Another thing to keep in mind - if the mains powered devices are serving as routers, when they fail (due to the power outage) it will disrupt the connection to the downstream devices.

You can also use something like a Ring extender v2. It has battery backup built in and can report whether it's connected via mains or battery. So you can use the change from mains to battery (when power goes out) as a trigger and use battery to mains (when power is restored) as a trigger. This obviously also means that your hub should be on a UPS as well. (Note this is a z-wave repeater so put it somewhere it can be used :slight_smile: )

https://www.amazon.com/Ring-Alarm-Range-Extender/dp/B07ZB2VP4K/ref=sr_1_1?crid=1EQ24AFKHZ508&keywords=ring+v2+extender&qid=1692101428&sprefix=ring+v2+extender%2Caps%2C95&sr=8-1

For just a couple dollars more, this might have more utility than just loss of power reports.

Zooz 800 Series Z-Wave Plus Range Extender ZAC38 - The Smartest House

1 Like

Pretty much the same thing with an 800 series chip. I'm dubious of the power boost claim though.

Maybe. But it would easily be worth the couple bucks to me to get four more years of warranty and Zooz support. If manufacturer claims can be believed the ZAC38 claims 400 ft (line of sight) range whereas the Ring 250 ft. Seems plausible given the 800 series chip. Either would fit OP's situation though.

3 Likes

Except

But it plugs in but is not a plug as in a receptacle. It's a device that will do what he needs.

My read is OP is not looking for an "add this device" solution.

2 Likes

Correct - I'd rather use something I already have....

You could periodically ping 2 or 3 devices connected by ethernet to the same switch/router as your Hubitat.

If they’re all unreachable, then you can consider that either the switch died or there is no power.

As long as your hub is on a UPS, even if the ping interval is something like once a minute, you’ll know there’s a loss of connectivity within 3 minutes at the most.

2 Likes

This seemed promising, so I installed it.
First step is to select the device. Sonoff S31Lite.
Second step is to define the inactivity threshold. Seems the Sonoff S31Lite I already have should fit the bill because it creates a log entry every 5 minutes to report if it is on or off. I selected 11 minutes in case it just misses one.
Third step is "notification options" in which I define how the notification of the inactivity is sent. But I don't want a notification. I just want HE to press the on button for the Belkin Power Strip.

Sooo....Is it possible to do this in rule machine? These check ins the device does every 5 minutes only show up in the log - it is not a device event, nor does it seem to be tracked in any of the device "Current States" or "State Variables" fields. I am using the Generic Zigbee Outlet driver for it. I cannot figure out how to set the "Capability for new Trigger Event" to look for lack of log entries. Is it possible?

  • The trigger would be the Sonoff Plug has not logged anything in 11 minutes (ie it missed 2 "check ins" + 1 minute). I can't seem to find a trigger based on the logs...
  • the action would be to send the switch on command from HE to Bond, which will then send the command to the strip via RF.