Wonderful idea. Iād always been turned off by external watchdog services because they required more time than I had, required infrastructure to pay for, etc. This is a great step around all that. Thank you!
I think a dedicated service like uptime robot can be a better solution. They have free plan with 5 minute check interval. You can even connect to pagerduty/opsgenie/victorops if you want to have a complete incident management. But you can just receive an email if you HA instance went down.
There are many similar services out there.
I canāt say how stable or good they are, but I can tell you about some of the advantages of Google Scripts over most of those:
Check/Parse json response (or whatever parsing you want to do) and not only HTTP/Ping/or even keyword which is not always enough
Higher flexibility, after my instance is Down, I donāt want to be notified every 5 minutes but only once in 3 hours and obviously, you can play with that too
As stable as this kind of service can get
Do whatever you want with the data (inc. adding it to a google sheet for traceback)
Itās a free service and nobody is running behind you to pay for any extra usage
edit: @oroce Iāve just checked the service you suggested.
I wasnāt able to find how to perform a GET request with Authorization: Bearer headerā¦ (and Iām not sure itās possible, at least for free)
Although I do find this interesting. I agree with @oroce that an external service is better. Especially for those that donāt want to expose their HA instance externally. The way services like the one oroce mentioned work is you set up a cron job on the server to perform a curl request to the address the service provides you with. It works just like your project, minus notifying you when HA is back up. Typically when there is an issue and a cron is missed that means it requires manual intervention, thus essentially making the follow-up feature of your project useless for local installations. I can see the benefit for externally accessible instances though (say to detect if internet is down). But, still I believe an online service is a better option. My suggestion is healthchecks.io or cronly.app.
Well, unless you really donāt want to expose your instance, I canāt see the benefits of using one of the online services over this, butā¦ itās always good to have multiple options
Absolutely To reiterate, I was just stating the benefits and downsides of both sides. I expose my instance, so itās not an issue for me. In fact, I will likely use your method to be alerted when internet is both down and back up, which is something I was looking to accomplish.
I was able to configure a folder to receive the messages, but I will never know I received them unless I look into that folder. Not much good unless they can get to my inbox. Iāll skip the ā+ā for this. It is a good trick for other e-mail situations though.