Add media player to floorplan

Hello everyone,

i’m trying to complete my floorplan. Things like light toggle or radiator state works just fine.

But ive added an icon for my media players (Sonos One) and want to play/pause when im clicking on this icon


Here is the fault code i get:

Error loading /config/configuration.yaml: while parsing a block collection in "/config/floorplan.yaml", line 16, column 8 expected <block end>, but found '<block mapping start>' in "/config/floorplan.yaml", line 29, column 9

And this is my floorplan.yaml:

   - name: media_player              #line16
     - media_player.wohnzimmer
     - media_player.kuche
       - state: 'off'
         class: 'mediaplayer-off'
       - state: 'idle'
         class: 'mediaplayer-off'
       - state: 'paused'
         class: 'mediaplayer-off'
       - state: 'playing'
         class: 'mediaplayer-on'
    action:                                            #line29
      domain: media_player
      service: media_play_pause

i hope someone can help me

its your indentation give a space before action. Your “a” should be aligned with the “s” in States