This is a set of scripts / automations / other snippets for your Home Assistant configuration that enable you to postpone notifications and then have them automatically pushed to your phone when e.g. arriving home.
Some possible use cases for this set of snippets include:
- Sending any user at home a notification when the laundry is done.
- If no one is home, it does not make sense to send it out. But as soon as the first person arrives home, they can be notified about it.
- Sending any user at home a notification to empty the robot vacuum dustbin.
- A reminder to take out the thrash on pick up day.
- etc...
The set of files below has 2 main snippets of interest:
- Send pending notifications
- An automation that fires 5 minutes after someone arrives at home. This will fire all pending notifications and clear the queue.
- Append pending notification
- A script that takes the same arguments as a notification, but instead of sending it, it stores is in the pending notifications queue.
These are then used by, in my case, a wrapper script:
- Notify people at home
- A drop-in replacement for a
notify_mobile_<device>
service call that will notify any family member at home, or if none are at home, appends the notification to the queue.
- A drop-in replacement for a
Other files include the definition of the variable that stores the pending notifications queue, and a wrapper script for notifying a specific person (me / the wife). This just makes it all so much easier if one of us would get a new phone at some point.
- Home Assistant (duh)
- At least some knowledge about configuration in YAML
- A phone to notify
I've got most of my config in different files split up and stored in their respective folders. I.e. all files starting with prefix
scripts_
are located in thescripts
directory, prefixautomations_
in theautomations
directory, etc..The structure that I use for template entities is a bit more complicated, so to get that included easily without too much explanation, I'd just copy / paste that snipet directly into your config.
So your with the yaml files located in their directories as described above, your
config.yaml
should have these lines added:Hope this helps, if not just let me know 😉