Simple sonos

hi

i must be doing something stupid as this won’t work:

- id: '1614024291411'
  alias: Sonos Test
  description: 'argh'
  action:
  - service: sonos.play_queue
    data: 
      source: "BBC Radio 2"
    entity_id: media_player.kitchen
    mode: single

i can see the favourite in the gui and control the speaker just fine from there manually, i have the above in automations and am trying to execute it manually before i add some triggers.

interestingly if something is playing on the sonos speaker and i press execute, it will stop whatever is playing and leave the speaker with nothing to play in the sonos app…

any help would be great, i’ve spent a few hours on this and it’s driving me a bit mad.

It won’t work without a trigger. Look at the errors when you perform a configuration check.

Use a script instead of an automation if you don’t want a trigger. Even just for testing actions.

1 Like

I‘m using media_player.

data:
      entity_id: media_player.schlafzimmer
      source: 'Radio: B 5 Aktuell'
    service: media_player.select_source

Your indentation is way off.

ok i’ve added a trigger for testing

- id: '1614028128844'
  alias: Test2
  description: ''
  trigger:
  - platform: time
    at: 07:00:00
  condition: []
  action:
  - service: sonos.play_queue
    data: 
      source: "BBC Radio 2"
    entity_id: media_player.kitchen
  mode: single

still same behaviour, i’ve checked the log and this keeps coming up
‘Error on play_queue with UPnP Error 711 received: Illegal seek target from 192.168.1.66’

Which would suggest it doesn’t know what BBC Radio 2 is, however it will happily play Radio 2 from the gui and I’m copying the exact name from there

thanks for the replies!

I don’t think sonos.play_queue is the correct service.
Please try media_player.select_source

sorry for my slow reply, i actually made this change and got distracted by work, then i started scratching my head as to why a sonos speaker is coming on at 7am everyday lol

thanks for your help :slight_smile: