I have a simple HTTP Device (smartDEN Garage Opener) which uses HTTP Binding with GET stateMethod/commandMethod
to control my garage door.
Everything works and I have no problem controlling the device.
The only issue which bugs me - it seems like an overlook that HTTP Binding lacks the ability to return device online/offline status, similarly to Network Binding.
Essentially, HTTP Binding is a Network Binding with a servicedevice
thing - it should be able to detect a physical device presence by connecting to, let say, http port 80ā¦ Except it canāt as there is no online
channel like in the Network Binding to detect if device is online or offline.
We have a timeout
and refresh
parameters but if GET/PUT/POST method times out, then what? HTTP Binding still returns last successfully read state and you canāt say if the device responded or not.
You can physically disconnect your device from the network and your HTTP Binding thing will still show as Online
. Which is just wrong.
Nowā¦ I know I can use Network Binding to test if the device is online (and I do). And I also can use a rule like this (which I also do):
rule "Garage Device Online Status"
when
Time cron "*/3 * * * * ?"
then
var sStatus = "Online"
if (sendHttpGetRequest("http://10.59.12.34/current_state.xml", 1000) === null) {
sStatus = "Offline"
}
sdoStatus.postUpdate(sStatus)
end
But why put additional overhead to openhab (threads and everything), when we can keep things simple and not create that extra overhead, especially if you run your openhab on a not very powerful Linux NAS. And why would I need my HTTP Binding to connect to my device every 5 seconds to request status and in addition I have to ping it every 3 seconds to see if itās alive?
So my question is - is there any way to detect if HTTP Binding request times out?
And if not - can a channel online
, similar to Network Binding, be added to HTTP Binding (in addition to the only url
channel)? I do realise this is more like a feature request, butā¦ how do you submit those?.
Thanks all for your input