right i so created folder called packages
i then created file called chromecast_radio.yaml
i then put the following into that file
input_select:
radio_station:
name: 'Select Radio Station:'
options:
- Radio 538
- Q-Music
- 3FM
- 100% NL
- Veronica
- Sky Radio
- Arrow Classic Rock
- Classic FM
- BNR Nieuwsradio
- SLAM! Hardstyle
- Sleep Radio
- Ambient Sleeping Pill
- Radio Art - Sleep
- Ambi Nature Radio
- Calm Radio - Sleep
- Dinamo.FM Sleep
chromecast_radio:
name: 'Select Speakers:'
options:
- Lounge
- Kitchen
- Milla
- Bedroom
- Bose
- Everywhere
initial: Everywhere
icon: mdi:speaker-wireless
automation:
alias: Listen Radio
hide_entity: True
trigger:
- platform: state
entity_id: input_select.radio_station
action:
- service: script.radio
script:
radio:
alias: Play Radio on Chromecast Audio
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.googlehome_ensuite
volume_level: '0.35'
- service: media_player.volume_set
data:
entity_id: media_player.kitchen_google_mini
volume_level: '0.20'
- service: media_player.volume_set
data:
entity_id: media_player.bedroom_google_mini
volume_level: '0.30'
- service: media_player.play_media
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Lounge") %} media_player.googlehome_ensuite
{% elif is_state("input_select.chromecast_radio", "Kitchen") %} media_player.kitchen_google_mini
{% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.bedroom_google_mini
{% elif is_state("input_select.chromecast_radio", "Milla") %} media_player.googlehome7480
{% elif is_state("input_select.chromecast_radio", "Bose") %} media_player.chromecast_speaker
{% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.all_speakers_2
{% endif %}
media_content_id: >
{% if is_state("input_select.radio_station", "Radio 538") %} http://vip-icecast.538.lw.triple-it.nl:80/RADIO538_MP3
{% elif is_state("input_select.radio_station", "Q-Music") %} http://icecast-qmusic.cdp.triple-it.nl/Qmusic_nl_live_96.mp3
{% elif is_state("input_select.radio_station", "3FM") %} http://icecast.omroep.nl/3fm-bb-mp3
{% elif is_state("input_select.radio_station", "100% NL") %} http://stream.100p.nl/100pctnl.mp3
{% elif is_state("input_select.radio_station", "Veronica") %} http://8543.live.streamtheworld.com/VERONICACMP3
{% elif is_state("input_select.radio_station", "Sky Radio") %} http://8623.live.streamtheworld.com:80/SKYRADIOAAC_SC
{% elif is_state("input_select.radio_station", "Arrow Classic Rock") %} http://91.221.151.155/listen.mp3
{% elif is_state("input_select.radio_station", "Classic FM") %} http://19143.live.streamtheworld.com/CLASSICFM_SC
{% elif is_state("input_select.radio_station", "BNR Nieuwsradio") %} http://icecast-bnr.cdp.triple-it.nl/bnr_mp3_96_03
{% elif is_state("input_select.radio_station", "SLAM! Hardstyle") %} http://vip-icecast.538.lw.triple-it.nl/WEB17_MP3
{% elif is_state("input_select.radio_station", "Sleep Radio") %} http://37.59.28.208:8722/stream
{% elif is_state("input_select.radio_station", "Ambient Sleeping Pill") %} http://perseus.shoutca.st:8447/h
{% elif is_state("input_select.radio_station", "Radio Art - Sleep") %} http://live.radioart.com/fSleep.mp3
{% elif is_state("input_select.radio_station", "Ambi Nature Radio") %} http://94.23.252.14:8067/stream
{% elif is_state("input_select.radio_station", "Calm Radio - Sleep") %} http://streams.calmradio.com/api/39/128/stream
{% elif is_state("input_select.radio_station", "Dinamo.FM Sleep") %} http://channels.dinamo.fm/sleep-aac
{% endif %}
media_content_type: 'audio/mp4'
i then put the following into configuration.yaml
packages: !include_dir_named packages
but now i get the following error
Component not found: packages
vladosam
(Vladimir)
November 14, 2018, 7:20pm
387
Did you add it under the homeassistant section of your configuration.yaml
homeassistant:
packages: !include_dir_named packages
no i added where the other files are added by !filename
#include configs
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
packages: !include_dir_named packages
i moved it homeassistant section on configurations.yaml but made no difference , same problem of component not found
vladosam
(Vladimir)
November 14, 2018, 8:09pm
389
Ok. I try to add this package and i don’t get error on !include. Only error i get is on chromecast_radio under input_select. Indent is wrong. Move chromecast_radio to right.
ok thanks for trying that
i will move indent now but not sure what is causing my error , scratching my hair away
so i moved indent and now i get a whole lot of errors…
required key not provided @ data['trigger']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/automation/
Invalid config for [input_select]: expected a dictionary for dictionary value @ data['input_select']['chromecast_radio']. Got None
expected a dictionary for dictionary value @ data['input_select']['icon']. Got 'mdi:speaker-wireless'
expected a dictionary for dictionary value @ data['input_select']['initial']. Got 'Everywhere'
expected a dictionary for dictionary value @ data['input_select']['name']. Got 'Select Speakers:'
expected a dictionary for dictionary value @ data['input_select']['options']. Got ['Lounge', 'Kitchen', 'Milla', 'Bedroom', 'Bose', 'Everywhere']. (See ?, line ?). Please check the docs at https://home-assistant.io/components/input_select/
vladosam
(Vladimir)
November 14, 2018, 8:16pm
392
Show me all your config for this.
input_select:
radio_station:
name: 'Select Radio Station:'
options:
- Radio 538
- Q-Music
- 3FM
- 100% NL
- Veronica
- Sky Radio
- Arrow Classic Rock
- Classic FM
- BNR Nieuwsradio
- SLAM! Hardstyle
- Sleep Radio
- Ambient Sleeping Pill
- Radio Art - Sleep
- Ambi Nature Radio
- Calm Radio - Sleep
- Dinamo.FM Sleep
chromecast_radio:
name: 'Select Speakers:'
options:
- Lounge
- Kitchen
- Milla
- Bedroom
- Bose
- Everywhere
initial: Everywhere
icon: mdi:speaker-wireless
automation:
alias: Listen Radio
hide_entity: True
trigger:
- platform: state
entity_id: input_select.radio_station
action:
- service: script.radio
script:
radio:
alias: Play Radio on Chromecast Audio
sequence:
- service: media_player.volume_set
data:
entity_id: media_player.googlehome_ensuite
volume_level: '0.35'
- service: media_player.volume_set
data:
entity_id: media_player.kitchen_google_mini
volume_level: '0.20'
- service: media_player.volume_set
data:
entity_id: media_player.bedroom_google_mini
volume_level: '0.30'
- service: media_player.play_media
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Lounge") %} media_player.googlehome_ensuite
{% elif is_state("input_select.chromecast_radio", "Kitchen") %} media_player.kitchen_google_mini
{% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.bedroom_google_mini
{% elif is_state("input_select.chromecast_radio", "Milla") %} media_player.googlehome7480
{% elif is_state("input_select.chromecast_radio", "Bose") %} media_player.chromecast_speaker
{% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.all_speakers_2
{% endif %}
media_content_id: >
{% if is_state("input_select.radio_station", "Radio 538") %} http://vip-icecast.538.lw.triple-it.nl:80/RADIO538_MP3
{% elif is_state("input_select.radio_station", "Q-Music") %} http://icecast-qmusic.cdp.triple-it.nl/Qmusic_nl_live_96.mp3
{% elif is_state("input_select.radio_station", "3FM") %} http://icecast.omroep.nl/3fm-bb-mp3
{% elif is_state("input_select.radio_station", "100% NL") %} http://stream.100p.nl/100pctnl.mp3
{% elif is_state("input_select.radio_station", "Veronica") %} http://8543.live.streamtheworld.com/VERONICACMP3
{% elif is_state("input_select.radio_station", "Sky Radio") %} http://8623.live.streamtheworld.com:80/SKYRADIOAAC_SC
{% elif is_state("input_select.radio_station", "Arrow Classic Rock") %} http://91.221.151.155/listen.mp3
{% elif is_state("input_select.radio_station", "Classic FM") %} http://19143.live.streamtheworld.com/CLASSICFM_SC
{% elif is_state("input_select.radio_station", "BNR Nieuwsradio") %} http://icecast-bnr.cdp.triple-it.nl/bnr_mp3_96_03
{% elif is_state("input_select.radio_station", "SLAM! Hardstyle") %} http://vip-icecast.538.lw.triple-it.nl/WEB17_MP3
{% elif is_state("input_select.radio_station", "Sleep Radio") %} http://37.59.28.208:8722/stream
{% elif is_state("input_select.radio_station", "Ambient Sleeping Pill") %} http://perseus.shoutca.st:8447/h
{% elif is_state("input_select.radio_station", "Radio Art - Sleep") %} http://live.radioart.com/fSleep.mp3
{% elif is_state("input_select.radio_station", "Ambi Nature Radio") %} http://94.23.252.14:8067/stream
{% elif is_state("input_select.radio_station", "Calm Radio - Sleep") %} http://streams.calmradio.com/api/39/128/stream
{% elif is_state("input_select.radio_station", "Dinamo.FM Sleep") %} http://channels.dinamo.fm/sleep-aac
{% endif %}
media_content_type: 'audio/mp4'
vladosam
(Vladimir)
November 14, 2018, 8:23pm
394
Indent, indent, indent.
chromecast_radio:
name: 'Select Speakers:'
options:
- Lounge
- Kitchen
- Milla
- Bedroom
- Bose
- Everywhere
initial: Everywhere
icon: mdi:speaker-wireless
thanks ! shoo that helped those errors , whats wrong with this code ?
Invalid config for [automation]: required key not provided @ data[‘action’]. Got None
required key not provided @ data[‘trigger’]. Got None. (See ?, line ?). Please check the docs at Automation - Home Assistant
automation:
alias: Listen Radio
hide_entity: True
trigger:
- platform: state
entity_id: input_select.radio_station
action:
- service: script.radio
vladosam
(Vladimir)
November 14, 2018, 8:34pm
396
automation:
alias: Listen Radio
hide_entity: True
trigger:
- platform: state
entity_id: input_select.radio_station
action:
- service: script.turn_on
entity_id: script.radio
thank you @vladosam for the help. i have sort of come right but still have problems with volume slider.
i have a input_slider.yaml with the following code.
input_slider:
volume_radio:
name: Volume
icon: mdi:volume-high
initial: 0.2
min: 0
max: 1
step: 0.05
and it control this code in the script file
volume_level: '{{ states.input_slider.volume_radio.state }}'
what is wrong that i get getting the following error ?
Package input_slider setup failed. Component input_slider does not exist
any guidance will be appreciated greatly
vladosam
(Vladimir)
November 15, 2018, 1:06pm
398
thank you that sorted it out . now im a happy man !!!
Appreciate your help.
if i try use the following code in a seperate automation.yaml file so that i can change the volume without having to stop start stream to trigger script then i get an error
expected a dictionary for dictionary value @ data[‘packages’][‘automation’]
- alias: 'Set Radio Volume'
trigger:
platform: state
entity_id: input_number.volume_radio
action:
service: media_player.volume_set
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "TV Lounge") %} media_player.googlehome_ensuite
{% elif is_state("input_select.chromecast_radio", "Kitchen") %} media_player.kitchen_google_mini
{% elif is_state("input_select.chromecast_radio", "Master Bedroom") %} media_player.bedroom_google_mini
{% elif is_state("input_select.chromecast_radio", "Milla Room") %} media_player.googlehome7480
{% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.all_speakers_2
{% endif %}
volume_level: '{{ states.input_number.volume_radio.state }}'
vladosam
(Vladimir)
November 15, 2018, 5:00pm
401
Your problems now are not related to chromecast radio. Send me a PM.
maurizio53
(Maurizio Fabiani)
November 16, 2018, 10:33am
403
What is the meaning of the - delay section?
Bob_NL
(Bob Visser)
November 16, 2018, 12:47pm
404
If you don’t add a delay, the stream starts playing before the TTS even has the chance to start a sentence
The 8 secs is just a quick and dirty solution. If would be more professional to use a templated delay (based on the playtime of the TTS message).
lolouk44
(lolouk44)
November 16, 2018, 12:58pm
405
better to use a wait_template indeed:
wait_template: "{{ is_state('media_player.chromecast' , 'idle') }}"
if you have multiple speakers you may have to do a check based on the input_select:
- wait_template: >
{% if is_state("input_select.chromecast_radio", "Livingroom") %} {{ is_state('media_player.ca_livingroom' , 'idle') }}
{% elif is_state("input_select.chromecast_radio", "Hall") %} {{ is_state('media_player.ca_hall' , 'idle') }}
{% elif is_state("input_select.chromecast_radio", "Bedroom") %} {{ is_state('media_player.bed_room' , 'idle') }}
{% elif is_state("input_select.chromecast_radio", "Bathroom") %} {{ is_state('media_player.ca_bathroom' , 'idle') }}
{% elif is_state("input_select.chromecast_radio", "Everywhere") %} {{ is_state('media_player.home_group' , 'idle') }}
{% else %} 00:00:08
{% endif %}
2 Likes
Bob_NL
(Bob Visser)
November 16, 2018, 6:16pm
406
Nice, thanks.
You could also use something like this:
wait_template:
'00:00:{{media_player.chromecast.attributes.media_duration}}'
Note: I have not tested this because I don’t use the pronounciation myself. It was a request from someone in this topic.