HTTP get request with json result

i want to make a own binding for Revogi Powerstrip

actually i created a example binding and have all required commands.

Anybody can give me a http request example with result parsing.

For example for follow commands:

Request: /?cmd=200&json={“port”:1,“state”:1}
Result: {“response”:200,“code”:200}


Request: /?cmd=511
Result: {“response”:511,“code”:200,“data”:{“watt”:[“0.00”,“0.00”,“0.00”,“0.00”,“0.00”,“0.00”],“amp”:[“0.0”,“0.0”,“0.0”,“0.0”,“0.0”,“0.0”],“switch”:[1,1,1,1,1,0]}}

I already searched in other binding sources but didn’t found requests like this.


What you need is the JSONpath transformation

If you want to do that in a own developed binding you migth look into the Tankerkönig binding. It uses a http request (with an API, which you probably don’t need) to get a JSON string. How much you can use of it depends on the depth you want to integrate the returned data.
You posted two different requests, are there other requests as well? Should all those requests be used by the binding automatically? …

Hello Jürgen,

Thanks for reply. I check it out but i try to use JSONpath transformation at first because i never developed a java application before so i need to unserstand the binding construct at first.

My first post belongs to the same solution what i’m looking for.

But one more question:
I want to create 6 items for 6 power sockets. but the last request “/?cmd=511” contains informations for all items. Do you know an example how i can work with this one request to update all item informations?

Regards, Web.
BTW: you can answer in german if you want.

I’m sorry for the misunderstanding, your “i created a example binding” pointed into the development direction.

On your question concerning the data for several sockets in one JSON-string:
You can extract the data for each socket seperatly from the JSON, as an intial try I would use the http binding to do the request and update all items seperatly using the cached reponse.

Sorry, no german answers in this forum, because other shall be able to use the answer as well!

Create a proxy item that sends that command, then a rule to update the other items.