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
5 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
9 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.

13 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 ?

2 Likes

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.

Agreed, this should really be implemented via the UI for automations.

It’s still relevant today, and only available via yaml.

I made Groups in the Configuration.yaml like so:

################################################################################
#                                NOTIFICATIONS
################################################################################
notify:
  - platform: group
    name: all_devices
    unique_id: all_devices
    services:
      - service: mobile_app_google_pixel_watch
      - service: mobile_app_google_pixel_watch_jd
      - service: mobile_app_sm_s908u
      - service: mobile_app_sm_s918u
      - service: mobile_app_sm_n975u
      - service: ecobee

  - platform: group
    name: james_devices
    unique_id: james_devices
    services:
      - service: mobile_app_google_pixel_watch_jd
      - service: mobile_app_sm_s908u
      - service: mobile_app_sm_n975u

  - platform: group
    name: des_devices
    unique_id: des_devices
    services:
      - service: mobile_app_google_pixel_watch
      - service: mobile_app_sm_s918u

then in the automations you can use the groups:

1 Like

Thing is, the feature request is about something else than you’re talking. So if you want to have any chance in being supported by other people, you really should open a new FR, that specifies what you want (notification groups configurable in the UI).

This topic and its FR is about notification groups in general, and what is wanted by the OP is already doable, but only via YAML. So two different things.

@Stiltjack is right, it won’t work with this topic here. :slight_smile:

Just open a new topic, describe the feature you want to request and see, if enough votes come together so a developer gets interested. :slight_smile:

PS: please tag me in that topic, I’ll def. vote for that, thanks! :wink: