HTTP Binding - how to use? (OH3)

Hi there,

i am currently switching from OH2.5 to OH3.
In OH2.5 i was already familiar with the “code-version” like in http.cfg file:


(this URL holds a JSON object like attached screenshot!)
Screenshot 2021-10-20 172421|265x500

in the file lupus.items i wrote something like:

String      Lupus_Alarm    "Lupus Area 1 Alarm"   { http="<[lupus:5000:JSONPATH($.updates.alarm_ex)]" }

Now it was possible for me to use this “Lupus_Alarm” item in any other OH2.5 places (sitemap, rules whatever).

But for OH3 everything is different to me and i try to set everything up from scratch without “hardcoding” inside the config files but all with the new frontend settings page.
Therefore i have installed the HTTP binding and set it up to the URL above to create a thing “Lupus Alarm Zentrale”.

My question is: How can i create an item (of this thing) with the specific JSON path (channel) so i can work with its state?

Thanks for everyone!

Sure. Just add a Channel with string type, and enter JSONPATH:$.updates.alarm_ex as stateTransformation. Any item linked to that channel can be used like any other item.

1 Like