How to know if device is online or offline with http

Hi,

I have a node device which I use HTTP get command to check if it is on or off (simple healthcheck). I thought of using switch item that will send http get command and based on response will set it state (on / off). Th eissue is that if the node device is off and doesn’t respond, the http binding fails and the switch item doesn’t change it state to off.

I think I can use a rule for that to solve this issue but maybe there is a better way to do it.

(Note that I am checking if the application running on the node is alive and note if the device itself is on or off, otherwise I would have used network binding).

Thx for any advice

Use the Network binding on the IP and port of the server. It will switch to OFF when the server goes down.

You could also use the Expire binding to set the Switch to OFF after a certain amount of time since it’s last update to ON.