Unable to get announce to work with media_play - extra keys error

If music is playing I get this error:
extra keys not allowed @ data[‘announce’]. Got None extra keys not allowed @ data[‘media_content_id’]. Got None extra keys not allowed @ data[‘media_content_type’]. Got None

If no music is playing, I get no error (which i assume it is doing the Else

I want an announcment done if my doorbell rings.
if music is playing, i want it to pause, and then play once the announcement is done.
I can’t seem to get past the extra keys error.

My error is happening at the first part of the if then.

alias: Pool Playing - Someone At Front Door
description: ""
trigger:
  - platform: device
    device_id: cf53354590a2b449d44313ca249e79c6
    domain: nest
    type: doorbell_chime
condition:
  - condition: device
    type: is_on
    device_id: 5242f4e33544d7ad4de5a84b713a140b
    entity_id: switch.pool_radio_power
    domain: switch
action:
  - if:
      - condition: state
        entity_id: media_player.pool_radio
        state: playing
    then:
      - service: media_player.media_play
        target:
          entity_id: media_player.pool_radio
        data:
          media_content_type: music
          media_content_id: >-
            https://3elbeykt1z4thnbefkmildrc80yg5jfg.ui.nabu.casa/local/someoneisatthefr.mp3
          announce: true
    else:
      - service: tts.cloud_say
        data:
          entity_id: media_player.pool_radio
          message: Someone is currently at the Front Door
          options:
            gender: male
mode: single

This:

    then:
      - service: media_player.media_play

Should be:

    then:
      - service: media_player.play_media

The media_play service is just the equivalent of go/start/un-pause. You use it to continue paused media. You don’t get to specify what to play.

The play_media service allows you to specify what and how to play something.

1 Like