Error when playing media via automation

I’m trying to set up a ‘ding’ mp3 when my doorbell is pressed.

Using the services, as below, I can run this and it works.

But when I add this to the automation, I get the error.

- id: 'xxx'
  alias: '[Ring Doorbell] Play MP3 When Ding'
  description: ''
  - type: occupied
    platform: device
    device_id: xxx
    entity_id: binary_sensor.front_door_ding
    domain: binary_sensor
  condition: []
  - service: media_player.media_play
      entity_id: media_player.nestmini6103
      media_content_id: /local/Media/DoorBell.mp3
      media_content_type: music
    entity_id: media_player.nestmini6103
  - delay: 00:00:10
  - service: media_player.media_stop
    data: {}
    entity_id: media_player.nestmini6103
  mode: single

You use the wrong service in the automation, it’s play_media not media_play.

Your right.

There’s two types in the automations…