Chromecast Radio with station and player selection

Have a look here: Radiozenders Streaming URL's

finding streaming urls is not the issue it’s the metadata
“what is playing” but thanks anyway

https://scraper2.onlineradiobox.com/nl.radio10?l=0 will this work?

That should work. Create a REST sensor:

- platform: rest
  name: Radio10 Title
  resource: https://scraper2.onlineradiobox.com/nl.radio10
  value_template: '{{ value_json.title }}'
  scan_interval: 15

You can adjust the scan_interval, but bear in mind that if you poll too often your IP may end up being blocked by the website…

thank you so much

could someone make a newbie guide out of this? :blush:

It’s not completely ‘newbie’ level but everything you need is there. You will need to setup ‘packages’ first.

Here is what I have in my configuration.yaml in relation to packages:

homeassistant:
  packages: !include_dir_named packages

Then create a folder inside your config folder called ‘packages’ and save the code from my previous post in a file called chromecast_radio.yaml (or whatever you want to call it, it doesn’t matter) inside that ‘packages’ folder.

So it should be /config/packages/chromecast_radio.yaml

1 Like

super thnx! i will begin now!!! :sweat_smile: :sweat_smile:

thank you very much everything works! maybe one more question do I create a folder www/images in my config folder of home assistant?

Yep, exactly

Hi Bob,

Followed all your steps. My soundbar turns on when I press ‘Activate’ and I even managed to set the volume to a certain level. Unfortunately the soundbar doesn’t connect to the radio link I wrote in my script.

It’s a Samsung soundbar which works with Smartthing, it doesn’t work with a chromecast so I’m afraid that might be the problem.

Do you have any solutions?

very nice! thank you for this

  Hello all, i succeded making it work, the radio plays my favorite radio stations on my google home mini, but not on the alexa and not on my phone or tablet. I would like to be able to play the radio on the device that i open home assistant. Can this be achieved? Thank you Bob for your awesome work with this component.

I don’t use Amazon devices but I have seen threads talking about the difficulty in using them as media players from HA. You are best to search one of those threads.

As for playing the stream on the local device, the only way I know to do that is via the Media Browser menu, which isn’t something that is linked to this thread/ player config. You can however set something up which is similar which allows playback on the local device.

Hello Veto,

I have the script working perfectly without the addition for Sonos…

I edited the names from Living room to Sonos Living Room

I also added the extra % if sonos lines.

But it aint doing nothing for sonos…

Any hints?

thanks in advance!

K.

Hi everyone,

I was wondering if there is anyone working toward a HACKS component to get the all installed in a easy way?
I’m new to HASS and have no idea where to start in a tread that is 4 years long …
Hope any one can give me some good news :slight_smile:
Anyhow keep up the fantastic work!

This isn’t a component / integration so it will never be in HACS. It is simply a bunch of input_selects, automations etc to achieve a goal. It’s just regular HA coded YAML.

I posted a full working package further up the thread which works perfectly.

Thx @sparkydave I will have a look at it!

I have issue’s with radio stations to chromecast devices.
Created Scripts.yaml

radio_play:
  alias: Play Radio
  icon: mdi:play
  mode: restart
  sequence:
  - service: media_player.volume_set
    data:
      entity_id: >
        {% if is_state("input_select.radio_speaker", "Google nex hub") %} media_player.google_nex_hub
        {% elif is_state("input_select.radio_speaker", "Google assistant Nikki") %} media_player.slaapkamer_nikki
        {% endif %}
      volume_level: '{{ states("input_number.radio_volume.state") }}'
  - service: media_player.play_media
    data:
      entity_id: >
        {% if is_state("input_select.radio_speaker", "Google nex hub") %} media_player.google_nex_hub
        {% elif is_state("input_select.radio_speaker", "Google assistant Nikki") %} media_player.slaapkamer_nikki
        {% endif %}
      media_content_id: >
        {% if is_state(input_select.radio_station", "Bruut") %} http://icecast.vrtcdn.be/stubru_bruut-high.mp3
        {% elif is_state(input_select.radio_station", "Tijdloze") %} http://icecast.vrtcdn.be/stubru_tijdloze-high.mp3
        {% endif %}
      media_content_type: 'music'

Input_number.yaml

#radio volume
radio_volume:
  name: Volume
  icon: mdi:volume-high
  initial: 0.3
  min: 0
  max: 1
  step: 0.05
  mode: box

Input_select.yaml

#radio stations
radio_station:
    name: 'Select Radio Station:'
    options:
      - Bruut
      - Tijdloze
    initial: Bruut
    icon: mdi:radio
radio_speaker:
    name: 'Select Speaker:'
    options:
    - Google nex hub
    - Google assistant Nikki
    initial: Google nex hub
    icon: mdi:speaker-wireless

But in the log file I see a error on the scripts.yaml
“Invalid config for [script]: template value should be a string for dictionary value @ data[‘sequence’][1][‘data’]. Got None. (See /config/configuration.yaml, line 6).”

Anyone any idea?

Use data_template: instead of data: in your script.