I’m working a plug-in to integrate OpenSprinkler into Vera.
I’ve recently started using ja endpoint, to found out that sometimes the stations tree is missing. When I ask them to call the endpoint in the browser, this part is present.
Is there any header I have to add in order to get it? I can place a separate call if the node is missing, but I want to avoid this kind of mess in the code, if possible.
Thanks.
There are separate commands that you can use, such as /jo for just obtaining the option values, /jn for just station data. These are all documented in the OpenSprinkler API document. /ja is a collector of all the data combined.
Thanks Ray, I got it. Was I was referring to it is that sometimes the same endpoint is missing some information, while others everything is present. Is that by design? I really want to just call one single endpoint, if possible, to avoid sending many HTTP calls. Thanks.
It’s certainly not by design that sometimes it’s missing the stations tree. You can do a json parsing on the result and if it’s corrupted ignore that call result.
it’s the same firmware.
it seems to be related to the sockets LUA library. I switched to curl and it’s OK. maybe something related to the fact that the data are sent in chunck, I’m not really sure.