Has anyone created deferred notifications?

I’m looking to have some notifications from automations deferred to a later time, for not-so-critical events.

Example: If a sensor tells me that the basement dehumidifier tank needs to be emptied, I don’t want to be waked up in the middle of the night for that. I still want to be notified, but would rather wait until the next morning.

Has anyone done anything similar?

You could use calendar events to move notifications to a scheduled time.

Hmm, that’s an interesting idea. I haven’t done anything with calendars or schedules in HA yet. Had been planning to do so at some point, somewhere in with my current list of 50 or so HA mini-projects.

Meanwhile, I was toying with a helper that tells me if it’s “quiet hours” or not, and delivering the notification immediately during “prime time”, but setting a flag to be checked at end of “quiet time” for any deferred notifications. But that could get messy, if multiple deferred notifications need to be queued up.

So yeah, it seems calendar events might be helpful. Thanks for the suggestion.

I handle the priority of my notifications both by setting the importance to high (when wanted) and using notification channels. Then on my device I can tweak how said notifications are handled (sound, override dnd, etc.). For urgent ones, I also use separate notification commands to crank the notification volume up.

Ooh, I like the idea of varying sound volume for different notifications.

Not sure I understand what is meant by notification channels? Maybe using Notify.Events service? But cloud dependent? --Looks like I’ve got another rabbit hole to dive into. Oh well, always learning. Thanks for the lead.

Instead of triggering off the dehumidifier status, you can trigger off the time and have the dehumidifier status as a condition. I.e. instead of “when the tank is full, send an alert”, you do “when it is 9am, if the tank is full, send an alert”. You would need a second automation if you also want instant alerts throughout the day “when the tank is full, if it is between 9am and 9pm, send an alert”

Yep, I realized basically that’s the direction I was headed with my “prime time” / “quiet time” scheme. Ending up with two automations, one to run at beginning of “prime time” to check status, and an event-driven one to run anytime during “prime time”. I’ve got some thinking to do on notifications in general. Thanks.

Here’s my two notifications. One to adjust the volume:

service: notify.ben_s_devices
  message: command_volume_level
    media_stream: notification_stream
    command: 5

And the actual one with a channel selected:

service: notify.ben_s_devices
  message: The {{ trigger.from_state.attributes.friendly_name }} has been triggered!
  title: ALARM
    channel: Alarm
    importance: high
    clickAction: /lovelace/safety

@brooksben11 - So have you written your own custom component for notifications handling?

Nope, that’s all native for HA (at least with Android).

I send all non urgent notifications to a telegram group where I can read them at my leasure.

For important notifications (security alarm, smoke alarm, water leaks, etc…) I send repeated iOS critical notifications and have added the Home Assistant Companion app as an exception to Do Not Disturb mode.

What I did is, urgent notifications go to an Emergency channel that can alert anytime, and others go to the regular default channel which is hidden by DND mode on my phone during sleep hours. This way I don’t need to add that concern to my notifier code (I used to use automations but now I use alert entities because they are way simpler and more uniform).

here is a link to a method of doing what you want:

I haven’t set it up to use it myself tho so I’m not sure how well it works but stuff from jazzyisj is usually pretty solid.

If you know node-RED I can recommend this module

I use it to delay voice messages until a civilised time of day.

Hmm, certainly looks interesting. Yep, Node-RED is another rabbit hole I was planning on diving into one of these days. Thanks for the lead.

I’ve also come across this posting, which looks really useful for deferred / delayed notifications:

It’s been a while since I had updated that gist, but since the introduction of trigger based template sensors I’ve made changes to my setup to handle pending notifications to no longer rely on HACS components.

After noticing your link to my original post I’ve updated the Gist to match my current implementation.

1 Like