Announce = True doesn't seem to work?

Hi everyone,

I’m looking to play an announcement (doorbell chime) over a google nest mini using the new announce feature from 2022.6

However when media is playing through the speaker and the doorbell is pressed, the doorbell chime plays as expected but the media does not resume (the speaker stays silent).

This is my script:

play_doorbell_sound:
  alias: Play Doorbell Sound
  mode: single
  sequence:
    - service: media_player.play_media
      target:
        entity_id: media_player.kitchen_speaker
      data:
        media_content_id: media-source://media_source/local/dingdong.mp3
        media_content_type: 'audio/mp3'
        announce: true

Have I implemented it incorrectly?

Thank you

You can read the following thread where the developers discuss how announce: true should be handled by devices that don’t natively support the feature.

In brief, at this early stage, the feature only works if the target player supports it. If the player doesn’t support it then the announcement is simply played and doesn’t resume whatever was previously playing.

you can test the feature with https://github.com/music-assistant/hass-music-assistant which creates dedicated media_players based one the ha core players you feed it

@MrSir be aware that the suggested custom component is still in development and if you use it now you will effectively be a beta tester. For example, its support for announce: true still has a few challenges to overcome.

I don’t mean to discourage you from trying it, only to inform you of what to expect.

Correct .

However , using HA we are all beta testers :wink:

And besides that, it’s currently the only integration supporting the feature.

It s also expected Music Assistant will be integrated into core Ha in the not too distant future so testing that is very much appreciated

Next to that does it allow you to do away with the core Spotify integration and the Radio stations which now are pretty but pretty underconfigurable too.

So a few quirks, and many perks!

I look forward to being a “beta tester” when it becomes an official part of HA. :wink:

Thank you both!

I didn’t realise that announce wouldn’t be supported by all media_players (particularly ‘smart’ ones like google nest). Thank you for bringing this to my attention - it will save me wasting any more time.

I’ll have a look into this and see whether this is a suitable workaround (vs a manual “pause/play/resume” script for any announcements).

Thanks again :slight_smile:

thats exactly what I had:

  intercom_message:
    alias: Intercom message
    mode: restart
    sequence:
      - condition: state
        entity_id: input_boolean.announce_intercom
        state: 'on'
      - condition: >
          {{states(states('sensor.intercom')) not in ['unknown','unavailable']}}
#      - service: script.pause_radio
#      - service: script.pause_wakeup_radio
#      - service: script.pause_spotify
      - service: media_player.volume_set
        data:
          entity_id: >
            {{states('sensor.intercom')}}
          volume_level: >
            {{states('input_number.intercom_volume')|float(0)}}
      - service: tts.cloud_say #tts.google_say
        data:
          language: >
            {{states('sensor.tts_language')}}
#            {{states('input_select.intercom_language')|lower}}
          options:
            gender: >
              {{states('input_select.tts_gender')|lower}}
          entity_id: >
            {{states('sensor.intercom')}}
#            {{state_attr('sensor.intercom','entity_id')}}
          message: >
            {% set language = states('input_select.intercom_language') %}
            {% if language == 'En' %} {{message_en}}
            {% elif language == 'Nl' %} {{message_nl}}
            {% else %} {{message_en}}
            {% endif %}
#      - service: script.resume_radio
#      - service: script.resume_wakeup_radio
#      - service: script.resume_spotify

and you can see the commented bits now taken care of in Music Assistant. At least, thats after ironing out some details :wink:

sensor.intercom here can be a single media player, or a group

note. it’s not yet supported by the core media_player entities. The same physical devices eg googlehome minis or others cant be controlled with the announce: true feature in core, but they are using that when embedded in Music assistant. You can even hide the core players in the config flow, to not have twice the media_players in your system, and only use the Mass media_players.

1 Like