Motion sensor triggered Spotify playlist

Hoping to get some help here!

I am new to HA and have just got my Aqara motion sensor automation to work, turning on a smart plug (lights) and turn it off again after 3 minutes of no motion. All good there…

Now, I would like to use the same trigger to play a specific Spotify playlist on my google nest mini. I have integrated both Spotify and Spotcast and am currently able to control my Spotify music manually with the front end. I just cannot get my automation to work…!

My yaml automation as-is:

`alias: Tænd soul covers ved bevægelse


entity_id: binary_sensor.gaestetoilet_sensor

platform: state

to: “on”


service: script.soul_covers

entity_id: media_player.gaestetoilet_musik`

My script as-is:

`entity_id: media_player.gaestetoilet_musik

uri: ‘spotify:playlist:5hiFsMw6qfQ2Lz4ScKADZ5’

random_song: true`

My log error:

voluptuous.error.MultipleInvalid: extra keys not allowed @ data[‘uri’]

Hello and welcome to the forum. Could you please edit your post and format your pasted automation config as per step 11 here: How to help us help you - or How to ask a good question

Indentation is important in YAML and at the moment it is not possible to see yours.

Hey i know it´s an old topic, but i have the same issue.
I can trigger the automation with any other trigger, except with motion. Where is my misstake?
The software is running on RBPI4
Thanks for your help.

alias: Music
description: ""
  - type: motion
    platform: device
    device_id: 56adbd155f91ffad49c0783e8821f744
    entity_id: 9410b574517b6d3dd1366206f8ba5473
    domain: binary_sensor
      hours: 0
      minutes: 5
      seconds: 0
condition: []
  - service: media_player.play_media
      entity_id: media_player.googlehome6308
      media_content_id: >-
      media_content_type: spotify://playlist
      title: "Top 50\_– Deutschland"
      thumbnail: >-
      media_class: playlist
      children_media_class: track
        - {}
        - media_content_type: spotify://library
          media_content_id: spotify://5ee8af7ca76d6062f25219ac26a65278
        - media_content_type: spotify://current_user_playlists
          media_content_id: spotify://5ee8af7ca76d6062f25219ac26a65278/current_user_playlists
        - media_content_type: spotify://playlist
          media_content_id: >-
mode: single