I am trying to get a webhook to change a switch item to ON (I will use a rule to turn it off).
I have this at the moment and it works well when I fire it from a web browser, (the security is set to security:option=EXTERNAL so no issues with authentication) https://192.168.1.5:8443/CMD?MotionEye=ON
Item File: Switch MotionEye
I have tested the webhook via this process and it works really well triggering IFTTT, it sends email notifications well on motion detection.
When I put my openHAB URL in it does not trigger.
I am using MotionEyeOS as the trigger for both occasions.
Does anyone have this running? What HTTP method is needed to work withthe restAPI?
If you use the HTTPS connection you must supply username and password. Even with security set to EXTERNAL the HTTPS connection still requires username/password.
It does not work when I put it in MotionEyeOS though (the motion is being triggered as I am getting emails from MotionEyeOS).
Does openHAB need any specific config settings or does it need to be a specific HTTP method for openHAB to work? There are several options for the webhook, GET, POST (query), POST (form) & POST (json). I did give them all a go without luck.
The MotionEye may not work with a self signed certificate. If that is the case it won’t establish the SSL/TLS connection to your OH. If this is the case you will need to get a cert and install it to OH. You can get a free one from letsencrypt.org.
Thanks Rick, I currently have my openhab on a windows box and am struggling a bit with understanding how to get a certificate installed, after a fair bit of reading.
I might stick with the IFTTT process for a bit and start to think about setting up a linux box for openhab.
Hi,
I run motionEye on raspi 3b+ and openhab on an other Raspi 4.
Now I try to get the motion detection information into openhab but this does not appear.
What I did:
I created an Item in openhab Switch MotionDetection "Bewegungsmeldung Kamera" (gKamera)
I added a new frame and this Item to my sitemap Frame { Text item=MotionDetection label="Bewegungsmeldung Kamera" icon="motion" visibility=[MotionDetection==ON] }
I added run a command under Motion Notification curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "ON" "http://ip_Raspi_4:8080/rest/items/MotionDetection/state" Switch MotionDetection "Bewegungsmeldung Kamera" (gKamera) p
I added run and end a command under Motion Notification curl -X PUT --header "Content-Type: text/plain" --header "Accept: application/json" -d "OFF" "http://ip_Raspi_4:8080/rest/items/MotionDetection/state"
Unfortunately nothing arrives in Openhab after a motion is detected in motioneye.
Any idea what is wrong?