Let’s say, hypothetically, my internet service goes down while I’m away from home and motion is detected or a door/window sensors is triggered during that time. How could I “queue” all actions/events to send notifications to my phone once my internet connection is back up?
Ideally, I’d like to
In the event no additional events occur: Receive a notification stating my internet was briefly down (and give from when to when).
If motion detected or door/window sensors are triggered: Receive a “Summary” notification listing all events during the outage and the times they occurred.
For #1 I personally use healthchecks.io. It’s a third-party service. If your internet is down then your device hosting Home Assistant can’t alert you that it is down because there is no internet. The way that Health Checks works is you have your device running Home Assistant ping HealthChecks on an interval (I use every 5 minutes). When a ping is missed, HealthChecks sends you a notification. I receive the notifications via email and Slack. There are several integrations for notifications. Once the internet comes back up and Health Checks receives another ping, it will alert you that the internet is back up. HealthChecks.io is a free service. Here is what my check looks like on their service.
I have done this a little different. Because our internet is down now and then I bought a 3g modem as backup. I know all routers can not do this but my Fritzbox can. So in settings it is set to only use the 3g if main internet connection is down. Works flawless. There is more and more routers around now with this feature
I’ve done a similar thing, I use a Negear LB2120 cellular modem attached to a Netgear router running Asuswrt merlin (that supports dual wan fail-over/back).
It works fine for outgoing messages but I can’t log in or use the ios app when connected to the cellular modem. I’m happy with that as it is just a backup.
The DNS IP sensor warns me of a change in IP associated with connecting to a different network.
If I were to use @bradyn12’s suggestion of healthchecks.io for being able to be notification when my internet goes down that could work. I just need a way to share all actions that occurred locally during the outage once the internet is back up. Is there some simple way to just send all actions/events from the system’s logs between two times (beginning of outage and end of outage) to my phone either via text or notification?
Im not sure. You can write them to the logbook easy enough if the net is down and check that when it comes up later.
Use the ping sensor to check for internet connectivity by pinging a public web page (e.g. google)
For all your notifications insert a template to test the ping sensor and write custom entries to the logbook instead of your usual notification method if required.
Having a single notification script you pass messages to would make this easier.
I’m not sure how but you might also be able to write them to a file and email that as an attachment when the ping sensor reconnects.
Can anyone provide a step-by-step of sorts on how to accomplish this? Recording to logbook & and sending those recording that happened during downtime would be perfect.
You’d be better off writing them to a file than the logbook. The logbook will have other automated entries that will clutter up you messages and I’m not sure how to extract a time range.
Something like that. I wouldn’t use SMS to sent the file contents. It has a very limited message length (160 characters). SMTP (email) would be better.
You could send an SMS to tell you internet is back to check your email. But if you are going to do that you might as well log into your HA instance once you get the alert SMS and go over the logbook.
Your config file has nothing to do with Node-Red. Node-Red could use the state of the ping from HA, and log to a file, and when the state of the ping changes back, it fires off the messages to you in any way you like (email, pushover, pushbullet, SMS, Telegram, Facebook Messenger, etc)
Would you mind sharing how you have the healthchecks.io ping set-up on your server? Did you add a cron job or did you set up something in Home Assistant? Could you provide the instructions on setting it up how you have it? That situation is ideal for me now.