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

Sonos plays music but not specified soundfile #3

Open
arne-conrad opened this issue Jul 22, 2023 · 5 comments
Open

Sonos plays music but not specified soundfile #3

arne-conrad opened this issue Jul 22, 2023 · 5 comments
Labels
question Further information is requested

Comments

@arne-conrad
Copy link

Describe Your Problem:

Changed configuration in homebridge to my Sonos speaker and left soundfile the same. However, the speaker only starts playing the music last played on it instead of playing the desired soundfile. Music keeps playing for some seconds, then skips to next track, after some seconds skips to next track again and then keeps playing the music like usual. Specified soundfile is never played. No matter if I leave the standard soundf (someone is at the door) or if I enter any other.

Logs:

CLOSED
[22/07/2023, 10:09:21] [SonosAnnouncer] Switch state was set to: ON
[22/07/2023, 10:09:31] [SonosAnnouncer] Switch state was set to: ON
[22/07/2023, 10:09:32] [SonosAnnouncer] Doorbell Chime Homebridge on Outside completed.
[22/07/2023, 10:09:32] [SonosAnnouncer] Switch state was set to: OFF
[22/07/2023, 10:09:42] [SonosAnnouncer] Doorbell Chime Homebridge on Outside completed.
[22/07/2023, 10:09:42] [SonosAnnouncer] Switch state was set to: OFF

Plugin Config:

"switches": [
{
"deviceNames": [
"Outside"
],
"switchName": "Doorbell Chime Homebridge",
"trackUri": "https://soundbible.com/grab.php?id=1466&type=mp3",
"timeout": 10,
"volume": 30,
"delayMs": 100
}
],
"platform": "SonosAnnouncer"
}

Environment:

  • Plugin Version: 2.1.0
  • Homebridge Version: v1.6.1
  • Node.js Version: v18.12.1
  • NPM Version: could not find
  • Operating System: Raspbian GNU/Linux Buster (10)
@arne-conrad arne-conrad added the question Further information is requested label Jul 22, 2023
@MarshallErPunkt
Copy link

MarshallErPunkt commented Jul 25, 2023

hey
i think the problem is the path (trackUri) to the mp3 file. I had a similar problem. A URL is required which points directly to the MP3 file and not a download URL. If you search on Google: doorbell.mp3 "index of" some MP3 files will be displayed - for example this one: https://downloads.nymea.io/notification-sounds/doorbell.mp3 (i think this is the same mp3 that you tried to play)

If you store this as a trackUri it works for me.

Try it out with this one. I solved it by creating my own MP3 and making it available on the Raspberry Pi via FTP: #2

Thanks & Greetings
Marshall

@arne-conrad
Copy link
Author

Hi Marshall,

thanks for the tip - it worked! Next I would like to do the same as you and have the sound played locally from the RaspberryPi. Do you have any tutorial on how to do so = what worked for you best? I already briefly saw your comments on the original plugin and will go through them this weekend.

Thanks and best regards
drarco

@MarshallErPunkt
Copy link

So for the web server I used lighttpd and set port 88.

here are instructions: https://linuxhint.com/setup-lighttpd-server-raspberry-pi/

I then filed the Mp3 under /var/www/html
in my case i created an extra folder named sounds

in the plugin you can then simply control the files via your raspberry ip: http://{RASPBERRY_IP}:88/sounds/Test.mp3

I hope it helps :)

greeting
Marshall

@arne-conrad
Copy link
Author

Hey marshall,

thank you very much for your answer and sorry for not getting back earlier. I just found the time to play around with this plugin once again but have a question right at the beginning: do you also run homebridge on your Pi and if so, how did you manage to install the lightttp webserver simultaneously? Did you use the terminal/console within the homebridge UI using pi@homebridge and following the commands from your previous link?

Thanks for clarification!

@cirrusflyer
Copy link

cirrusflyer commented Jan 10, 2024

I'm seeing the same thing. It played what was in the queue already, but not the TTS URL I provided in the plugin:

https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=en&q=The%20alarm%20will%20sound%20in%20ten%20seconds

It does work if the URL is a mp3 file on a local webserver.

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

No branches or pull requests

3 participants