Page 1 of 1

updateTime for virtual devices data tree

Posted: 30 Aug 2017 21:55
by GokMasE
Hi,

I am curious regarding the json tree for the virtual devices, fetched through http://YOURIP:8083/ZAutomation/api/v1/devices

My thought was to poll this URL for datam specifically to extract the updateTime value, to find out if the tree contents had been updated since last poll time.
However, it seems like the updateTime value will be updated with a higher value every time this tree data is fetched even if the devices in tree does not have any new/changed data. Is this expected? I would have thought that the updateTime value should only be refreshed if the actual tree contents had been updated.

(I am aware of /ZWaveAPI/Data/<timestamp> but that seems to involve loads more data than just the virtual devices I am targetting)

Am I doing something wrong? Or is there any other way to simply find out IF any of the devices have had their data changed? I am looking for something that is "cheap" and suiteable for polling.


Any hints would be most welcome :)

Regards,

/Joakim

Re: updateTime for virtual devices data tree

Posted: 31 Aug 2017 22:44
by PoltoS
this is the time of renedering of the tree. it allows you to fetch updates since that time (by adding ?since=<timestamp>).

Otherwise you can check for all the updateTime for each object.

Re: updateTime for virtual devices data tree

Posted: 31 Aug 2017 22:52
by GokMasE
Somehow I missed the info that ?since=<timestamp> approach was possible in this example.
It seems like this provides exactly the information / filtering I need!

Thanks for your help :)