In dev tools/states while playing the station.
I find it easier to do through the website radio-browser.info - go find your radio there, and click on it, in the url you will get the content id , for example:
https://www.radio-browser.info/history/9617a958-0601-11e8-ae97-52543be04c81
Yes, thanks, but at the moment it doesn’t work with browser-mod
Thanks, this worked for me. I needed to use the stationuuid
Play radio via Home Assistant - Rouwette.com
This may help
Easy way to find content id is via an Automation
And play it with a button
been trying for 3 days to get this to work. i keep getting Media player does not support browsing media when i try to create an automation to play a radio station with radio browser
Crystal ball broken.
To get help you need to post your automation and your logs.
From what I read online, I do not think you can use alexa as a media player for this.
If I use another media player, it does work
To get help you need to post your automation and your logs.
Try another web browser, I have same issue with microsoft EDGE but work fine under Chrome and Firefox
same to me. Media player does not support browsing media\Odtwarzacz nie obsługuje przeglądania multimediów
tried on FF, Chrome and Edge
I was struggling with this for a long time as well, but now I have at least something working!
Here’s the code (this needs mini-media-player from HACS):
entities:
- entity: media_player.m5stack_atom_echo_888398_m5stack_atom_echo_888398
icon: mdi:radio
min_volume: 5
name: Kitchen audio
type: custom:mini-media-player
info: scroll
source: full
hide:
volume: false
source: false
power_state: true
name: false
icon: true
info: false
shortcuts:
columns: 4
buttons:
- name: BBC World
image: >-
https://static.wikia.nocookie.net/tvfanon6528/images/3/36/BBC_World_News_(2022-.n.v.).png/revision/latest?cb=20220426080337
type: playlist
id: media-source://radio_browser/98adecf7-2683-4408-9be7-02d3f9098eb8
- name: M1+
image: >-
http://www.pliusas.fm/wp-content/uploads/cropped-Pliuso_fav-192x192.jpg
type: playlist
id: media-source://radio_browser/9612c706-0601-11e8-ae97-52543be04c81
- name: M1
image: http://www.m-1.fm/bitrix/templates/m1/images/500x500.jpg
type: playlist
id: media-source://radio_browser/4a097926-fed9-4d61-8ed0-bc8fcf66df83
[...]
show_header_toggle: false
type: entities
To get the content code like “4a097926-fed9-4d61-8ed0-bc8fcf66df83”, I go to https://www.radio-browser.info/ and find the station I like, open it, and then copy the code from URL.
It’s a tedious manual work, and the site is very slow and unresponsive at the time of writing, but I forced myself through.
Problem: it does not show if and what is playing now.
This is the radio stations URLs resource that I use. It is in Dutch (that I speak) but is easy enough for all to use.
I used to use Sonos favorites in order to play my favorite radio stations. Now I have switched to Radio Browser for better flexibility. But this also resulted into the same problem:
It is a real pity that I cannot see the station’s name and logo anymore (e.g. in the excellent Sonos Card)!
According to the above mentioned site (thank you @LimboIvo) it should be possible to add title and thumbnail as metadata just like this:
- service: media_player.play_media
target:
entity_id: media_player.living_room
data:
media_content_id: media-source://radio_browser/96126f56-0601-11e8-ae97-52543be04c81
media_content_type: audio/mpeg
metadata:
title: NPO Radio 1
thumbnail: >-
https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/NPO_Radio_1_logo_2014.svg/640px-NPO_Radio_1_logo_2014.svg.png
media_class: music
In my case, it makes no difference whether I add those metadata or not. Has anyone managed to accomplish this?
Edit: Please also see stale GitHub issue:
I think its image:
not thumbnail:
Thank you for your reply. Unfortunately not. Do you (or anybody else) have a working example?
Hi,
Based on browser_mod and the tips from Rouwette (see above), I’ve been able to create a working dashboard for playing selected internet radio stations. In addition I’m able to select the device I’m using for playing. This is how it looks like in the frontend:
After selecting the playback device, it’s just a matter to press a button to start playing the radio station.
Info on the radio stations can be found here: https://www.radio-browser.info/
In configuration.yaml I’ve added:
input_select:
radio_je:
name: Afspelen-Jan
options:
- Browser Macbook
- Iphone Jan
- Ipad Jee
icon: mdi:radio
In browser_mod you have to add the browsers you want to use. In my case I have three device which I named brwsr_macbook, ipad_jee and iphone_13_jee. Depeding on the device I use, I’m able to select it to play the radio stations.
In the frontend I’ve create cards for this and this is the code I use:
type: vertical-stack
cards:
- type: entities
entities:
- entity: input_select.radio_je
- type: conditional
conditions:
- condition: state
entity: input_select.radio_je
state: Browser Macbook
card:
type: custom:mini-media-player
entity: media_player.brwsr_macbook
icon: mdi:speaker
artwork: cover
artwork_border: true
power_color: true
scroll_info: true
show_source: true
volume_stateless: false
group: true
- type: conditional
conditions:
- condition: state
entity: input_select.radio_je
state: Iphone Jan
card:
type: custom:mini-media-player
entity: media_player.iphone_13_jee
icon: mdi:speaker
artwork: cover
artwork_border: true
power_color: true
scroll_info: true
show_source: true
volume_stateless: false
group: true
- type: conditional
conditions:
- condition: state
entity: input_select.radio_je
state: Ipad Jee
card:
type: custom:mini-media-player
entity: media_player.ipad_jee
icon: mdi:speaker
artwork: cover
artwork_border: true
power_color: true
scroll_info: true
show_source: true
volume_stateless: false
group: true
- square: false
type: grid
cards:
- name: NPO 1
type: custom:button-card
show_entity_picture: true
entity_picture: https://www.nporadio1.nl/svg/npo_radio1_logo.svg
tap_action:
action: call-service
service: media_player.play_media
service_data:
media_content_id: http://icecast.omroep.nl/radio1-bb-mp3
media_content_type: audio/mpeg
entity_id: |
[[[
var player = states["input_select.radio_je"].state;
if ([player] == 'Browser Macbook') return 'media_player.brwsr_macbook';
if ([player] == 'Iphone Jan') return 'media_player.iphone_13_jee';
if ([player] == 'Ipad Jee') return 'media_player.ipad_jee';
]]]
- name: NPO 2
type: custom:button-card
show_entity_picture: true
entity_picture: https://www.nporadio2.nl/svg/npo_radio2_logo.svg
tap_action:
action: call-service
service: media_player.play_media
service_data:
media_content_id: http://icecast.omroep.nl/radio2-bb-mp3
media_content_type: audio/mpeg
entity_id: |
[[[
var player = states["input_select.radio_je"].state;
if ([player] == 'Browser Macbook') return 'media_player.brwsr_macbook';
if ([player] == 'Iphone Jan') return 'media_player.iphone_13_jee';
if ([player] == 'Ipad Jee') return 'media_player.ipad_jee';
]]]
- name: NPO 3
type: custom:button-card
show_entity_picture: true
entity_picture: https://www.npo3fm.nl/svg/npo_3fm_logo.svg
tap_action:
action: call-service
service: media_player.play_media
service_data:
media_content_id: http://icecast.omroep.nl/3fm-bb-mp3
media_content_type: audio/mpeg
entity_id: |
[[[
var player = states["input_select.radio_je"].state;
if ([player] == 'Browser Macbook') return 'media_player.brwsr_macbook';
if ([player] == 'Iphone Jan') return 'media_player.iphone_13_jee';
if ([player] == 'Ipad Jee') return 'media_player.ipad_jee';
]]]
- name: NPO 4 klassiek
type: custom:button-card
show_entity_picture: true
entity_picture: https://www.nporadio4.nl/svg/npo-klassiek-logo.svg
tap_action:
action: call-service
service: media_player.play_media
service_data:
media_content_id: http://icecast.omroep.nl/radio4-bb-mp3
media_content_type: audio/mpeg
entity_id: |
[[[
var player = states["input_select.radio_je"].state;
if ([player] == 'Browser Macbook') return 'media_player.brwsr_macbook';
if ([player] == 'Iphone Jan') return 'media_player.iphone_13_jee';
if ([player] == 'Ipad Jee') return 'media_player.ipad_jee';
]]]
- name: NPO 5
type: custom:button-card
show_entity_picture: true
entity_picture: https://www.nporadio5.nl/svg/npo_radio5_logo.svg
tap_action:
action: call-service
service: media_player.play_media
service_data:
media_content_id: https://icecast.omroep.nl/radio5-bb-mp3
media_content_type: audio/mpeg
entity_id: |
[[[
var player = states["input_select.radio_je"].state;
if ([player] == 'Browser Macbook') return 'media_player.brwsr_macbook';
if ([player] == 'Iphone Jan') return 'media_player.iphone_13_jee';
if ([player] == 'Ipad Jee') return 'media_player.ipad_jee';
]]]
- name: CZ
type: custom:button-card
show_entity_picture: true
entity_picture: >-
https://www.concertzender.nl/wp-content/uploads/2016/12/CZ-logo-algemeen_D.gif
tap_action:
action: call-service
service: media_player.play_media
service_data:
media_content_id: http://streams.greenhost.nl:8080/klassiek
media_content_type: audio/mpeg
entity_id: |
[[[
var player = states["input_select.radio_je"].state;
if ([player] == 'Browser Macbook') return 'media_player.brwsr_macbook';
if ([player] == 'Iphone Jan') return 'media_player.iphone_13_jee';
if ([player] == 'Ipad Jee') return 'media_player.ipad_jee';
]]]
- name: GDZB
type: custom:button-card
show_entity_picture: true
entity_picture: >-
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRyGVlusKpxzHZ6EAQRaFX5MHiYqVGjkeC3Ww&usqp=CAU
tap_action:
action: call-service
service: media_player.play_media
service_data:
media_content_id: http://streams.greenhost.nl:8080/bach
media_content_type: audio/mpeg
entity_id: |
[[[
var player = states["input_select.radio_je"].state;
if ([player] == 'Browser Macbook') return 'media_player.brwsr_macbook';
if ([player] == 'Iphone Jan') return 'media_player.iphone_13_jee';
if ([player] == 'Ipad Jee') return 'media_player.ipad_jee';
]]]
- name: R10 60's&70's Hits
type: custom:button-card
show_entity_picture: true
entity_picture: >-
https://ctfimages.talparad.io/7h8JG6sZK773A3hlCe7RdA/18e9e8f1e4e7ef76965338fd3162b1ce/60-s_-_70-s_512x512.jpg
tap_action:
action: call-service
service: media_player.play_media
service_data:
media_content_id: http://25243.live.streamtheworld.com:3690/TLPSTR18_SC
media_content_type: audio/mpeg
entity_id: |
[[[
var player = states["input_select.radio_je"].state;
if ([player] == 'Browser Macbook') return 'media_player.brwsr_macbook';
if ([player] == 'Iphone Jan') return 'media_player.iphone_13_jee';
if ([player] == 'Ipad Jee') return 'media_player.ipad_jee';
]]]
columns: 4
Indeed, this code in Developer tools pointing to an Amazon Alexa Echo Dot (media_player.office) does not work
It works if I replace the entity_id by a Google speaker though (media_player.google_nest_mini_salon)
service: media_player.play_media
data:
media_content_id: media-source://radio_browser/96126f56-0601-11e8-ae97-52543be04c81
media_content_type: audio/mpeg
enqueue: replace
target:
entity_id: media_player.office
Am I wrong or the “big Pick Media + button” is not available anymore? I’m running 2024.4.2 and do not have any hint in the selection of a radio statio through the automations UI. Nor by using the service media_player.play_media (which is the only one suggested by the UI):
Neither by using the service media_player.media_play (which I had to write in YAML and then go back to UI mode, otherwise is not suggested)
Also, i cannot figure out how to retrieve the ID of a station in case i want to write the automation manually