Chromecast Radio with station and player selection

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

@coen17st thanks for sharing. I definitely have to dive in the whole Node-Red platform some day, I have zero experience with it so far.

I’m rather new to HA, but love the idea of this as I want to stream my favorite radio stations to my various Onkyo receivers and speakers with Chromecast built-in. Has anyone successfully gotten any of these scripts working on an Onkyo receiver? I’ve tried all the different variations to my Onkyo TX-RZ810, and while I believe the code is set up correctly in my HA, nothing ever plays. The script will turn on the receiver and set it to the Chromecast input but it stalls out at “connecting…” and never plays any of the dozen streams I’ve tried (including all the sample streams posted by the various contributors that autoplay fine in my browser). I can cast to the receiver via the Chrome browser on my computer, so I know that works, but even a simple script to media_player.play_media service fails to play. Anyone with Onkyo experience that has some tricks to share? Thanks in advance!

How are your media_player entities set up? Have you tried setting up the Cast: integration?

Hi @sparkydave, thanks for the response. I have each receiver set up twice as entities - once with the automatically found Google Cast integration, and one manually added entity using the Onkyo integration. I have tried using both media player entities in these scripts, but neither are working for me (actually playing the stream).

What code are you using to start the stream though? Without code, it’s hard to diagnose. There could be a small mistake in your version of the package.

Try a simple service call to make sure the media_player is working. Something like this:

script:
    alias: Play Raw FM on Chromecast Audio
    sequence:
    - service: media_player.play_media
      data:
        entity_id: media_player.YOUR_CAST_ENTITY
        media_content_id: https://frontend.stream.rawfm.net.au/i/syd-stream-192k.mp3
        media_content_type: 'audio/mp4'

just replace the part IN CAPS above with one of your entities. See if that works.

Actually, even easier, just copy the section under the ‘data’ heading into the dev-services panel and select your media_player from the list, send the data as part of a service call.

Thank you for the detailed instructions - this is exactly what I had simplified it down to to try and get it working, but I’m still not getting any audio - even with the simple service call method. The service call turns on the receiver and sets it to Chromecast input but nothing plays - the receiver just says “Connecting…” but never connects. Same result on my Onkyo wireless speakers with Chromecast built in. Any ideas on additional configuration needed to the Cast functionality in HA, or to the speakers themselves? Something I need to turn on in my router/network? I’m super stumped.