I’ve seen the question in many other threads, but never seen an answer.
How do I get the valueFormatted of a temperature sensor by requesting a local http get to the Ezlo Plus?
(I’m already set up with offlineAnonymousAccess and can set values etc)
You have to use the hub.items.list method and include the device ID of the temp sensor. That will return a json with the valueFormatted. See API - Ezlo API Documentation
In http that would be something like:
https://:17000/v1/method/hub/items/list?deviceIds=
(the parameter deviceIds is not yet correct, having trouble to find the right use.)
The main goal is to have the Ezlo Plus to update a virtual sensor on my Vera Secure when value changes (like luup.variable_watch) but the lack of examples and me not understanding the docs for the new firmware stops me from doing that.
One would think since there is hub.item.value.set there would be a hub.item.value.get but not that I have found in the docs.
So my idéa is to poll the sensor from Vera in a scene with a simple http request.
I can get the value with the api tool with hub.data.list:
But I can’t figure out how to filter nested objects in a url.
I guess it’s quite simple to script this request and extract the value from the json response if you know how, but I’m still a novice in Lua.
I see you are using curl in a Windows command shell. That handles quotes differently than Unix/Linux. The single quote does not help to make the rest of the command a simple string. You need a lot more quotes. Some thing like:
So if it needs POST to retrieve a device value from the HTTP API, I assume its not possible to have a simple one line HTTP command to return the data like you can with Vera Luup Requests ?
I’ve just worked out how to get it working in Postman application for testing however.