Notify group and tts

Anyone know if it’s possible (and how) to use the notify group to speak notifications via tts?

Would be nice to make them audible between certain hours or some other arbitrary flag (presence maybe).

I would also like to know if this is possible. Raccetture, did you have any luck?

Where are you trying to get the TTS to speak these notifications? Locally through speakers or are you trying to send a wav file externally?

TTS is a separate category to Notify. Notify Group is just a way to trigger multiple notification at the same time without having to call each one individually.

If you want to have TTS speak out the same thing as the notification was sending then simply add it to the Action of an automation. For example

action:
    - service: notify.Telstra_SMS 
      data:
        message: Oliver is home from school 
    - service: tts.google_say
      entity_id: media_player.mini_speaker
      data:
        message: 'Oliver is home from school.'

This would send me a SMS and play it through my mini speakers set up for TTS.

Is that what you’re looking to achieve?

I suggest creating a script that can take the notification message as a variable. Here’s a working notification that I use to have Alexa audibly count off the number of minutes on a timer (more verbose than Alexa’s built in timer). Mainly posting here so you can see how to bring a variable into a script - The counter and looping logic isn’t needed for your situation. The script setup and last couple of service calls in the script are what you’re interested in.

alias: Count off x minutes
fields:
  duration:
    description: Number of minutes to count off
    example: '5'
sequence:
  - service: notify.alexa_media_dresser_echo
    data:
      message: Okay, here we go. {{ duration }}.
      data:
        type: tts
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - repeat:
      count: '{{ (duration | int) }}'
      sequence:
        - delay:
            hours: 0
            minutes: 1
            seconds: 0
            milliseconds: 0
        - service: notify.android_tv_fire_tv
          data:
            message: 'Timer remaining: {{ (duration | int ) | int - repeat.index }}'
        - choose:
            - conditions:
                - condition: template
                  value_template: '{{ duration > repeat.index }}'
              sequence:
                - service: notify.alexa_media_dresser_echo
                  data:
                    message: '{{ duration | int  - repeat.index }}'
                    data:
                      type: tts
          default:
            - service: notify.alexa_media_dresser_echo
              data:
                message: >-
                  Zero.  Times up.  Those {{ duration }} minutes are gone now,
                  lost to the ages.  Never to be experienced again.  I hope you
                  used them wisely.
                data:
                  type: tts
  - service: notify.mobile_app_x
    data:
      message: Timer complete, {{ duration }} minutes elapsed!
mode: restart

Some 6 years after this question was originally asked, I’ve found myself trying to achieve the same thing, and I’m not entirely sure that either of the two suggestions offered actually provided an answer?

On the face of things, it’s a fairly simple question: how do you create a group of devices & then send the group a TTS message?

I can’t find a working solution.

I have two mobile phones, each with the Home Assistant Companion App (Mi10TLite & RedmiNote7).

In my configuration.yaml I have:

notify:
  - name: "MobilePhones"
    platform: group
    services:
      - service: mi10tlite
        data:
          target: "mi10tlite"
          message: TTS
          data:
            channel: "alarm_stream"
            ttl: 0
            priority: high
      - service: redminote7
        data:
          target: "redminote7"
          message: TTS
          data:
            channel: "alarm_stream"
            ttl: 0
            priority: high

Then in my Automation I try to send a TTS message to the group with this Action:

service: notify.mobilephones
data:
  message: TTS
  data:
    tts_text: Livingroom Motion!

but it doesn’t work. Is it possible to send a TTS message to a group?

Okay, I’m an idiot. What I needed to do was add the mobile_app_ bit to the service within the group in my configuration.yaml thus:

notify:
  - name: "MobilePhones"
    platform: group
    services:
      - service: mobile_app_mi10tlite
        data:
          target: "mi10tlite"
          message: TTS
          data:
            channel: "alarm_stream"
            ttl: 0
            priority: high
      - service: mobile_app_redminote7
        data:
          target: "redminote7"
          message: TTS
          data:
            channel: "alarm_stream"
            ttl: 0
            priority: high