Media Browser Source: NetRadio

Hi there

I added a new media browser source to support Net radios (web mp3 radio streams) as a source, and through automations. Also added a cool Lovelace custom card for good measure. Try it out!

Check it out here: https://github.com/giachello/netradio

2 Likes

Great work.
Is there a way for M3U support? (radio-browser.info)

1 Like

That is a great idea. Was just thinking how to simplify the configuration of this. do you know if there is a python library that parses m3u files?

Thanks Giovanni, This was exactly what I was looking for and very simple to follow your instructions and works well on my Google Assistant speakers and chrome cast. I also have a Sonos speaker but in the media browser when I select the sonos as the player the option to use NetRadio disappears. Also using the Sonos in a script with NetRadio also fails.

I don’t have Sonos so hard for me to debug this issue. would be great if you could share the debug logs.

Thanks for the reply. the log showed the following error: Logger: homeassistant.components.sonos.media_player
Source: components/sonos/media_player.py:569
Integration: Sonos (documentation, issues)
First occurred: 11:53:21 AM (1 occurrences)
Last logged: 11:53:21 AM

Sonos does not support a media type of “audio/mpeg”

Im pretty new to Home Assistant so have not got into the debugging in a big way so hopefully this will be useful information. this error was generated from essentially your script suggestion. it does not cover off the behavior in the media browser where if I select the sonos the netradio option does not show.

thanks

Ok try changing in the custom_components / const.py file,

MIME_TYPE = "audio/mpeg"
to
MIME_TYPE = "music"

Sorry, i dont know a python libaray that can doe that.
Is there a way to use VLC Telnet Client VLC media player Telnet - Home Assistant for playing Netradion on the local sound port on a raspberry?

UPDATE:
updated to new const.py verison with MIME_TYPE = “music” and now it works :heart_eyes:

1 Like

Hello Giovanni, i updated today to HA 2022.2 with the new Media UI. No it shows me that there is no logo:

no_logo_netradio

Have you any clue how to setup a logo for NetRadio (or other sources)? Alredy try it with a internet search, but dit not find the right awser.

It might work the same way as for other integrations:

Should be easy to do. Do you want to take a crack at it?

Ok, i have uploaded under /config/custom_components/netradio a 256 x 256 icon.png file. Restart HA, but nothing happens… Do i miss something?

Update:
Ah, now i think to understand. The upload has to be done on https://github.com/home-assistant/brands/tree/master/custom_integrations with new folder “netradio”. And all users will have than the same Logo / Icon. But can anyone upload a file for all users? @g.iac maybe you can have look at “Beos Audio Server Icon” (Beos Audio Server Icon in PNG, ICO oder ICNS | Kostenlose Vektor Icons)

Yes you need to do a pull request on the brands repository. It takes a few days to go through. It’s bit of a complex procedure

Hello Giovanni,
i have updated today to HA 2022.3.6 and now NetRadio is brocken under Media:
2022-03-23 18_28_44-Window
Netradio still works in Lovlace card.
Is there any way to fix the Media problem?

That is odd. Don’t have time to check this before the weekend. BTW, there is now an official Home Assistant integration with the same purpose, you may want to check that one.

Hello Giovanni,
i figure out that the problem is the selected player.
With Browser as player, all my stations are show, but can not play the stream as it is not supported by the browser any more because of the new Media Browser in 2022.3.
With Google Nesthub all works fine like in the past.
VLC Telnet and Google Home Mini show me the error in my previous post.
So its fine for me, i can deal with it.
Yes i have tried “Radio Browser” but it is “to big” for me. Its a great work, but i have no favourite. It also loads a lot of files for the station pictures. One was blocked as a Phishing connection from my AntiVirus program.
So have a nice weekend and thanks for your support.