[OH3] Cannot get the HTTP Binding to work

I have several ESP-controlled smart home devices that I’d like to get integrated in my newly installed openHAB, however I can’t get it to work.

For example, I have an LED-Light Strip. To turn it on I can call:


And I can turn it off by calling


How can I integrate this in an item? I created the following Item:

Switch ledStrip “LED Strip Schrank” { http=">[ON:GET:] >[OFF:GET:]" }

I added this in my HAPPanel, but calling this doesn’t do anything. What am I missing?

I also checked /var/log/openhab/openhab.log but it didn’t show any errors.

That item definition is for OH2 (1.x binding) and will not work on OH3. You need to define channels for your HTTP Thing which will control the ON/OFF states.

The Add-on documentation should help with this:

1 Like

That’s a bummer.

I also tried to set up my thing using the web GUI - Without any success:

What am I missing?
Is it a problem that I do not have one url for toggeling my ledStrip? Would it be better to have something like[on|off]?

what happens if you add the slash to your command extension?

PS: did you add the state transfomation? why?

hi Jan

for OH3, these should (hopefully) work…

Things file

items file

try to add %2$s to the Command URL Extension.

The state URL extension seems to be wrong as well. must be something like
/getState or /status. You can find this in the reference material of your device. Try to test it in the browser first, if you get a proper JSON reply from the device, then it is correct.

I can’t get this simple PUT method to work using the OH3 http binding configured via the ui.

The following curl command works from a shell.
“curl -v -X PUT

However the following does not work (from OH3 log trace)
“Sending to ‘’: Method = {PUT}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.20.v20190813, Content-Type: text/html}, Content = {580}”

I am expecting the Content value of 580 to be appended to the url.
Is there anyway to view the fully posted url?

Not having any issues with the GET status values from the same base url.

The URL is different. As mentioned above: add %2$s to the commandURL to Use the value in the URL.

Thanks, I finally got it to work :+1:
I prefer the files anyway. However one small thing for everyone in the future: The quotes have to be changed to " in order to work.

I figured this’d be used for evaluating the response, but I guess it’s the endpoint called to get the status (which makes much more sense).

Thank you all so much, I spend hours figuring out how to get this to work =0

One last question:

The HTTP-Doc has the following example JSON for the JSONPATH-Example:

{device: {status: { temperature: 23.2 }}}

Shouldn’t that be

{"device": {"status": { "temperature": 23.2 }}}

in order to be a correct JSON notation?

1 Like


May I ask you for your working things file?
I am struggling with the same issue

My OH2 item looks like:

Switch ALL4176_Relais1        "SRV-Proxmox"      <switchoffice>   (gKE_Technikraum)    { http=">[ON:POST:{Authorization=Basic aaaaaaaaaaaaaaaaaaaa=}] >[OFF:POST:{Authorization=Basic aaaaaaaaaaaaaaaaaaaa=}]" }
Switch ALL4176_Relais1Status  "Relais 1 [%s]"               { http="<[ALL4176_StatusCache:1000:JS(ALL4176switch_1.js)]" }

My first unsuccessful approach is this:

 Thing http:url:all4167 "Multisteckdose ALL4167" [ baseURL=""] {
      Type switch : all4176_relais1        [ commandExtension="?id=1&set=", onValue="1{Authorization=Basic aaaaaaaaaaaaaaaaaaaa=}", offValue="0{Authorization=Basic aG9tZXI6Y2RlM1ZGUiQ=}", commandMethod="POST" ]
      Type switch : all4176_relais1status  [ stateExtension="", ????????]

Are I am on the right way? How to do the js transformation?

For me, the solution in Post #5 Worked:

Thing http:url:ledStrip “ledStrip label” @ “Room” [ baseURL=“”, refresh=60] {
Type switch : ledStripOnOff “On-Off switch” [ commandExtension="%2$s", onValue=“on”, offValue=“off”, commandMethod=“GET” ]

But I am using OH3

But I guess you should upgrade from OH2 to OH3 anyway.

I just realised your command extension is missing the variable. I think it needs to look something like this:


FYI: I think it’s best to open up a new thread for your issue. This thread has been marked solved (for “my” problem anyways…)

1 Like