i have an openhab setup which works very fine with KNX and myopenhab.org. I would like to integrate some scenario with my smartphone events with macrodroid, in order to do this i tested the management of my items with curl :
your code is ok - apart of that the headline says turn on the light while the code contains “OFF”.
I am using this command in my private cloud setup.
Even in case login/password would work in the URL I would not do that. URLs can be sniffed on the network between your OH installation and the target. If login/password is part of the encrypted data stream although the packets can be sniffed they cannot be read in clear text.
OK thanks for your replies. Once I will have chosen between setup my own cloud server or access to my local openhab only from my WiFi, I’m not sure if my url is correct (Wolfgang says it was OK but rossko57 not)?
Thanks again, i tried to reach my openhab private IP address from my local wifi and it works fine with the POST command.
This is funny because it works fine too with myopenhab cloud server :
pi@raspberrypi:~ $ curl --user mylogin:mypassword -X POST --header “Content-Type: text/plain” --header “Accept: application/json” -d “ON” https://myopenhab.org/rest/items/mainroom_light
myopenhab.org proxies the full OH REST API. It is and has always been possible to update and command Items through myopenhab.org. If that didn’t work, the UIs themselves wouldn’t work with myopenhab.org.
Anything you can do to OH through the REST API can be done through myopenhab.org. The only difference is having to deal with basic auth. No Items need to be exposed. The exposure of Items is only required for IFTTT integration as that’s how IFTTT gets the events that an Item has changed.