Unified Notifications

Hey everyone!

I revisited one of my blueprints I’ve been using for quite awhile now and have improved it a ton.

The goal of this was to make it easier and faster to be able to utilize notifications in automations. They are really powerful and helpful if you know how, but remembering all the ins and outs is just obnoxious. I wanted to be able to simply fill out a few fields and be able to get notifications to all my devices without having to re-create it every single time. I also found it annoying that I had to send the notifications to all the devices I wanted separately.

So, I set out to make it as easy as possible to use notifications and level up my automations even further.

Here’s what my blueprint offers:

  • Full GUI configuration
  • Unified notifications for all included mobile devices and persistent notifications.
    All included devices automatically receive the notification at once.
  • Dismissing the notification on one device clears it on all
    This setting is on by default, but adjustable by a simple switch.
  • Call scripts based on how you interact with the notification
    All of these are fully optional
    • 1 script for when a dismiss event is triggered
    • 1 script for when a timeout is reached
    • 2 scripts for custom mobile actions
  • Simple fields with detailed instructions to make scripting quick and easy
  • Variables and templates are supported to make your automations even more powerful.

Whether you just want to send a simple notification when everyone is away, open and close your garage without having to open the app, or call full-blown scripts, this blueprint can do it.

Prerequisites:

  • You’re able to edit your configuration.yaml file
  • Create a notify actions group
    Here’s a bare-bones example config:
# you can slap this anywhere as long as you don't already have a `notify` block
notify:      
  - platform: group
    name: notify_all_devices
    services:
      - service: mobile_app_1
      - service: mobile_app_2

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

2 Likes

Thank you very much for this script, I updated my notifications to use this after previously using your other script.

Is it possible to add image/video to the notifications that are sent through this script? I would like to send Frigate notifications using this script if possible such that the notification shows the clip/snapshot Frigate provides.
I can do this with a basic notification/automation when following the Frigate guide linked above but I haven’t managed to get it working with this script. Passing through image_url and video_url as text worked (e.g., I put {{ image_url }} into message and it shows the correct url) but it doesn’t show the actual image or clip as a thumbnail.

After some digging I think that this is possible by inserting

image: '{{ image | default(none) }}'
video: '{{ video | default(none) }}'

into the unified_notifications.yaml file at lines: 307, 331, 347 and 363. e.g.

    - service: '{{''notify.'' + all_devices_group}}'
      data:
        title: '{{title}}'
        message: '{{message}}'
        data:
          timeout: '{{mobile_timeout}}'
          tag: '{{notification_id}}'
          channel: '{{notification_channel}}'
          importance: '{{importance}}'
          ttl: 0
          image: '{{ image | default("") }}'
          video: '{{ video | default("") }}'
          actions:
          - action: '{{action_dismiss}}'
            title: '{{action_1_text}}'

Then in the automation, add the image and video payloads like in the Frigate example when calling the script

Great suggestion!

I don’t have any use cases at the moment where I needed this, but I can definitely see it being a nice-to-have.

I have updated my script to support image, video, and audio URLs!

Let me know how it goes for you.

I have released a new version of this blueprint that uses sets of actions rather than being restricted to only using scripts.

Scripts can still be used by using the Script: Turn On action if you prefer that.

Check it out here.