Sending notifications to a group

I was hoping to be able to create a group for devices that accept notifications so you wouldn’t have to add each device in each automation. Instead, you can use a group everywhere, and when you need to add another device you can just edit the group in one place and it will have effect on all automatizations.

Right now, the groups through the helpers menu are quite restricted.

That is possible; see Group - Home Assistant

3 Likes

Thank you! I missed that.

However, I don’t seem to be able to understand how to use it.

I used the device name as target, but it does not seem to work. I tried to run the notification group, but I haven’t received anything on any of the two devices I added

After creating group with multiple devices, it will expose a new service and you will call it.

service: notify.family_mobile_app
data:
  message: Please charge your car, it is at home

Yet it seems not valid:

I am aware of that part. I couldnt figure out the yaml code yet.

LE:

With this, it didnt work:

#NOTIFICATION GROUP:
notify:
  - name: "NotificationGroup"
    platform: group
    services:
    - service: mobile_app_s21
      data:
        ttl: 0
        priority: high
    - service: mobile_app_s8
      data:
        ttl: 0
        priority: high

But…for some reason, I have two services. One is called notify.notify which actually works, and it has NOTHING to do with the group I am trying to create, and the second one(that doesn’t work), the one I kept trying before which is called notify.notification_group.

a few LE later, it seems it doesn’t like what was inside data…(ttl and priority). commented them and it now works.

so it’s just this and it finally works:

notify:
  - name: "NotificationGroup"
    platform: group
    services:
    - service: mobile_app_s21
    - service: mobile_app_s8
4 Likes

Fyi, also for others getting to this thread, groups with data do work, but the data needs to be nested one more level, ie:

#NOTIFICATION GROUP:
notify:
  - name: "NotificationGroup"
    platform: group
    services:
    - service: mobile_app_s21
      data:
        data:
          ttl: 0
          priority: high
    - service: mobile_app_s8
      data:
        data:
          ttl: 0
          priority: high
5 Likes

Hiya, I’m trying to utilise this for a zone automation. where if a device enter a particular zone, to then notify the group. But within the automation blueprint, the only option I can see is to only select a device.
And even with the added group within configuration.yaml, I cannot find the item.
not sure where I’ve done wrong, appreciate some guidance on this. Cheers

Great, thanks @rotarucosminleonard and @agios. Posted another working example here: 20 things I wished I knew when I started with Home Assistant - #60 by bbccdd

1 Like

This is all good and we know how to create a group in the YAML, but a helper group is the way we should be doing it. My understanding is HA would like to go down this path. It also makes it easy for normal people to create a group of devices they would like to notify without any understanding of code.

This post is marked solved but HA should consider in making it possible in a helper group.

11 Likes

This solution works for me ! thank you !

How is that not a thing in the UI yet? Are people really not expected to need different notify groups other than notify_all ?

This thread was started two years ago - the information in it may be out of date. If possible, start a new thread, with a link to this one to provide context if necessary.