M3U Playlists in Media Browser

As the poster or the original question at the top of the thread over a year ago, I re-tried your “this should just work” suggestion a few weeks back, and no, the approach does not work.
What I’m not clear on is why? Is it because it is fundamentally difficult (presumably some kind of event driven background task to cast a new track, when one finishes), or some has just not yet got round to adding the code?

1 Like

While I’m no programmer, my guess is it’s a technical hurdle that no one has been able to overcome.

Neither of the HomeSeer Google cast PI’s Dev’s have been able to profide this feature, even though there is a lot of interest for it.

I believe one of them has been working on it for quite some time.

I was planning to make a component features are the same as the node-red one but more, one-click setting on UI, SMB mounting, etc. As the node-red one is working perfectly, the component will be coding in my free time and may take a long time.

I forget the Chromecast supports m3u or not as I made node-red and tested a long time ago, if not, then the HA needs to handle the m3u file itself which the original HA media component became a fully functional media center.

1 Like

Hi, I have been fighting that media directory stuff for my HA in the last weekend. :upside_down_face:
and finally I have my NAS SMB shares mounted in “\media” and remount them on start.
having music, videos and photos as folders I can use my Chromecast and browser to play the media.
Also my ultra (hacked that dns stuff)!. Al great and that I wanted to add playlists like .m3u;
Finally i ended up at this great thread and its a long read to understand but hey I made it. :laughing:
Now I’m using a ODROID O2 hardware and “Home Assistant OS” also named hassio ?? really its confusing. but it seems that the mounted CIFS SMB shares are not @ the host where you read the directory.
So while my HA MEDIA shows me all files this addon won’t see them.
As I’m using SAMBA addon to backup the box I see the \config share that has NO media folder.
when I add that folder so I get \config\media\music\mp3 and add files to it. than it works…
but I also have a share called \media it does not see anything in there ?
Any hint is welcome as I still seem to miss the difference between hassio and own OS versions.
anyway great work! :ok_hand:

Looks like you’ve been with the same configurations that I’m currently stuck on. I want to play a playlist on my nas, but I can’t get this to work yet. Have you already built something for that? Below one of the codes I tried with, the media_player does respond, but does not start playing.

alias: NAS jukebox
sequence:
  - service: media_player.play_media
    entity_id: media_player.jbl
    data:
      media_content_id: media-source://media_source/local/NAS/Shared Music/Foute111/foute111.m3u
      media_content_type: playlist
  - service: media_player.shuffle_set
    entity_id: media_player.jbl
    data:
      shuffle: true
mode: single
icon: mdi:music

@antoinevandenhurk - Do you have a plex server installed? if yes, you can then install plex integration, which you can then access playlist that you’ve created on plex from HA via the new mediaplayer function.
my only dilemma now is to shuffle or repeat it as I still can’t get that part working

1 Like

Try
media_content_type: music
instead of playlist. Strange, indeed, but works for me.

I tried but doesn’t work.

How are you structuring the Playlist?

I have set local media source and I am trying to pass the playlist to nest mini

Thank you @nov30th for sharing this NR flow. It’s working well overall.

One small request, I found that playback fails after restarting HA (for instance after an upgrade) unless you first press the Reload playlist button. It would be ideal for playlists to be automatically reloaded on startup.

I tried injecting a payload to the PLAYLIST mapping node on startup but that failed as other nodes check the status of the reload playlist input toggle, so the input must be toggled. As a kludgy workaround, I created an automation to toggle the reload playlist input after startup.
Screen Shot 2022-06-08 at 10.37.42 AM

AFAIK NR doesn’t have the simple HA startup event, the flow or the button of reloading needs to be triggered outside the NR.

Or you could simply put a dummy item into the list and each time when play music to see if the dummy item exists and then reload the playlist before playing.

You’re right, there’s no NR startup event. I had to use a few nodes to detect when NR connected to HA as a trigger. The points I was trying to make were:

  • Playback doesn’t work on reboot without refreshing playlist first
  • Playlist cannot be refreshed simply by injecting a payload into the playlist mapping node
  • An ugly hack is to “press” the button via automation on boot, but a proper fix would be nice to have

I’ll try the “dummy item” suggestion. Thanks

It’s a little bit of a round-about solution, but if your m3u is an actual radio station you can use the integration Radio Browser - Home Assistant and add your station to the global list at https://www.radio-browser.info/

(I just did this successfully. Took a couple min for the stream to be added and available in HA media browser. Adding to this thread because it was near the top of the Google results while doing research.)

1 Like

I found this thread searching for a solution to an issue I’m having where seemingly radio stations from Radio Browser that use a .m3u will not play in media player on a HA dashboard.

For example:
This radio station (radio-browser.info) plays just fine with:

service: media_player.play_media
data:
  entity_id: media_player.kitchen_tsv_chrome
  media_content_id: media-source://radio_browser/6819ff68-0ddb-44fb-a3c6-3ed1c7fe0e4b
  media_content_type: music

But this radio station (radio-browser.info) plays nothing with:

service: media_player.play_media
data:
  entity_id: media_player.kitchen_tsv_chrome
  media_content_id: media-source://radio_browser/e6bf007f-33fa-11e9-8f31-52543be04c81
  media_content_type: music

The only difference in the stations I can tell is that the 2nd one has a .m3u URL:
url https://edg-iad-wunc-ice.streamguys1.com/wunc-128-mp3.m3u

Anyone have ideas for how I can play this 2nd radio station?

Here is another example of a .m3u station that I can’t play: (radio-browser.info)

If it matters, I’m using the browser_mod device as the entity here.

I have same issue with some radio stations I whant to add
Does anyone have a solution for this?

@nov30th

Hello.

I think you are working hard on developing m3u8.
So I’d like to make a suggestion.

If you use the hls.js library
You can play m3u8 streaming url
Could you please develop a media player add-on?

Currently, m3u8 is only available for Google Home Mini external speakers
I have no choice but to rely on it to run.

If you develop the m3u8 media player
We’re not bound by external devices
Stream related anywhere from within HA
I think it can be played.

What do you think?

@jjy9331 thank you for the suggestion, but as the project was nearly 2 years ago I moved to another place that rents a house is no HA or smarthome components then there is no updates on it.
I remember the node-red version sends the MP3 file to the Google speakers, if you build the mp3 files in node-red to a m3u8 file, and sends the file url to the speakers, you will get your speakers working I think.

Steps would be:

  1. modify the process of select one file to get all files into a list.
  2. build the url on each file which can get the mp3 files from intranet.
  3. put all the urls into a m3u8 file, put it on local which could be same folder or somewhere else.
  4. so the node-red is sends the m3u8 to the speakers once you click the play button.

if you need to random play or somethin would re-order the files before make it to the m3u8 file.

If it’s your favorite station that you listen to often, I’ve come up with an uncomplicated solution for myself.
Download this m3u file, open it with notepad, and inside you will see a link to the stream (in your case I see there http://wunc-ice.streamguys1.com:80/wunc-128-mp3).
Create a script in which you specify the media player action “play content” and specify the mp3 stream as a content id.
Save the script under the name “Play WUNC radio” for example.
Now you can use it to create your Lovelace panel item, start automation at the right time and so on.
Further you can copy this script with other names, change addresses of radio station streams in them, create a panel with many buttons, i.e. a collection of your favorite stations. It is useful to add a “stop” button (meda_player.media_stop, if I’m not mistaken) to the same panel.
Then you can use your imagination as to what else you can add there. )

read here:

1 Like