updateTime for virtual devices data tree

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
User avatar
GokMasE
Posts: 59
Joined: 13 Mar 2016 01:04
Location: Sweden

updateTime for virtual devices data tree

Post 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
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: updateTime for virtual devices data tree

Post 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.
User avatar
GokMasE
Posts: 59
Joined: 13 Mar 2016 01:04
Location: Sweden

Re: updateTime for virtual devices data tree

Post 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 :)
Post Reply