Supply additional config parameters (data:) for single notification services used in a notification group

Overall question:

When using notification groups, how can I specify specific additional parameters for some of the services within a notification group?


Details:
I am using notification groups like…

notify:
  - name: ALL_DEVICES_USER_A
    platform: group
    services:
      - service: mobile_app_device_a
      - service: mobile_app_device_b
      - service: fire_tv_a
      - service: tts_basement

…following Group - Home Assistant. So inside automations and scripts I simply use service notify.all_devices_user_a to supply all nested services. Example:

      - service: notify.all_devices_user_a
        data:
          title: "Title"
          message: 'Message'

I was wondering what is the best way to supply specific configuration options specifically for/applying to single services inside that service group.


E. g. for the mobile_app_device_* I want to additionally use…

          data:
            subtitle: Devices
            subject: Devices
            push:
              group: notification-group-a
              thread-id: notification-group-a
              channel: notification-group-a

…, for fire_tv_a I need

          data:
            duration: 10
            fontsize: "max"
            timeout: 10
            interrupt: 1

… etc.


What are the options? What’s the best way to go?

  1. Supply all of the additional data keys directly inside the automations/scripts. E. g. (merge of above two examples):
      - service: notify.all_devices_user_a
        data:
          title: "Title"
          message: 'Message'
          data:
            subtitle: Devices
            subject: Devices
            push:
              group: notification-group-a
              thread-id: notification-group-a
              channel: notification-group-a
            duration: 10
            fontsize: "max"
            timeout: 10
            interrupt: 1
  • Are those config parameters magical/atomic?
  • If one notification service is not aware of one of the provided options, will it just ignore it, throw/log an error, refuse the call completely, …?
    → Update: e. g. the notify.persistent_notification service refuses the whole execution (result: no message shown at all!) once additional data is supplied (tested with the following which is for mobile app notification services):
service: notify.all_devices_user_a
data:
  message: Test
  title: Ignore me
  data:
    subtitle: Not delivered to 'persistent notification'
    subject: Not delivered to 'persistent notification'
  1. Set default options for notification services
  • Or is it possible to define some kind of “default setting” for a specific notification service?
  • So I can say “whenever service notify.fire_tv_a is called, use these additional config parameters”.
  • Update: Using Group - Home Assistant is probably fulfilling this request.
  1. Any other ideas? How do you handle this (on a larger scale)?

Update: while the main questions have never been answered here ( :slight_smile: )… I noticed, that since HA 2023.7 the service persistent_notification started to work when used in a notification group AND additional data is provided. There seems to have been a change in the way the persistent notification service works. So this is not true anymore since 2023.7: