sonos_cloud icon indicating copy to clipboard operation
sonos_cloud copied to clipboard

Playing an MP3 over Sonos

Open pwcutajar opened this issue 1 year ago • 7 comments

Hi

I have the following working#

image

but i can get the following to work any help I would be grateful

image

I dont get an error just nothing plays

pwcutajar avatar Nov 27 '23 12:11 pwcutajar

Anybody?

pwcutajar avatar Dec 13 '23 12:12 pwcutajar

When playing local media, it's easier to get the URL correct by using the script/automation UI and selecting the your media that way. You can then copy the media_content_id & type to other automations.

jjlawren avatar Dec 13 '23 13:12 jjlawren

jjlawren thanks for coming back to me

Im a bit confused by your answer, ive followed the example in the documentation but to no avail. Can you get it to work at your end and paste a screen shot of the setup?

image

ive also tried

media_content_id: media-source://local/doorbell-1/mp3

neither play. ( its a shame but im working remotely HA reports success but i cant get to any sonos log files)

pwcutajar avatar Dec 13 '23 13:12 pwcutajar

  1. Create a new automation or script (you won't need to save it).
  2. Choose the "Play media" action.
  3. Select your Sonos device and choose your file using the UI media browser.
  4. Switch to YAML for the service call it generates, which you can copy & paste into other automations. The important data will look like this:
service: media_player.play_media
target:
  entity_id: media_player.sonos_basement
data:
  media_content_id: media-source://media_source/sound_files/doorbell-front.mp3
  media_content_type: audio/mpeg

image

jjlawren avatar Dec 13 '23 15:12 jjlawren

Thanks I can follow that vastly different to the documentation will this bring the volume down and not interrupt any current playlist?

pwcutajar avatar Dec 13 '23 16:12 pwcutajar

or are you saying cut and paste the line to my original automation

pwcutajar avatar Dec 13 '23 17:12 pwcutajar

This is just to determine the correct media-source ID.

For the audio overlay, you can continue to use this integration or simply use the built-in Sonos integration with the announce feature (recommended). The features from this custom integration have been (mostly) ported back.

jjlawren avatar Dec 13 '23 19:12 jjlawren