I created a driver exposing a presence sensor indicating whether the internet connection is up or down:
Hubitat Internet Connection Monitor
I've seen a number of sensor based on HTTP requests, pinging hosts, and I wanted all of it, with flexibility. Here's the description of the logic:
Checks
A series of HTTP requests are attempted, and then a series of pings. As soon as one check is successful, the connection is detected as up.
The list of URLs and hosts are configurable and rotated after each test.
Check loop
When the connection is up, tests are run every 5 minutes (configurable). When it's down, they're run every minute (also configurable).
If you find any issues, please feel free to log them on GitHub.