HTTP binding - openHAB 3 version

Maybe the Jetty client was blocked because of too many failed requests?

Hi, Is it possible to react to an http with this addon?
I have a switch that can send an http command. This command is changeable.
I would like to pick this up.
a URL for switch is on. A URL for switch is off.
Is it possible?
Greets

Thatā€™s what the REST API is for.

Oh thx

Can you give examples, what you want to achieve? you can shorten the URL.

I try it.
I have a Shelly device and this can send an ā€œhttp actionā€.
When a switch is pressed, a simple link is sent. This also works in the browser.
For example, Http://ip/light/0?turn=off
This is the syntax for these shelly devices.

I want to send this http action to my openhab to switch a virtual switch.
Iā€™ve looked at the REST API and Iā€™m just finding stuff with curl. I donā€™t think it works with Shelly.
I want to send a link to openhab like:
Http://ip/item/dummyswitch/on

Is that possible in any way?
The shelly-binding doesnā€™t work properly for me

It is only possible to define a simple URL with GET options ?
What do you have running on your system ? Is there an apache or nginx service running on it ?
If yes it would be possible to define a simple CGI script that is used to run curl.
An other option would be to run a simple http server based on perl or python. Once the shelly connects to that server the curl action is executed.

Another option is to use the MQTT protocol instead. Youā€™d need an MQTT broker (use Mosquitto), and the openHAB MQTT binding. I think you also need to enable MQTT somewhere within the Shelly device settings too. But thereā€™s many MQTT examples on the forum, and many Shelly MQTT examples too!

Thank you for replying.
I have an Apache server on the LAN. I could use this one.
For MQTT there is an option in the shellys.
This MQTT broker is a standalone software again?
Thank you again for the answers. Iā€™m thinking about it

If you use Mosquitto then yes, it is standalone.

1 Like

There has been a fair amount of effort put into making that work. I know there has been a recent Shelly firmware change that caused hiccups for openHAB, but is now sorted out.
Have you tried to get help for getting this working?

Yes, I am also active in the other thread.

hi,
Is there any way to achieve the http (GET) command without authentication?

when selecting the blank in the drop down for authentication type , and saving, it seems to use ā€œBasic authenticationā€ (also for re-editing the thing it will show basic)

the result in logs:
Could not find authentication result for 'http://192.168.1.219/', failing here

thanks.

Please show the full log. In my setup it works. I guess you need authentication (401 Unauthorized) is the only way to reach that part of the code.

Excuse the ignorance: does this mean that those on OH 2.5.x canā€™t use this binding anymore? Or are the earlier versions available somewhere?

Exactly. There is no version for 2.5.x available because this is a new binding and these will not be backported.

HTTP binding - openHAB 2 version 

ā€¦in that case, probably worth changing the title of this thread to avoid confusion.

Given OH3 isnā€™t available yet (and for quite some people itā€™s even_farther_ away because they have specific issues to cover in their production that the day 1 release will not meet, think those to use v1 bindings that no v2 replacement is available for), it would be a kind and helpful move of yours to provide a 2.5.9 jar.
So people can start migrating today.

1 Like

Unfortunately this is not possible. Since OH3 requires some refactoring, I canā€™t easily produce an OH2 compatible version any longer.

why not upload any of the older jars ?
Hereā€™s the one I use org.openhab.binding.http-2.5.8-SNAPSHOT.txt (57.5 KB, rename to .jar)

1 Like