The driver monitors both Internet and LAN connectivity using HTTP requests.
It implements the HealthCheck capability with a user-defined checkInterval.
The driver sends an HTTP GET request to both a defined Internet and LAN host.
If a response is received, the corresponding attribute is updated to "online."
If no response is received, the attribute remains "offline."
Additionally, it optionally monitors Hub connectivity.
If the Hub check is enabled, it sends an HTTP GET request to the defined Hub host.
If the Hub check is disabled, the hub attribute is set to "disabled."
This can be used to trigger certain actions based on the values, via RM
Thanks for this app. I think it will be very handy. The lan and internet checks are working but the hub connectivity shows "offline" regardless of whether I enter the hub ip or name.local.
The code is placing a basic httpGet and it’s looking for a successful return (200).
The log is stating connection refused. Any firewalls in between?
Basically this hub is placing the httpGet but something on the way to that request, is blocking it…
FYI: The device event list is not showing that the hub check is running, only the lan and internet checks. But the log is showing the errors for hub check.
But the the driver (your code) is running on the hubitat, so why can't it connect to itself? Does the httpGet call have to bounce off the router?
I have a router that enables me to turn on 'device isolation' per device. I'll check to see if the hubitat is 'isolated' in this way. But I am able to connect with the hubitat via laptop, ipads, iphones, etc.
Edited: Device isolation feature is NOT enabled for the hubitat on the router.
Never thought of checking “self”.
I don’t understand why one would need that to be honest.
The goal is to check a separate host.
I don’t know to be honest the implemented limitations of the httpGet at hub level.
Indeed changing the hub IP to the local hub ip and even 127.0.0.1, returns that.
Just a quick thought - no specific use case for me. You could just label the "Hub" entry as "Custom" instead so anyone could use for whatever they want.
Nice driver. Looks very promising for me to ping both of my ISP gateways and make a decision based on that.
Custom still does not appear to work for me. This is another/secondary hub. I can ping it using "ping" from my laptop and from the ping in the primary hub's network test tool.
@ramset,
Thanks for this driver.
All my hubs (HE, HA, Aqara M3, SmartThings) are showing as offline/unreachable (connection refused), except for the Hue bridge which shows as online.
@iEnam
Are those hosts connecting via https?
The httpGet goes by default on port 80 when using http and if port 80 is closed, then it returns as refused.
You can use IP:port format to point it at a specific web server port
You can use the driver to check any host, despite the field names (“internet”, “lan”).
If you are monitoring so many, just disregard the naming and use it as needed.