{“error”:{“code”:-32602,“data”:“rpc.params.wrong_field”,“message”:“Wrong field of object”,“reason”:“Unexpected Json format for value type ‘rgb’: null”},“id”:“60e89ee6120bab12443706bb”,“result”:{}}
Sure I have the correct item _id number for the device.
Looking in the Online API Tool for the bulb I see this when I set it to Red in the Vera app:
{“error”:{“code”:-32602,“data”:“rpc.params.wrong_field”,“message”:“Wrong field of object”,“reason”:“Unexpected Json format for value type ‘rgb’: "{\"red\":255,\"green\":0,\"blue\":0,\"cwhite\":0,\"wwhite\":0}"”},“id”:“60e8c6e7120bab124281ffac”,“result”:{}}
I would expect that; the order of keys doesn’t usually matter in objects (although you never know how the API might be parsing the data). There are a number of items like this in the API docs that need to be further documented. There’s just too much that’s left to “discovery”, and experience has also shown that if it’s not documented, in the absence of specification there will be variances in functionality/interpretation over time as well. That list of items and values should explicitly describe the structure (for both HTTP and WebSocket APIs), acceptable range of values, and the meaning of values in the range. It’s got default values, which is good. Needs the rest.
Another question in this call is the meaning of cwhite and wwhite. By default, I’d assume that they mean the same thing that they did on Vera (wwhite is 2000K-5500K range scaled 0-255, and cwhite is 5500-9000K range scaled 0-255), but (a) nobody who hasn’t developed for Vera would know that, and (b) who knows if that’s even a correct assumption.
But I don’t know what the correct JSON data format should be ?
NOTE - In the first screen shot on the left hand side you can see all those other Requests that SET things. They are all GET single one line HTTP commands.
For Ezlo HTTP API, this is a working POST request but its for retrieving a value from a device, in this case a temperature sensor value. Rene you were the one who showed us how to do this.
Yes. You can send a POST request with a Home Remote plugin. It’s not much different than the GET. Just change “http.get” to “http.post” & be sure to include your Content (data) as the 2nd argument to the function. You can read more about it here: