When I type this into a browser: http://192.168.56.11:8080/rest/items/CameraGarageMotion
I get: {"link":"http://192.168.56.11:8080/rest/items/CameraGarageMotion","state":"ON","editable":false,"type":"Switch","name":"CameraGarageMotion","tags":[],"groupNames":[]}
So REST is functioning and finds the Item. The question is, what do I put into the NVR’s URL field to change the item to ON?
Something like this?? http://192.168.56.11:8080/rest/items/CameraGarageMotion?state=ON
Restdocs is a user interface addon that lets you navigate the API and get answers back to help you determine the URL and parameters needed for your devices. You see the results in real time.
That’s a really old resource that is not complete nor completely accurate for OH 2. The REST API Docs add-on (installable from the UIs tab in PaperUI) will be the correct and up to date docs. It includes the curl command for each endpoint which one should be able to use to generate the rest.
This is where I am getting confused. I am not sending it though any code, just a field in the NVR that takes a URL. Is it not possible to do what I want with REST?
Here we help people develop their own solutions. I have led you to where I would find the answer. If you are not motivated enough to try I cannot help further.
Hey Buddy, I don’t appreciate that response. And yes, I did install the REST doc and spent almost an hour playing around. I hit a wall, so I thought ask for help. Is this not why the forums exist?
In OH3 it requires a PUT or a POST. You can’t do it with a GET. Not directly at least. You might be able to put together an HTML page that converts a GET to a PUT/POST. See OAuth2 using just OH Rules and myopenhab.org for an example doing something like that.
So I went a completely different route. The camera has the ability to send an image to an FTP server when motion is detected. I then used the ftp binding:
Now OpenHAB gets notification when there is motion, and gets an image
That only works if the FTP server can be reached. If interested there is a way to do this with the ipcamera binding, by entering the right URL in to your NVR it will trigger the alarm channel you can trigger the INSTAR alarm server and from memory that is with get requests. Can provide info if interested.