I have a dameon that call this url every 5 min. In my results, I can see through the analysis of ‘loadtime’ value evolution, attribute of root, that the data returned by the vera through this url is refresh exactly once per hour.
Now, I have been able to force a refresh by calling “http://ip:3480/data_request?id=reload”, which seems to be a quite long and heavy procedure for the vera.
My questions are :
1- why does the vera return the same sdata during one hour (can we change this duration or is it a misunderstanding from me ?) ?
2- is the solution to use a call to reload before is suitable (are there any other solutions ?)?
You should be looking at the dataversion attribute on the root element. Every time the data changes (any data on the Vera), the dataversion updates (but loadtime doesn’t).
Hum … In fact I have already read carefully this chapter … and, well … When I manually call the sdata request neither the loadtime nor the dataversion changed. But, if I manually call a reload request and then a sdata request, then both version are updated (including temperature :)).
Quite strange not to be able to get refreshed data directly with a sdata request …
When calling with the dataversion, vera will only give you the data that has changed. By calling the reload, you are telling vera to restart her software engine which is not needed and can affect many things on your Vera. The loadversion is the value of the time the engine was reloaded. It might help if you post the url you are using to call to data so we can see if you are doing it correct.
Ok, I understand that calling a reload do more than needed, and could have bad consequences …
I think I have now to go deeper in playing with dataversion (I was previsously using loadtime) and pass it, as proposed by Garett, as parameter to the GET … This is probably what I did not understood correctly :P.
I will do that next week and give you a feed-back.
→ I remove any call of ‘reload’ and collect the dataversion to pass it to next call to ‘sdata’ request.
Thanks a lot for your help, and, if I may, I will just ask you another last question linked to this topic : what is the unit, what represents dataversion ?
I read that “Notice there is a tag, like this: DataVersion=“315587159” This is a timestamp of the last time the user_data was modified.” but I do not really undesrtand how dataversion can be interpreted as time value (like loadtime). So I wonder if dataversion is more an autoincremented value or a delta between last variable update and a start date in the past ?
At the end, the idea is to know if any relevant information can be extracted from dataversion like the time of last variable update …
I think you’re right, dataversion doesn’t resemble any kind of timestamp and probably doesn’t encode anything that can be converted to a wall-clock time. It’s probably just a monotonically-increasing value that increments every time a variable changes. Assuming anything more would be risky.
The HTTP call that you are doing will return as soon as any variable changes. Figuring out the time that a variable last changed is something that the client can do, assuming that it was watching when the change happened.
Best Home Automation shopping experience. Shop at Ezlo!