OH2, httpbind, network connection lost, results in ...?

Hi.

I’m starting with OH2 and have tried to switch another system by using httpbind and ON/OFF Urls. So far this is working.

If I start using rules and timers my question is what happens on network errors. The external system is connected through WiFi and from time to time not reachable. If I create an ON-event which can’t be received by the http-“client” I have no idea what happens. Does OH2 start the request contentiously until the “switch” response with “done”?

Or will this command result in /dev/null ?

Thx, markus

There will be an error printed to OH’s log indicating the connection timed out and that is the end of it.

However, because nothing happened, depending on what your Items are and how they are supposed to work, the state of your Item may not reflect the state of your device. There are ways to deal with this but the appropriate solution depends on specifics you haven’t provided. But some approaches include:

  • poll the device for status
  • have the device report status
  • use the expire binding
  • use the Log Reader Binding to look for the error message in the log and generate an alert and/or update Items as necessary when the error occurs

I’m sure there are more.