Chromecast Radio with station and player selection

Are you sure that the audio stream you are using is ok? Try the one I supplied, I know that definitely works

Yes, I used the audio link you supplied. Even 40 minutes later it still says “Connecting…”

in case that helps, I find that the built-in Cast function of the Onkyo is REALLY slow to connect/sync.
If I only use CC Audios, it’s almost instant. If I cast to a group that includes my Onkyo, it’s slower
Sometimes I have to trigger my action/script twice for the audio stream to actually start

Anyway this is how I’ve set up my onkyo under media_player in my config:

- platform: onkyo
  host: 192.168.0.26
  name: Onkyo TX-NR656
  sources:
    video6: 'Main PC'
    bluray: 'Blu-Ray'
    video2: 'Sky'
    network: 'ChromeCast'
    tv: 'TV'
    strm-box: 'Stream-Box/CC'

and this is what I can see in my list of entities:

B-UTIFUL! Tried to go through the forum, but I might have missed it.
Can you share your config for this?

What tablet do you use for this and does it response fast enough?

Check the Tileboard topic in Home assistant forum or visit below URL

I am using Insigna Windows 10 tablet, except for cameras I have no issue for any other IOT device. Its just refresh rate way it work in Tileboard.

Hi
Thanks about your scripts :grinning:

evrything work really great , excpet the “change speakers”

have some update to this issue ?

@henaa please share your current config so we can troubleshoot.

Already fixed it here :wink:

@Mariusthvdb - Thanks for sharing your code - adding it over here but struggling with the radio_pause and radio_resume. Like you, I have google minis that are used for door/window open/close alerts that I send via MP3/cast. That stops the radio and doesn’t resume.

Could you please share your pause and resume section of the code? Are you still using delays too? Trying to figure out how to allow for the alerts and then resume the radio if it was previously playing.

Thanks!!!

does this help?

  intercom_message:
    alias: 'Intercom message'
    sequence:
      - condition: template
        value_template: >
          {{ is_state('input_boolean.announce_intercom', 'on') }}
      - service: script.radio_paused_for_message
      - service: script.wakeup_radio_paused_for_message
      - service: script.spotify_paused_for_message
      - service: media_player.volume_set
        data_template:
          entity_id: >
            {{states('sensor.intercom')}}
          volume_level: >
            {{ states('input_number.intercom_volume')|float }}
#            # {{ states('sensor.intercom_volume')|float  }}
      - service: tts.google_say
        data_template:
          language: >
            {{states('input_select.intercom_language')|lower}}
          entity_id: >
            {{states('sensor.intercom')}}
          message: >
            {% set language = states('input_select.intercom_language') %}
            {% if language == 'En' %} {{message_en}}
            {% elif language == 'Nl' %} {{message_nl}}
            {% else %} {{message_en}}
            {% endif %}

#            {% set language = states('input_select.intercom_language') %}
#            {% if language in [ 'En', 'Nl'] %} {{ data['message_'+language|lower] }}
#            {% else %} {{message_en}}
#            {% endif %}

#            {% set language = states('input_select.intercom_language') %}
#            {% if language in [ 'En', 'Nl'] %} {{message_ + language|lower}}
#            {% else %} {{message_en}}
#            {% endif %}


      - service: script.resume_radio_paused_for_message
      - service: script.resume_wakeup_radio_paused_for_message
#      - condition: template
#        value_template: >
#          {{is_state('input_boolean.radio_paused','on')}}
#      - delay:
#          seconds: 20
##      - wait_template: >
##          {{states(states('sensor.intercom')) != 'playing'}}
#      - service: input_boolean.turn_off
#        entity_id: input_boolean.radio_paused
#      - service: input_boolean.turn_off
#        entity_id: input_boolean.wakeup_radio_paused
#      - condition: template
#        value_template: >
#          {{ not is_state('input_select.radio_station','Select') }}
#      - service: script.play_radio
#      - service: script.play_wakeup_radio

  radio_paused_for_message:
    alias: 'Radio paused for message'
    sequence:
      - condition: template
        value_template: >
          {{states('sensor.intercom') == states('sensor.media_player') }}
      - condition: template
        value_template: >
          {{states(states('sensor.media_player')) == 'playing'}}
      - service: input_boolean.turn_on
        entity_id: input_boolean.radio_paused

  wakeup_radio_paused_for_message:
    alias: 'Wakeup radio paused for message'
    sequence:
#      - condition: template
#        value_template: >
#          {{states('sensor.intercom') == states('sensor.media_player') }}
      - condition: template
        value_template: >
          {{states(states('sensor.wakeup_radio')) == 'playing'}}
      - service: input_boolean.turn_on
        entity_id: input_boolean.wakeup_radio_paused

  spotify_paused_for_message:
    alias: 'Spotify paused for message'
    sequence:
      - condition: template
        value_template: >
          {{states(states('sensor.spotify_player')) == 'playing'}}
      - service: input_boolean.turn_on
        entity_id: input_boolean.spotify_paused

# {{states(states('sensor.media_player')) == 'playing'}}
# {{is_state(states('sensor.spotify_player'),'playing') }}

  resume_radio_paused_for_message:
    alias: Resume radio paused for message
    sequence:
      - condition: template
        value_template: >
          {{is_state('input_boolean.radio_paused','on')}}
      - delay:
          seconds: 20
#      - wait_template: >
#          {{states(states('sensor.intercom')) != 'playing'}}
      - service: input_boolean.turn_off
        entity_id: input_boolean.radio_paused
      - condition: template
        value_template: >
          {{ not is_state('input_select.radio_station','Select') }}
      - service: script.play_radio

Hi All,

what can be the problem of streams stop after 10 - 15 seconds?
All streams have same issue, on my tablet. They all work on iMac

EDIT:

Changed userangent in Fully Kiosk to chrome for windows. Now problems is gone

Hi could you please share the latest code with radio? :slight_smile: thanks in advance.

Will this also able without node-red? Add pictures to every channel and show them?

which code are you referring to? haven’t changed anything lately.

what is the reason to group the entities?

ah sorry I thought you modify your code in for several posts.

Don’t know if that’s possible. I recommend you to use node red, it is much easier when scripts/flows get more complicated.

How do you show this controls on Lovelace ui?

You should be able to use media control card;

Or the custom mini media player card;

Hi thanks, it looks like i had a miss configuration with the input selects.