I have a Smart Speaker that support play music over RSTP protocol (I already tested with success over the VLC) , for my understand and from the infomation available on the addon GO2RTC, this addon can also stream a MP3 or a Webradio to a Smart Camera over RTSP also.
Can some one please help me to create a stream of a MP3 file or a webradio to test on me smart speaker?
I already try to create a stream but get some errors…
Hello MiAutomations,
This might help accessing media files…
When I want to store media, I want to be able to easily not back it up, so I do this. The backup integration has a specific button to exclude the media folder.
For me in configuration.yaml
homeassistant:
media_dirs:
local: /media
Then the /media path becomes part of /local .
And put the mp3 in a folder in HA under
/media/mp3
(The media folder already exists, you would want to add a sub folder to that, or at least I did, to keep your OCD happy.)
When I want to use an MP3, the path is
Also in order to avoid any issue with names or special characters I rename de file to test.mp3, but I still not able to play the or stream the MP3 over the addon GO2RTC …
I I think that the issue is related to the addon or the way to configure them
Yes, but it requires a virtual “go2rtc media player”. No idea if you can create one for a speaker. The player is associated with the stream defined in go2rtc. This is what it looks like for my Reolink E1 Zoom camera (go2rtc and configuration.yaml file):
The audio codec in the media_player definition is crucial (supported by the device and the highest possible quality, read more). With the above, I can play files etc. using the standard media_player.play_media invocation:
OK now I get it, probably Just tested this in VLC and it plays mp3, so hopefully your speaker can play it, too:
stream:
file_test:
- ffmpeg:/media/forest.mp3
Address used in VLC: rtsp://homeassistant.address:8554/file_test?audio=all
or rtsp://homeassistant.address:8554/file_test?video=all&audio=all
(both work)
It doesn’t work in go2rtc GUI but does work [for me] as RTSP. You don’t test RTSP in browser - use VLC or your speaker and don’t forget the ?audio (or ?audio=all) at the end because it changes the response of go2rtc addon.
Thank you so mutch for your help and support!! Now I’m able to play the music streamed from the HA using the GO2RTC addon to the smart speaker.
By the way is there any way to create this smart sepaker as a media_player.device / Entity ID to be seleceted as a player audio device over the Home Assistant?
Regarding my last question: By the way is there any way to create this smart sepaker as a media_player.device / Entity ID to be seleceted as a player audio device over the Home Assistant?
I try use this example that you give me: (inside te configuration.yaml)
No, it won’t work, this stream is fixed to 1 file and cannot accept any input.
You can check if Home Assistant has an integration for your speaker. Search by manufacturer or technology advertised on the speaker (e.g. MusicCast for Yamaha speakers). Go to Settings → Devices → Add (button) and search there.