how to detect unreachable sensor / invalid values?

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

how to detect unreachable sensor / invalid values?

Post by michap »

How can I detect - is a value actual - or maybe the sensor did not send values a long time?

As sample door sensor:
I see (just now):
{"name":"level","type":"bool","value":true,"updateTime":1365743975,"invalidateTime":1364368726}
it means: invalidate time: March,72 7:18:46 GMT
and update time: today, 5:19:35 GMT

Here is now 6:10 GMT - so for me it is not clear - maybe I did not got any values last 50 minutes? Or is the state still valid? How to check it?

Thanks
Michael
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

The value is valid (means

Post by PoltoS »

The value is valid (means reported since last request) when .updateTime > .invalidateTime. When Get is sent, the .invalidateTime is update. On Report the .updateTime is update.
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

but how to detect then a

Post by michap »

but how to detect then a missing device?
UpdateTime - it is the last updated value, will be > invalidateTime (in normal case)

If device is not sending more values (maybe defect or out of range etc) - how can I request the last contact to the device?
I just use:
/ZWaveAPI/Run/devices[xx].instances[0].commandClasses[132].data.lastWakeup.value

Here I get the last actual value (timestamp) - is this a correct way?

Michael
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

A mains powered device will

Post by PoltoS »

A mains powered device will be marked with devices[X].data.isFailed flag, while for battery you need to look at lastWakeup and compare with wakeupInterval (if Wakeup is supported). For a remote without Wakeup it is just not possible to know if it is still in the appartment or not (unless someone press a button)
Post Reply