I have updated the link above. If you set org.openhab.binding.http.internal.http to TRACE you’ll see the URL when requesting and the responses received.
Dowloaded it but did that change anything about http logging ?
That’s not really useful yet. Would need to see Headers, body and reponse code of the request
2020-07-10 20:24:04.590 [TRACE] [ttp.internal.http.RefreshingUrlCache] - Sending 'http://foscam:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState' to 'HttpRequest[GET /cgi-bin/CGIProxy.fcgi HTTP/1.1]@13442bb'
2020-07-10 20:24:04.639 [TRACE] [ttp.internal.http.RefreshingUrlCache] - RefreshingUrlCache for 'http://foscam:88/cgi-bin/CGIProxy.fcgi?cmd=getDevState' received 'org.openhab.binding.http.internal.http.Content@66d12b'
It does, thanks.
It helped me find my own error now that I see the 200 response.
Turned out it was the request I didn’t copy properly. That device needs to have http://host/yaddayadda&usr=username&pwd=password rather than basic auth.
What’s left is that apparently I must be having another HTTP thing active (resulting from first tests yesterday ?) as I keep seeing both URLs below (the difference is the additional ‘/’). I don’t find that 2nd one in the list of smarthome:things though - is it something your binding does ? (although I don’t think so as it has a different request interval).
But that reminds me of this: if I’m not mistaken, you add State and Command URL Extension to Base URL but insert a fixed ‘/’, correct?
Then please remove that fixed ‘/’ insertion as the requirement could as well be to continue the URL with ? or & like in my test case.
I have the changed the concatenation logic. It now first checks if either the last character of the baseURL or the first character of the extension is ?, / or & and adds the / only if nothing is present. jar updated
What seems not to be working yet is updating the item.
I’ve filled State Transformation with a REGEX to extract a value from one of the lines in the HTTP reponse body above: REGEX:.*?<motionDetectAlarm>(.*?)</motionDetectAlarm>.*
… but I don’t see the linked item update and no hint in the internal.http trace.
I enabled debug logging on org.openhab.transform.regex and it says it is to execute the transformation, but the output isn’t shown in log and the item isn’t updated.
I have been using that with the v1 binding and my log above (“about to transform”) shows it’s applied, doesn’t it.
Do I need to use a Number or a String item ?
Alright, it was my own silly fault. It has been working all the time but the value didn’t change so the item didn’t.
Everything alright with your binding - thanks.