Network binding for external sites

I’d like to test for the availability of the website. The 2.x binding can only discover internal devices. I can’t manually add external devices. Like this example ping at port 443.

How can I do this with OH2?

(I currently do this with the 1.x binding)


I’m also running into this problem. On 1.x, I was using the Network Health binding to determine whether I had an internet connection. After migrating to 2.x, the Network binding always tells me I have no internet connection (the item is configured to ping Google’s DNS server). I’ve tried with many combinations of Thing settings (java vs system ping, specifying or not specifying the port, etc.). Did you ever figure this out or come up with a workaround?

As a work around, you could try pinging from a shell script at regular intervals. If it succeeds, the script can update the state of an item in openHAB.

Thanks for the tip. At first I wasn’t sure how to format the result of the ping command, but after some searching, I found the sample below on the wiki. I’m posting it here for others who may be interested.

1 Like