e36Alex
(Alexander)
December 25, 2020, 7:01pm
1
Hello,
while migrating from OH2.5 to OH3 i need a little help with a http-binding item.
Its controlling the motion detection on my motioneye server.
At OH2 the item had a textual definition:
Switch Cam_Terrasse_MD "Cam_Terrasse_Bewegungsmelder aktiv" { http=">[ON:GET:http://localhost:7999/1/detection/start] >[OFF:GET:http://localhost:7999/1/detection/pause]" }
Now i would like to configure the item through the UI, but i just get the following error:
18:58:40.175 [WARN ] [tp.internal.http.HttpResponseListener] - Requesting 'http://192.168.178.11:7999/' (method='GET', content='null') failed: Connection refused
Thing/Channel configuration:
J-N-K
(Jan N. Klug)
December 25, 2020, 7:08pm
2
You need to add the state to the commandExtension (just append %2$s
).
e36Alex
(Alexander)
December 25, 2020, 7:17pm
3
Thanks for that fast reply, but i seems like, i am still doing something wrong:
19:12:14.485 [WARN ] [tp.internal.http.HttpResponseListener] - Requesting 'http://192.168.178.11:7999//1/detection/pause' (method='GET', content='null') failed: Connection refused
19:12:18.468 [WARN ] [tp.internal.http.HttpResponseListener] - Requesting 'http://192.168.178.11:7999/' (method='GET', content='null') failed: Connection refused
J-N-K
(Jan N. Klug)
December 25, 2020, 7:24pm
4
Looks like you have a // after the port. Either remove the trailing / on the baseURL or the leading / on the commandExtension.
e36Alex
(Alexander)
December 25, 2020, 7:30pm
5
Thanks, again - you were right. I removed the / but i get the same error:
19:28:19.389 [WARN ] [tp.internal.http.HttpResponseListener] - Requesting 'http://192.168.178.11:7999/1/detection/pause/' (method='GET', content='null') failed: Connection refused
19:28:21.688 [WARN ] [tp.internal.http.HttpResponseListener] - Requesting 'http://192.168.178.11:7999' (method='GET', content='null') failed: Connection refused
Only difference is, that i now got this message in log:
19:27:21.684 [INFO ] [inding.http.internal.HttpThingHandler] - Using the secure client for thing 'http:url:Cam_TE_Cam01_URL'.
J-N-K
(Jan N. Klug)
December 25, 2020, 7:36pm
6
Seems like something blocks access. This is more likely a configuration issue with the device (you used localhost
before and now an IP address. Maybe the web server is blocking outside-access.
e36Alex
(Alexander)
December 25, 2020, 9:20pm
7
Thank you, i will check it out the next days. The motioneye config seems to be ok - access for all IPs is allowed.
e36Alex
(Alexander)
December 26, 2020, 7:22pm
8
Step by step i am getting closer
Problem was, that port 7999 was just reachable from localhost. Now i turned on the webcontrol but still get errormessages:
19:20:15.556 [WARN ] [tp.internal.http.HttpResponseListener] - Requesting 'http://192.168.178.11:7999/1/detection/pause/' (method='GET', content='null') failed: 404 Not Valid Command
19:25:28.394 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Cam_TE_Cam01_Rec_Ready' changed from ON to UNDEF
Calling the URL (http://192.168.178.11:7999/1/detection/start ) in the browser works fine:
J-N-K
(Jan N. Klug)
December 26, 2020, 7:34pm
9
Maybe remove the trailing slash in the commandExtension?
1 Like
e36Alex
(Alexander)
December 26, 2020, 7:38pm
10
Thats it! Thank you very much for your help and patience!