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
Hard to tell what youāre doing in your ui as itās not in English. However finding the id is dealt with in the thread. Please read it.
I read it, forgot to mention thet playing the radio on the browser does not changes the url so i donāt see it.
Also, yes the screenshot are not in english but i wrote the corresponding service iām using and itās clear there is no list available with the channels
So what do you see in the attributes in developer tools/states when you play the desired station. Radio Browser - how to use? - #13 by nickrout
Not an URL like the one the others are having:
If i try to use it on a media_player.play_media service on the same device (TV) it works, but not on an echo device, why? I think thatās the same problem as Radio Browser - how to use? - #32 by JeromeO
But again, leaving the echo device problem away, shouldnāt i see a list on the UI automation, as the documentation and other people are saying?
Which of these integrations is it? Integrations - Home Assistant
What you see in the UI depends on the ability of the media player.
How do you find the stations you want to listen to?
There are about 8 million stations listed, but no search function by call letters, or city or even frequency?
Use the web browser.
I have the Web Browser open in the Media Tab in HA
Itās sorted by Popular, Category, Language, and then all the country flags.
If I click on the United States flag then it presents EVERY station in the USA. Thousands of them.
How do I find KJJR AM 880 or FM 107.9 in the Flathead Valley Montana?
Itās not sorted by call letters or city, the stations donāt appear to be sorted alphabetically
Top line of the USA folder
EXA FM: POP | 90.7 FM KWMU-1 | iHeart Radio CafƩ | KHSU 90.5FM | KTLR The Light
What is that sorting Scheme?
How do I find the stations I want?
Where is the search box for me to enter āKJJRā or ā880ā?
Ctrl - F doesnāt work.
Just scroll down through the thousands of stations and hope I find it?
I also donāt see a favorites function. Or a way to create the list of the stations Iām interested in.