Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playing an MP3 over Sonos #48

Open
pwcutajar opened this issue Nov 27, 2023 · 7 comments
Open

Playing an MP3 over Sonos #48

pwcutajar opened this issue Nov 27, 2023 · 7 comments

Comments

@pwcutajar
Copy link

pwcutajar commented Nov 27, 2023

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
Copy link
Author

Anybody?

@jjlawren
Copy link
Owner

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.

@pwcutajar
Copy link
Author

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)

@jjlawren
Copy link
Owner

  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

@pwcutajar
Copy link
Author

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

@pwcutajar
Copy link
Author

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

@jjlawren
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants