How Detect No Power


#1

I have a Zigbee plug (Iris) that is connected to a circuit controlled by a switch. I want to know if that plug has power to it or if I switched off the switch that powers that plug. I thought I could use the $status variable for the plug, but even with no power to the plug, Smarthings reports that plug as being ONLINE, so that is no help. Is there a reliable way to detect when a device has no power to it?


#2

Never mind, I screwed this up. ONLINE / OFFLINE works fine.


#3

Can you post the piston you are using to achieve this? For some reason mine is not working and wondering if I am using the wrong syntax to look for offline


#4

Here you go. It is the same syntax as when you want to access any device attribute.

In line 28, that IF statement is checking for Is Not OFFLINE. You could easily change that to Is OFFLINE. Another way you could do that check is using the attribute like in line 30. In that case, your IF statement would be something like:

If ({[$device:$status]}==“OFFLINE”, then do something, else do something else)