Chromecast Radio with station and player selection

The way they are configured in the startpost, you can put them in your configuration.yaml

That’s exactly what I’m trying not to do …:wink:

Scripts in the scripts.yaml, automations in the automation.yaml etc etc

But where to put the inputs and how to call them. Still new to all of this , so your help is appreciated !

Cheers

Marius

@Mariusthvdb I’m sorry, I misunderstood.
You can basicly name it anything you want as long as u include it in your configuration.yaml.

For example you could use input_selectors.yaml as long as u add this line to your configuration.yaml:

input_select: !include input_selectors.yaml

Take a look at this page for more info: https://home-assistant.io/docs/configuration/splitting_configuration/

Check, that’s what I did but I got so many errors i parked them to ask you first how you’ve set them up exactly.

Please guide me by explaining where you’ve put your pieces of this, and if there’s any special calling procedure besides placing them in the correct files.

Thanks a bunch
Marius

I can’t get Radio 1 (or even 3FM) to work.
Any idea?
I tried:
http://icecast.omroep.nl/3fm-bb-mp3
and
http://icecast.omroep.nl/radio1-bb-mp3

Other urls work fine.

@PuckStar

This 3FM link works fine, I just tested: http://icecast.omroep.nl/3fm-bb-mp3

Does your chromecast play other content?

Ok got it now. First put it in script and made mistake with mp4 because I tried mp3.
Then started testing with the Service call and apparently (found out later in the logs) I put “‘audio/mp4’”.
So too many '.
Removed those and now Radio 1 and 3 work!

But I can’t get Skyradio to work. Do you?

UPDATE: found this url for Sky Radio and it works: http://19993.live.streamtheworld.com:80/SKYRADIO_SC

1 Like

hey friend @Bob_NL, i am trying to find a cheaper solution, for get multiroom áudio. I find this: https://www.youtube.com/watch?v=linWEj72V1Y do you thing that solution Works?

I’m trying to make a solution that either plays speech on one google home or most of them. I can’t seem to get the script to run:

- service: tts.google_say
  entity_id: >
    {%- if states.input_boolean.intercom_whole_house.state == 'on' -%}
      media_player.office_home
    {% else %}
      media_player.living_room
      media_player.xyz
      media_player.office_home
    {%- endif -%}
  data_template:
    message: "{{ speech_message }}"
    cache: true

try…

- service: tts.google_say
  entity_id: >
    {%- if states.input_boolean.intercom_whole_house.state == 'on' -%}
      - media_player.office_home
    {% else %}
      - media_player.living_room
      - media_player.xyz
      - media_player.office_home
    {%- endif -%}
  data_template:
    message: "{{ speech_message }}"
    cache: true

It was an easier solution than I thought. I had to make a group that had appropriate media players. For whatever reason you can’t put in the ‘-’ or you will get an error.

You can also try on a single line with comma’s as seperator, also put the data_template above the entity_id.
So like this:

- service: tts.google_say
  data_template:
    entity_id: >
      {%- if states.input_boolean.intercom_whole_house.state == 'on' -%}
        media_player.office_home
      {% else %}
        media_player.living_room, media_player.xyz, media_player.office_home
      {%- endif -%}
    message: "{{ speech_message }}"
    cache: true

@Rodolfo_Vieira it looks very easy and cheap. Remember you do have to build your own housing and have to get a decent speaker. I’m not sure if it will be cheaper in the end. Secondly, I don’t know of a way to tell Home Assistant that your device actually is a media player, let alone combining them into 1 group so they will play in sync. I have tried to add my regular (not dedicaded Chromecast-Audio) devices to a group and that resulted in out of sync play.

But If you do succeed it ill be much cooler off course since you build it yourself :slight_smile:.
Please keep up posted if you decide to give it a try.

1 Like

@Bob_NL hello my friend.
I find the big solution for my goal.
I installed that app https://play.google.com/store/apps/details?id=com.softmedia.receiver.castapp&hl=en it tranform your cellphone android on CHROMECAST.

So, its only need to put -platform cast inside of media_players.yaml and you mobile phone is discovered by the HA,

by the way, i have a problema.
if i go to dev-tools and put

{
  "entity_id": "media_player.k10000pro75",
  "media_content_id":
"http://stream.radio.com.pt/ROLI-ENC-401",
  "media_content_type": "audio/mp3"
}

the sound Works fine on my phone.

but if i run the script, the sound doesnt Work

radio:
  alias: Play Radio
  sequence:
    - service: media_player.volume_set
      data:
        entity_id: media_player.k10000pro75
        volume_level: '0.35'
    -  service: media_player.play_media
       data_template:
         entity_id: >
           {%- if is_state('input_select.zona_onde_toca', 'Hall') -%}
              media_player.k10000pro75
           {%- elif is_state('input_select.zona_onde_toca', 'Sala') -%}
              media_player.raspberry
           {%- elif is_state('input_select.zona_onde_toca', 'Casa Toda') -%}
              media_player.group_radio
           {%- endif -%}
         media_content_id: >
            {%- if is_state('input_select.estacoes_de_radio', 'Orbital') -%}
               http://stream.radio.com.pt/ROLI-ENC-401
            {%- elif is_state('input_select.estacoes_de_radio', 'Oxigenio') -%}
               http://stream.radio.com.pt/ROLI-ENC-498
            {%- elif is_state('input_select.estacoes_de_radio', 'Mega Hits') -%}
               http://provisioning.streamtheworld.com/pls/mega_hits.pls 
            {%- elif is_state('input_select.estacoes_de_radio', 'RFM') -%}
               http://provisioning.streamtheworld.com/pls/rfm.pls 
            {%- elif is_state('input_select.estacoes_de_radio', 'Meo Sudoeste') -%}   
               http://stream.radio.com.pt/ROLI-ENC-495
            {%- endif -%}
         media_content_type: 'audio/mp3'

any ideia?

1 Like

Try:

media_content_type: 'audio/mp4'

Thanks for the tip for the cast receiver, perhaps I might use that as a TTS receiver for when I’m home :slight_smile:

I also added a couple of dash buttons to your Chromecast Radio @Bob_NL. The first one starts the streaming and cycles between the radio channels, the other one is the “stop” button. Very convenient on my bathroom chromecast :wink:

Did you think that the problem is audio/mp4?
I ask it because as i said on dev-tools with audio/mp3 the sound plays good on the cellphone. But if i run the script the sound is not play. Its strange no? @uiguy can you help please?

And @Bob_NL can you test it in your phone please.
And tell me if it works.

I have an automation (triggering a script) playing an MP3 (Doorchime), but this needs to be in a specific location (under www folder in HA Config)

Here is my script:

  doorbell:
    sequence:
      - service: media_player.turn_on
        entity_id: media_player.lounge_satellite
      - service: media_player.turn_on
        entity_id: media_player.lounge_tv
      - service: notify.xxxxxxxxxxxxxx
        data:
          message: Someone is at the front door
      - service: media_player.volume_set
        entity_id: media_player.lounge_satellite
        data:
          volume_level: 0.50
      - service: media_player.play_media
        data_template:
          entity_id: media_player.lounge_satellite
          media_content_id: [URL.OF.HA]:8123/local/doorchime.mp3
          media_content_type: music

Here: media_content_id: [URL.OF.HA]:8123/local/doorchime.mp3

If you put: one stream radio online.

Works?

Has anyone integrated this with HADashboard?