Page 1 of 1
Check if devices are still functioning
Posted: Friday 14 April 2017 9:04
by gerard76
I am trying to find a way to determine if devices are still functioning. Like a window/door sensor only has a lastupdate which is the last time the door/window opened. But some windows are hardly ever opened. Z-Wave does know the 'last seen' but I have no idea how to get this in Lua or from the son API.
I am building an alarm system and want to be able to check if all devices are still present and accounted for.
Re: Check if devices are still functioning
Posted: Friday 14 April 2017 9:37
by emme
you can use otherdevices_lastupdate['DoorWindowName'] na make a time difference for the actual time...
if the value (in seconds) is higher than a specific value you could investigate better if the device is alive or not
you can also try to use a json api call:
http://localhost:8080/json.htm?type=ope ... es&idx=idx
and parsing the json reply
ciao
M
Re: Check if devices are still functioning
Posted: Friday 14 April 2017 10:31
by gerard76
Thank you for your reply, but like I said, lastupdate will not work because a door/window sensor lastupdate will be the last time the state changed. I have sensors on windows that rarely open, so lastupdate will be days ago even though the device is working fine.
The API also does not report the 'last seen' that you can see in the Z-Wave 'setup' device list.
Re: Check if devices are still functioning
Posted: Monday 17 April 2017 8:25
by gerard76
Took a while, but I found
Code: Select all
http://localhost:8080/json.htm?type=openzwavenodes&idx=2
where idx is the
HardwareID from your z-wave transceiver found with
Code: Select all
http://localhost:8080/json.htm?type=devices&rid=113
with rid being the idx of the device you want zwave info over. The
LastUpdate returned with the zwave info is actually the
LastSeen status I was looking for, but improper named in the API so not the last time the status got updated as with LastUpdate elsewhere in the API, but the last time the z-wave controller actually had contact with the device.
I unfortunately found no pretty way to find the actual z-wave node that belongs to your domoticz device. In the end I used the name to automatically hook them together in code. So the domoticz devices 'living pir', 'living lux', 'living temp' etc belong to the zwave node named 'living'.