Chromecast Radio with station and player selection

lol, of course that’s what I have done:

  play_wakeup_radio:
    alias: Play wakeup radio
    sequence:
      - service: media_player.volume_set
        data_template:
          entity_id: >
            {{states('sensor.wakeup_radio')}}
          volume_level: '0.01'
      - service: media_player.play_media
        data_template:
          entity_id: >
            {{states('sensor.wakeup_radio')}}
          media_content_id: >
            {{states('sensor.radio_station_wake_up')}}
          media_content_type: 'audio/mp4'

no errors, but the volume doesn’t get set…

these work:

      wakeup_radio_volume:
        friendly_name: Wakeup radio volume
        value_template: >
          {{state_attr(states('sensor.wakeup_radio'),'volume_level')|float|round(2) }}

      sleep_radio_volume:
        friendly_name: Sleep radio volume
        value_template: >
          {{state_attr(states('sensor.sleep_radio'),'volume_level')|float|round(2) }}

seems the initial setting works but the loop won’t do it correctly:

  - alias: 'Increase volume loop'
    id: 'Increase volume loop'
    initial_state: 'off'
    trigger:
      platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.increase_volume_delay
    condition:
      - condition: template
        value_template: >
          {{is_state('input_boolean.snooze','on')}}
      - condition: template
        value_template: >
          {{states('sensor.wakeup_radio_volume')|float < 1 }}
    action:
      - service: script.increase_volume_delay
      - service: media_player.volume_set
        data_template:
          entity_id: >
            {{states('sensor.wakeup_radio')}}
          volume_level: >
            {% set level = 
               states('sensor.wakeup_radio_volume')|float + 
               states('input_number.increase_volume')|float %}
            {% if level < 1 %} {{ level|round(2) }}
            {% else %} 1
            {% endif %}

just one more, was a bit of a struggle, but finally it dawned on me the encapsulated volume sensor didn’t get updated. It needed the entity_ids of the individual sensors (which are all templated sensors them selves) and most of all the timer…

this seems to do the trick:

      sleep_radio_volume:
        friendly_name: Sleep radio volume
        entity_id:
          - sensor.sleep_radio
          - sensor.sleep_radio_state
          - sensor.sleep_radio_volume
          - timer.decrease_volume_delay
        value_template: >
          {{state_attr(states('sensor.sleep_radio'),'volume_level')|float|round(2) }}

and the same for the wakeup volume of course.

I included the link in my post :wink:

Really? Can’t see that, when I click the link I only see a Mediaplayer playing a scary tune…:wink:

This is realy working well, got only one little problem.

When i play the radio it just sometimes stops playing, why is this happening?
Is it a bad internet connection, or a bad mediaplayer?
When i hit play again when it stops it immediatly begins to play again…

Is it possible to automate this?
When the music stops automatic hit play again?

Hello guys,

this is my setup.

Below screenshot is from Tileboard which I am using as wall mount HA control panel.

image

Config:
4 input_booleans for station selection
media player - chromecast mini

Automation - this will turn on/off radio and switch between stations

- id: "Radio_manual"
  alias: "Radio Manual"
  initial_state: true 
  trigger:
    - platform: state
      entity_id: input_boolean.station_1, input_boolean.station_2, input_boolean.station_3, input_boolean.station_4
      to: 'on'
  condition:
    - condition: template
      value_template: '{{ states | selectattr("entity_id","in", ["input_boolean.station_1", "input_boolean.station_2", "input_boolean.station_3", "input_boolean.station_4"] ) |selectattr("state","eq","on") | list | count | int > 1}}'
  action:
    - service: input_boolean.turn_off
      data_template:
        entity_id: >
          {% for state in states.input_boolean if state.state == 'on' and 'station' in state.entity_id %}
            {% if trigger.entity_id.split('_')[2] != state.entity_id.split('_')[2] %}
              {{state.entity_id}}
            {% endif %}
          {% endfor %}   
    - service: script.turn_on
      data_template:
        entity_id: script.radio_live

- id: "Radio_manual_1"
  alias: "Radio Manual 1"
  initial_state: true 
  trigger:
    - platform: state
      entity_id: input_boolean.station_1, input_boolean.station_2, input_boolean.station_3, input_boolean.station_4
      to: 'off'
  action:
    - service: media_player.turn_off
      data_template:
        entity_id: media_player.chormecast_id 

- id: "Radio_manual_2"
  alias: "Radio Manual 2"
  initial_state: true 
  trigger:
    - platform: state
      entity_id: input_boolean.station_1, input_boolean.station_2, input_boolean.station_3, input_boolean.station_4
      to: 'on'
  condition:
    - condition: template
      value_template: '{{ states | selectattr("entity_id","in", ["input_boolean.station_1", "input_boolean.station_2", "input_boolean.station_3", "input_boolean.station_4"] ) |selectattr("state","eq","on") | list | count | int == 1}}'
  action:
    - service: script.turn_on
      data_template:
        entity_id: script.radio_live

script to turn on radio BTW, this script also takes care of suppressing start beep

 radio_live:
  alias: "Radio live"
  sequence:
    # lowers volume so you do not hear the startup sound
    -  service: media_player.volume_set
       data_template:
         entity_id: media_player.chormecast_id
         volume_level: 0.01
    # turn off Google Home - I had to do this or else I would hear the starting sound if Google Home wasn't "off" when the turn on step runs
    -  service: media_player.turn_off
       data_template:
         entity_id: media_player.chormecast_id
    # wait 1 second before turning on Google Home
    -  delay: 00:00:01
    # turn on Google Home
    -  service: media_player.turn_on
       data_template:
         entity_id: media_player.chormecast_id
    # wait 1 seconds so you don't hear the startup sound
    -  delay: 00:00:01
    # set volume to desired level
    -  service: media_player.volume_set
       data_template:
         entity_id: media_player.chormecast_id
         volume_level: 0.30
    # wait 1 second
    -  delay: 00:00:01
    -  service: media_player.play_media
       data_template:
        entity_id: media_player.chormecast_id
        media_content_id: >
          {% if is_state("input_boolean.station_1", "on") %} http://us3.internet-radio.com:8250/live
          {% elif is_state("input_boolean.station_2", "on") %} http://fmout.spicefm.in:8000/spice_b
          {% elif is_state("input_boolean.station_3", "on") %} http://51.15.208.163:8081/radio/Mirchi_love_telugu/icecast.audio
          {% elif is_state("input_boolean.station_4", "on") %} http://51.15.208.163:8081/radio/MirchiTopTucker/icecast.audio
          {% endif %}
        media_content_type: 'music'
1 Like

whats the rest of your setup look like?

Chromecast beep can be removed configuring chromecast in Home App. Anyway it is a good programming exercise.

this is my tileboard setup, running on 8" windows tablet.

I’ve pinched your code, and changed the relevant media_player entries to suit my Mini’s, but I get this error on configuration validation… any ideas?

it’s pretty much a vanilla installation of Hass, as I’m contemplating switching to Hass from Hassbian, and it does the same thing with the package that @stanvx has in his GitHub repo as well

Thanks for sharing this @Mariusthvdb it works perfectly for my needs. I’ve tweaked it a little bit and am trying to add a resume capability into it, but was wondering if you could help me with the trigger part.

What I have below works perfectly when the entity_id is hardcoded into the automation (such as entity_id: media_player.bathroom_speaker) , but when I try to reference the sensor as below it fails config check. And if I put simply sensor.radio_source (without the template part) as the entity_id, it passes the config check but the automation never triggers - probably because the sensor doesn’t have an idle state.

Wondering if you would know a way of doing this?

 ## entity_id part doesn't work currently or pass valid config check
  - alias: Radio - Resume Playing
    initial_state: 'on'
    trigger:
      - platform: state
        entity_id: {{states('sensor.radio_source')}}
        to: 'idle'
        for:
          seconds: 2
    condition:
      - condition: state
        entity_id: input_boolean.radio_playing
        state: 'on'
    action:
      - service: script.radio_play

Thanks.

you’d need a trigger platform: template to be able to do a thing like that. Which makes it a bit more complex it you need the timing in there too…maybe easiest to do that with an extra binary_sensor for the player being idle, and then use that binary as entity_id in the trigger, so you can use the for: seconds like you do now.

you’d need the states of the states… nested template like:

{{states(states('sensor.radio_source'))}}

or

{{state_attr(states('sensor.radio_source'),'idle')}}

what happens if you enter that in the dev-template?

1 Like

which automation is causing the issue?

Not sure, just copied the whole thing in as a package and it fails a check

well, that’s to be expected then… you do need to finetune according to your own entities etc of course

I did fine tune the entities… I’ll have another crack at it tomorrow when I’m in a better head space

well - this is very strange - when I move the automations to automations.yaml, they work, but don’t work in the package… argh! took me 4 hours to find - good thing I’m recovering from surgery and nothing better to do at the moment :slight_smile:

Has anyone found a way to change the “Default Media Receiver” label to the correct name of the station when using this casting method?

56

I would be great to be able to pass the information of the station that is being cast.

you may want to move this to a new topic as it doesn’t appear related to the current topic.
I can’t help you with your request as I use my server as a … server. I use a Mi Box for playing video streams

For those who are interested. I moved the entire script to Node-Red, so this is an alternative to the script part and more, such as:

  • Radio station logo in mediaplayer
  • Name of Radio station
  • Don’t have to execute a script, it reacts when input_select changes

Node-Red export:

[{"id":"b07f0f64.c097c","type":"server-state-changed","z":"39fbc49a.b7c3dc","name":"","server":"8e9ec046.8c74c","version":1,"entityidfilter":"input_select.radio_station","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":175,"y":1035,"wires":[["a6e41a6c.b64868"]]},{"id":"a6e41a6c.b64868","type":"switch","z":"39fbc49a.b7c3dc","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Radio Uit","vt":"str"},{"t":"neq","v":"Radio Uit","vt":"str"},{"t":"eq","v":"NPO Radio 1","vt":"str"},{"t":"eq","v":"NPO Radio 2","vt":"str"},{"t":"eq","v":"NPO 3FM","vt":"str"},{"t":"eq","v":"NPO Radio 4","vt":"str"},{"t":"eq","v":"Radio 538","vt":"str"},{"t":"eq","v":"Radio 10","vt":"str"},{"t":"eq","v":"Q-Music","vt":"str"},{"t":"eq","v":"Q-Music Christmas","vt":"str"},{"t":"eq","v":"BNR Nieuwsradio","vt":"str"},{"t":"eq","v":"SLAM! FM","vt":"str"},{"t":"eq","v":"100% NL","vt":"str"},{"t":"eq","v":"Veronica","vt":"str"},{"t":"eq","v":"SkyRadio","vt":"str"}],"checkall":"true","repair":false,"outputs":15,"x":470,"y":1095,"wires":[["cbb3c386.deb7"],["c1fcd0af.0355f"],["b56e05f9.10b728"],["95f00ebc.00e95"],["d713a271.3cf9a"],["1bd5bf4a.1536e1"],["ae0b8a34.822dc8"],["2847b791.a80718"],["1e606396.e27e1c"],["fccb7860.502058"],["d3aabe00.bd3d1"],["48e7fe80.844bf"],["1d1bbb77.83ea25"],["b6fd095.baa8af8"],["8984414f.945a"]]},{"id":"93a6db0a.e7e3e8","type":"api-call-service","z":"39fbc49a.b7c3dc","name":"input_select.harmony -> PowerOff","server":"8e9ec046.8c74c","version":1,"service_domain":"input_select","service":"select_option","entityId":"input_select.harmony","data":"{\"option\":\"PowerOff\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1145,"y":795,"wires":[[]]},{"id":"9122eb49.2f3e68","type":"api-current-state","z":"39fbc49a.b7c3dc","name":"input_select.harmony is not Screen Off?","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"Screen Off","halt_if_type":"str","halt_if_compare":"is_not","override_topic":false,"entity_id":"input_select.harmony","state_type":"str","state_location":"input_select.harmony","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1255,"y":1095,"wires":[["5f8410ba.a0bf2"],[]]},{"id":"5f8410ba.a0bf2","type":"api-call-service","z":"39fbc49a.b7c3dc","name":"input_select.harmony -> Screen Off","server":"8e9ec046.8c74c","version":1,"service_domain":"input_select","service":"select_option","entityId":"input_select.harmony","data":"{\"option\":\"Screen Off\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1580,"y":1095,"wires":[[]]},{"id":"c1fcd0af.0355f","type":"api-current-state","z":"39fbc49a.b7c3dc","name":"input_select.chromcast radio is Woonkamer Chromecast","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"Woonkamer Chromecast","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.chromecast_radio","state_type":"str","state_location":"input_select.chromecast_radio","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":825,"y":900,"wires":[["9122eb49.2f3e68","8dbe2a0.69a31d8"],["7e7a35d9.04224c"]]},{"id":"cbb3c386.deb7","type":"api-current-state","z":"39fbc49a.b7c3dc","name":"input_select.harmony is Screen Off?","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"Screen Off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.harmony","state_type":"str","state_location":"input_select.harmony","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":765,"y":840,"wires":[["93a6db0a.e7e3e8"],["9ae0d03e.39ba8","6658bf06.1df8a"]]},{"id":"8cd13d0d.af852","type":"comment","z":"39fbc49a.b7c3dc","name":"RADIO","info":"","x":95,"y":705,"wires":[]},{"id":"8dbe2a0.69a31d8","type":"api-current-state","z":"39fbc49a.b7c3dc","name":"media_player.google_home_big_01 is playing?","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"playing","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.google_home_big_01","state_type":"str","state_location":"media_player.google_home_big_01","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1290,"y":945,"wires":[["9ae0d03e.39ba8"],[]]},{"id":"9ae0d03e.39ba8","type":"api-call-service","z":"39fbc49a.b7c3dc","name":"media_stop","server":"8e9ec046.8c74c","version":1,"service_domain":"media_player","service":"turn_off","entityId":"media_player.google_home_big_01","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1570,"y":825,"wires":[[]]},{"id":"7e7a35d9.04224c","type":"api-current-state","z":"39fbc49a.b7c3dc","name":"media_player.chromecast is playing?","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"playing","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.chromecast","state_type":"str","state_location":"media_player.chromecast","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1305,"y":1020,"wires":[["6658bf06.1df8a"],[]]},{"id":"6658bf06.1df8a","type":"api-call-service","z":"39fbc49a.b7c3dc","name":"media_stop","server":"8e9ec046.8c74c","version":1,"service_domain":"media_player","service":"turn_off","entityId":"media_player.chromecast","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1615,"y":885,"wires":[[]]},{"id":"417142b3.66177c","type":"server-state-changed","z":"39fbc49a.b7c3dc","name":"","server":"8e9ec046.8c74c","version":1,"entityidfilter":"input_select.chromecast_radio","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":185,"y":1095,"wires":[["a6e41a6c.b64868"]]},{"id":"e6c6653.7ca4598","type":"server-state-changed","z":"39fbc49a.b7c3dc","name":"Harmony Power Off?","server":"8e9ec046.8c74c","version":1,"entityidfilter":"input_select.harmony","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"PowerOff","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":135,"y":765,"wires":[["395398ed.63e368"],[]]},{"id":"395398ed.63e368","type":"api-current-state","z":"39fbc49a.b7c3dc","name":"Radio is Woonkamer Chromecast","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"Woonkamer Chromecast","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.chromecast_radio","state_type":"str","state_location":"input_select.chromecast_radio","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":380,"y":765,"wires":[["28708e3f.766592"],[]]},{"id":"28708e3f.766592","type":"api-call-service","z":"39fbc49a.b7c3dc","name":"Radio Uit","server":"8e9ec046.8c74c","version":1,"service_domain":"input_select","service":"select_option","entityId":"input_select.radio_station","data":"{\"option\":\"Radio Uit\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":600,"y":765,"wires":[[]]},{"id":"b56e05f9.10b728","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://icecast.omroep.nl/radio1-bb-aac","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://www.nporadio1.nl/templates/perfecttemplate/images/logo-npo-radio1.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":960,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"bde50a1e.334b48","type":"cast-to-client","z":"39fbc49a.b7c3dc","name":"","url":"","contentType":"audio/mp3","message":"","language":"en","ip":"192.168.1.11","port":"","volume":"","x":1305,"y":1230,"wires":[[]],"icon":"node-red-contrib-cast/cast-cli3.svg"},{"id":"95f00ebc.00e95","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://icecast.omroep.nl/radio2-bb-aac","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/NPO_Radio_2_logo.svg/1200px-NPO_Radio_2_logo.svg.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":990,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"d713a271.3cf9a","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://icecast.omroep.nl/3fm-bb-aac","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://upload.wikimedia.org/wikipedia/en/f/f2/NPO_3FM_logo_2017.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1020,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"1bd5bf4a.1536e1","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://icecast.omroep.nl/radio4-bb-aac","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/NPO_Radio_4_logo_2014.svg/1200px-NPO_Radio_4_logo_2014.svg.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1050,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"ae0b8a34.822dc8","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://playerservices.streamtheworld.com/api/livestream-redirect/RADIO538AAC.aac","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Logo_Radio_538_2014.svg/1200px-Logo_Radio_538_2014.svg.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1080,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"2847b791.a80718","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://playerservices.streamtheworld.com/api/livestream-redirect/RADIO10AAC.aac","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://upload.wikimedia.org/wikipedia/commons/3/39/Radio_10_logo_2017.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1110,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"1e606396.e27e1c","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"https://icecast-qmusicnl-cdp.triple-it.nl/Qmusic_nl_live_32.aac","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Qmusic_logo.svg/1200px-Qmusic_logo.svg.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1140,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"fccb7860.502058","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"https://icecast-qmusicnl-cdp.triple-it.nl/Qmusic_nl_classics_96.mp3","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://static1.qmusic.medialaancdn.be/9/22/e1/43/1380936/Qmusic_ActionHeader_Kerst.jpg","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1170,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"d3aabe00.bd3d1","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://icecast-bnr.cdp.triple-it.nl/bnr_mp3_128_03","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://theurbanfuture.com/wp-content/uploads/2018/03/logo-bnr-radio.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1200,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"48e7fe80.844bf","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://19643.live.streamtheworld.com/SLAM_MP3_SC?","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://upload.wikimedia.org/wikipedia/commons/2/28/Slam%21FM-logo.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1230,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"1d1bbb77.83ea25","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://stream.100p.nl/100pctnl.mp3","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://static.marcomprocloud.eu/account/54e6f933ca6e54e2083918a8/files/d190ef616c588100ad8767d0ab373eaa.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1260,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"b6fd095.baa8af8","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://playerservices.streamtheworld.com/api/livestream-redirect/VERONICAAAC.aac","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://upload.wikimedia.org/wikipedia/commons/a/a9/Radio-Veronica-logo.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1290,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"8984414f.945a","type":"change","z":"39fbc49a.b7c3dc","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"http://playerservices.streamtheworld.com/api/livestream-redirect/SKYRADIO.mp3","tot":"str"},{"t":"set","p":"imageUrl","pt":"msg","to":"https://upload.wikimedia.org/wikipedia/commons/d/d9/Sky_Radio.png","tot":"str"},{"t":"set","p":"msg.contentTitle","pt":"msg","to":"msg.payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":695,"y":1320,"wires":[["f13260ca.6955c","30c4ee7e.665ba2"]]},{"id":"f13260ca.6955c","type":"api-current-state","z":"39fbc49a.b7c3dc","name":"Woonkamer Chromecast","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"Woonkamer Chromecast","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.chromecast_radio","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":1055,"y":1230,"wires":[["bde50a1e.334b48"],[]]},{"id":"30c4ee7e.665ba2","type":"api-current-state","z":"39fbc49a.b7c3dc","name":"Woonkamer Google Home","server":"8e9ec046.8c74c","version":1,"outputs":2,"halt_if":"Woonkamer Google Home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.chromecast_radio","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":1065,"y":1170,"wires":[["2dcf0e65.76bf62"],[]]},{"id":"2dcf0e65.76bf62","type":"cast-to-client","z":"39fbc49a.b7c3dc","name":"","url":"","contentType":"audio/mp3","message":"","language":"en","ip":"192.168.1.22","port":"","volume":"50","x":1305,"y":1170,"wires":[[]],"icon":"node-red-contrib-cast/google-home1.svg"},{"id":"8e9ec046.8c74c","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Of course you still have to change it to your needs. I have integrated Harmony Hub and Google Home + Chromecast in this flow


# RADIO #
input_select:

 radio_station:
  name: 'Select Radio Station:'
  initial: Radio Uit
  options:
    - Radio Uit
    - NPO Radio 1
    - NPO Radio 2
    - NPO 3FM
    - NPO Radio 4
    - Radio 538
    - Radio 10
    - Q-Music
    - Q-Music Christmas
    - BNR Nieuwsradio
    - SLAM! FM
    - 100% NL
    - Veronica
    - SkyRadio

 chromecast_radio:
  name: 'Select Speakers:'
  initial: Woonkamer Chromecast
  icon: mdi:speaker-wireless
  options:
    - Woonkamer Chromecast
    - Woonkamer Google Home

2 Likes