Determine if OH server is off line

Hi All,

I am trying to see if I can determine from my Openhab2 server if it has an online functioning connection to thwe OpenhabCloud service.
I have recent seen a use case where the local OH server cloud connector was active and yet the cloud service was showing it as offline.

I could see it had gone on and offline a few times overnight and my server was left with a non functioning connection when I awoke. A simple restart of the bundle re-established the cloud connectivity and all was well with the world once more.

I would like to:

  1. Determine connectivity state
  2. if offline for xx minutes restart connector
  3. rinse & repeat

Any push in the right direction gratefully received.


I would write a script that tries to access something (an item’s state perhaps) through the REST API through my If it times out you know the connection is down. If you are running this from a rule you know OH is in fact running. If you are running this as a Cron job outside if OH you can then hit the REST API on the local address. If that fails too you know OH is down. If it is up you know the connection to is down.

Thanks Rich,
I will look at creating an external script.