with openHAB 2.5 I have some functions integrated in my BEDDI alarm clock. I make a call from the alarm clock over HTTP and switch some items over ClassicUI like this:
is the HTTP Binding not for “calling” external data und bring it to openHAB?
I have read your link and I havn’t seen how to switch an openHAB-Item with this binding.
I think I didin’t understand the idea behind the HTTP binding. I have read the documentation and I’m not sure how to use the “command” feature to implement an external call for openHAB.
I have installed the binding and on the first step I should create a thing. And there is a mandatory field for the “Base URL”. I didn’t have an URL at this time.
I want to call from my BEDDI alarm clock an URL like this “http://OPENHABIP:OPENHABPORT/classicui/CMD?Licht_OG_Schlafen=OFF” and then openHAB (or the HTTP Binding) should update the Item “Licht_OG_Schlafen” (or trigger a rule).I need only the external trigger in openHAB (the rest is ok to script in a rule for example).
I didn’t see in the documentation or the installed binding how to solve that.
So you want to control openHAB Items over HTTP from an external device? Then yes, use the Rest API. You can use the API Explorer in the OH3 to work out what the correct URL syntax would be.
with the REST API I can do a call like: http://OPENHABIP:OPENHABPORT/rest/items/Onkyo_Power/state and set the state to “ON” or “OFF”. That works great in the API-Explorer and. For example with CURL and “-d “OFF”” the item is switched off.
I need for my alarm clock an URL like this: http://OPENHABIP:OPENHABPORT/rest/items/Onkyo_Power/state=ON
And this seams not possible with the REST API. I must integrate a JSON or a CURL request to do this (my BEDDI alarm clock only support call a HTTP-URL).
Is there a way to update an item or trigger an item with an “normal URL”?
I have created a “test.html” in the openHAB-HTML-Folder and can now call this HTML-File from my BEDDI alarm clock. In the HTML file a call to the REST API is integrated.
When I create to HTML files “test_on.html” and “test_off.html” I can switch my items there.
Is there a better way for integrating external calls without ClassicUI?
Thanks,
Reinhard
Edit:
I have found a little error for me in commanditem.html:
The following lines musst commented out for use with openHAB 3: