Detect unpowered devices.

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
errevs
Posts: 2
Joined: 06 Jul 2016 09:23

Detect unpowered devices.

Post by errevs »

I am writing a small program that is supposed to do something based on whether the lights in our office are on. I have bought a razberry and a smartplug. The problem is that the light switch on the wall controls the contact that the smartplug is plugged into. Polling the API when the lights are off shows the device still reading 100 something watts. Is there any way to detect whether the smartplug is actually powered?
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Detect unpowered devices.

Post by PoltoS »

If you unpower your smart plug - means no Z-Wave communications are possible - the only way to detect it is to try periodically to poll it an see that it was marked as dead. Not a robust technique
errevs
Posts: 2
Joined: 06 Jul 2016 09:23

Re: Detect unpowered devices.

Post by errevs »

Yeah, I figured. But is there nothing in the API that tells me that the device is offline? doing /command/update on the device still returns "200 OK", even if it is powered down.

Thanks for your reply :)
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Detect unpowered devices.

Post by PoltoS »

Sure, because this is a request to the server. Then it will queue the packet to the device and try to send it.

Only lower API allows you to clearly check it: /ZWaveAPI/Run/devices[NN].data.isFailed.value
The high level API will only make a notification about dead device detected
Post Reply