Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input_select:
- radio_station:
- name: 'Wybierz Stację Radiową:'
- options:
- - RMF FM
- - RMF MAXX
- - RMF Classisc
- - AntyRadio
- - Absolute Radio Classisc Rock
- - Meloradio
- - Muzo Radio
- - RadioZET
- - ChilliZet
- - Eska
- - Jedynka
- - Dwójka
- - Trójka
- - Złote przeboje
- - Spotyfy
- - Na Cały Dzień
- - DI Disco House
- - DI Funky House
- - DI Liquid D&B
- - Aloha Joe's Relaxation Island
- - Spectrum Fit
- - Open FM-Bieganie
- - Open FM-90`s Hits
- - Open FM-Polski Rock
- - Open FM-Praca
- initial: RMF FM
- icon: mdi:radio
- chromecast_radio:
- name: 'Wybierz Głośniki:'
- options:
- - Salon
- - Salon Alexa
- - Lazienka
- - Kuchnia
- - Echo Show 5 2nd Gen
- - House except office
- - Everywhere
- - Everywhere except office
- - Back yard
- initial: Salon
- icon: mdi:speaker-wireless
- input_number:
- volume_radio:
- name: Volume
- icon: mdi:volume-high
- min: 0
- max: 1
- step: 0.05
- automation:
- - alias: 'Listen Radio'
- trigger:
- - platform: state
- entity_id: input_select.radio_station
- action:
- - service: script.radio
- - alias: 'Set Chromecast 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", "Salon") %} media_player.googlehome4300
- {% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
- {% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
- {% elif is_state("input_select.chromecast_radio", "Lazienka") %} media_player.pokoj_dzienny
- {% elif is_state("input_select.chromecast_radio", "Echo Show 5 2nd Gen") %} media_player.artur_s_echo_show_5_2nd_gen
- {% elif is_state("input_select.chromecast_radio", "House except office") %} media_player.house_except_office
- {% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.everywhere
- {% elif is_state("input_select.chromecast_radio", "Everywhere except office") %} media_player.all_except_office
- {% elif is_state("input_select.chromecast_radio", "Back yard") %} media_player.back_yard
- {% endif %}
- volume_level: '{{ states.input_number.volume_radio.state }}'
- script:
- radio:
- alias: Play Radio on Chromecast Audio
- sequence:
- - service: media_player.volume_set
- data_template:
- entity_id: >
- {% if is_state("input_select.chromecast_radio", "Salon") %} media_player.googlehome4300
- {% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
- {% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
- {% elif is_state("input_select.chromecast_radio", "Lazienka") %} media_player.pokoj_dzienny
- {% elif is_state("input_select.chromecast_radio", "Echo Show 5 2nd Gen") %} media_player.artur_s_echo_show_5_2nd_gen
- {% elif is_state("input_select.chromecast_radio", "House except office") %} media_player.house_except_office
- {% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.everywhere
- {% elif is_state("input_select.chromecast_radio", "Everywhere except office") %} media_player.all_except_office
- {% elif is_state("input_select.chromecast_radio", "Back yard") %} media_player.back_yard
- {% endif %}
- volume_level: '{{ states.input_number.volume_radio.state }}'
- - service: media_player.play_media
- data_template:
- entity_id: >
- {% if is_state("input_select.chromecast_radio", "Salon") %} media_player.googlehome4300
- {% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
- {% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
- {% elif is_state("input_select.chromecast_radio", "Lazienka") %} media_player.pokoj_dzienny
- {% elif is_state("input_select.chromecast_radio", "Echo Show 5 2nd Gen") %} media_player.artur_s_echo_show_5_2nd_gen
- {% elif is_state("input_select.chromecast_radio", "House except office") %} media_player.house_except_office
- {% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.everywhere
- {% elif is_state("input_select.chromecast_radio", "Everywhere except office") %} media_player.all_except_office
- {% elif is_state("input_select.chromecast_radio", "Back yard") %} media_player.back_yard
- {% endif %}
- media_content_id: >
- {% if is_state("input_select.radio_station", "RMF FM") %} http://217.74.72.11/rmf_fm
- {% elif is_state("input_select.radio_station", "RMF MAXX") %} http://www.rmfon.pl/n/rmfmaxxx.pls
- {% elif is_state("input_select.radio_station", "RMF Classic") %} http://rmfstream1.interia.pl:8000/rmf_classic
- {% elif is_state("input_select.radio_station", "AntyRadio") %} http://stream.polandrockfestival.pl:8000/
- {% elif is_state("input_select.radio_station", "Absolute Radio Classisc Rock") %} http://icy-e-bab-04-cr.sharp-stream.com/absoluteclassicrock.mp3
- {% elif is_state("input_select.radio_station", "Meloradio") %} https://ml.cdn.eurozet.pl/mel-net.mp3
- {% elif is_state("input_select.radio_station", "Muzo Radio") %} http://stream4.nadaje.com/muzo
- {% elif is_state("input_select.radio_station", "RadioZET") %} https://zt.cdn.eurozet.pl/zet-tun.mp3
- {% elif is_state("input_select.radio_station", "ChilliZet") %} http://chi-net.cdn.eurozet.pl:8900/
- {% elif is_state("input_select.radio_station", "Eska") %} http://www.pldm.ml/radio.php?id=-1&url=http://www.eskago.pl/radio/eska-malopolska-zakopane
- {% elif is_state("input_select.radio_station", "Jedynka") %} http://mp3.polskieradio.pl:8900/
- {% elif is_state("input_select.radio_station", "Dwójka") %} http://mp3.polskieradio.pl:8902/
- {% elif is_state("input_select.radio_station", "Trójka") %} http://mp3.polskieradio.pl:8904/
- {% elif is_state("input_select.radio_station", "Złote przeboje") %} http://mainstream.radioagora.pl/tuba9-1.mp3
- {% elif is_state("input_select.radio_station", "Spotify") %} spotify:playlist:37i9dQZF1E3agq9f3jFqW4
- {% elif is_state("input_select.radio_station", "Na Cały Dzień") %} https://stream.open.fm/69
- {% elif is_state("input_select.radio_station", "DI Disco House") %} http://pub1.diforfree.org:8000/di_discohouse_hi
- {% elif is_state("input_select.radio_station", "DI Funky House") %} http://pub1.diforfree.org:8000/di_funkyhouse_hi
- {% elif is_state("input_select.radio_station", "DI Liquid D&B") %} http://pub1.diforfree.org:8000/di_liquiddnb_hi
- {% elif is_state("input_select.radio_station", "Aloha Joe's Relaxation Island") %} http://s2.voscast.com:7932/
- {% elif is_state("input_select.radio_station", "Spectrum Fit") %} http://51.255.235.165:5292/
- {% elif is_state("input_select.radio_station", "Open FM-Bieganie") %} https://stream.open.fm/116
- {% elif is_state("input_select.radio_station", "Open FM-90`s Hits") %} https://stream.open.fm/14
- {% elif is_state("input_select.radio_station", "Open FM-Polski Rock") %} https://stream.open.fm/29
- {% elif is_state("input_select.radio_station", "Open FM-Praca") %} https://stream.open.fm/109?type=.aac
- {% endif %}
- media_content_type: 'audio/mp4'
- radiostop:
- alias: Radio Stop
- sequence:
- - service: media_player.turn_off
- data_template:
- entity_id: >
- {% if is_state("input_select.chromecast_radio", "Lazienka") %} media_player.pokoj_dzienny
- {% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
- {% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
- {% elif is_state("input_select.chromecast_radio", "Salon") %} media_player.googlehome4300
- {% elif is_state("input_select.chromecast_radio", "Echo Show 5 2nd Gen") %} media_player.artur_s_echo_show_5_2nd_gen
- {% elif is_state("input_select.chromecast_radio", "Salon + Salon Alexa") %} media_player.group
- {% elif is_state("input_select.chromecast_radio", "Wszystkie") %} media_player.all
- {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement