Lovelace: Chromecast Radio Jukebox

Hey lukx
I still not able to add it in my system. Please, until you find a way to install it through HACS can you give us the option to manually install it? Some new-clear instructions with the appropriate files in one source maybe. It is really a mess right now and none of the options is working.
Hope that you can manage it.
Thanks

Is it just me or is this now partially broken in 116?

Just upgraded to 116, grabbed the newest jukebox-card.js to replace the old jukebox.js file.

It sort of works, it’s missing volume control and the stop button. Also it seems to not like to change stations. The first station plays fine, if you select another station it seems to hang.

I upgraded from 106 to 116 in steps of 2 versions, I think it was fine in 110 or 112.

Here it works only with google media players… no way to have it working with echo devices…

To fix the missing volume slider change line 72
to
const slider = document.createElement('ha-slider');

from
const slider = document.createElement('ha-paper-slider');

I created a pull request if you want

Just installed today, no volume control.
Checked line 72, it states: const slider = document.createElement('ha-slider');

Thanks for this fix, I applied it to the repository (although on a newer base than the one you created the MR for).

@rlongfield for me the updated code works fine in 117, before this no volume slider was visible.

I am updating the installation instructions in the git repository now to better reflect the installation using HACS.

Hi @lukx and others …
I really like your jukebox and thank you for it …
On my home we have a mix of Sonos speakers, Chromecast and Yamaha Receivers.
Your jukebox only supports chromecast so I made some improvements to support additional device types … (sonos, yamaha)

Here is an example config that works with the updated version …

type: 'custom:jukebox-card'
links:
  - url: >-
      https://ruv-ras1-live-hls.secure.footprint.net/hls-live/ruv-ras1/_definst_/live.m3u8
    name: Rás 2
  - url: 'http://stream3.radio.is:443/tbylgjan'
    name: Bylgjan
  - url: 'http://stream3.radio.is:443/kissfm'
    name: Kiss FM
entities:
  - media_player: media_player.sonos_one
    type: sonos
  - media_player: media_player.google_mini_tv_room
    type: chromecast
    name: TV Room
  - media_player: media_player.yamaha_receiver_living_room
    type: yamaha
    name: Yamaha

You now must specify the device type [chromecast, sonos, yamaha]
and you can specify a name to give the speaker if you do not want to use the friendly name.

Repo here > https://github.com/konni/super-duper-jukebox

Cheers,
Konni

1 Like

Hey @Konni. Is the Rás 2 link still working for you? Can’t seem to find a link that works for Rás 2. Bylgjan and K100 work like a charm.

Hi,
thank you @lukx and community.
Really like the jukebox.

Can someone please help me?
How can I change the range of the volume slider. 100 is far to loud for my needs. Would like it to be more sensitiv between 0 and 40 or 50.

Regards
Hubert

love this. should be the officially supported “hassio Radio” :slight_smile:

Thanks for great addon!

Also wonder if someone got Spotify playlist working, if so - how did you set it up?

Would love to see some sort of grouping (like categories) and drop down layout.

The problem appears to be caused by the wrong type of content specified in the jukebox-card.js file.
If you edit the file with notepad ++ on line 186 you have to replace the type “audio / mp4” with the type “music”. Once home assistant is restarted my sonos device will stream correctly.

@Konni, I tried using your jukebox-card.js and your sample configuration, changing to my media players, but there are no players at the top of the card. Additionally, if I click one of the stations, it gives me an error: 2021-01-01 13:28:08 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2917245880] not a valid value for dictionary value @ data['entity_id']

Screenshot 2021-01-01 194319

It seems like I’m missing something or perhaps have an indent error somewhere. Here’s my card:

type: 'custom:jukebox-card'
links:
  - url: 'https://nwmedia-kgbi.streamguys1.com/kgbi-mp3'
    name: KGBI Christian
  - url: 'http://stream3.radio.is:443/tbylgjan'
    name: Bylgjan
  - url: 'http://stream3.radio.is:443/kissfm'
    name: Kiss FM
entities:
  - media_player: media_player.basement_speaker
    type: chromecast
  - media_player: media_player.bathroom
    type: sonos

I verified those are the correct entities for my media players, and they are definitely the correct types. I noticed that your code calls the entities media_player: media_player.bathroom while lukx’s just has media_player.bathroom for example. I’m digging through your js to see if I can understand what’s going wrong. Any ideas?

@lukx, thank you for the excellent card, by the way! I’m using your card until I figure out how to make @Konni’s modifications work with my Sonos. Is there a way to directly call a station outside of the custom jukebox? For example, I’d like to create a button whose icon is a station logo, and the action is to call your jukebox script to play the stream. Is this possible?

@magino, following your advice, I changed that line to read media_content_type: 'music' instead of audio/mp4. However, the following error appears in the log when I try to stream a station to my Sonos:


2021-01-04 10:40:51 ERROR (SyncWorker_10) [homeassistant.components.sonos.media_player] Sonos does not support a media type of "audio/mp4"

I verified by searching the js file that audio/mp4 is nowhere to be found in the document. Is it possible the stream I’ve chosen sends in audio/mp4 and I need to look for a different stream? Where else could HA be reading audio/mp4?

Hi there, just wanted to flag that I built a newer version of this plugin which has several improvements

  1. can be configured in yaml
  2. is integrated with MediaSource so that the radios show up in the Media panel of Lovelace,
  3. has services to turn on and change the radios.

Let me know what you think!

4 Likes

Nice plugin!

Just notice that the sample configuration on GitHub is incorrect.

It has radio: under netradio: when it should be radios:

1 Like

Fixed it, thank you!

Giovanni,
I had long hoped to find time to upgrading the Lovelace Card to a real plug in, allowing precisely those services you implemented.
Thank you for building this! I will try it out soon (yeah…) and give precise feedback, and possible use this excellent work to deprecate my original repository.

1 Like

Hi,
first of all nice plugin.

Is HACS integration planned?
Would be really great.

Where should the icon appear in the browser?

netradio:
  radios: 
    - url: 'http://edge126.rdsnet.ro:84/profm/profm.mp3'
      name: Pro FM
      icon: 'https://static.tuneyou.com/images/logos/100_100/60/2160/ProFM.png'
      
    - url: 'https://live7digi.antenaplay.ro/radiozu/radiozu-48000.m3u8'
      name: Radio ZU
      icon: 'http://tvron.net/static/radio/radio-zu.png'
      
    - url: 'https://www.kissfm.ro/listen.pls'
      name: Kiss FM
      icon: 'https://www.kissfm.ro///app/assets/kiss17/favicon/apple-icon-57x57.png?n=1'
      
    - url: 'http://edge76.rdsnet.ro:84/digifm/digifm.mp3'
      name: Digi FM
      icon: 'http://www.digi-fm.ro/favicon.ico'