Advertisement
artpc

Radio

Dec 23rd, 2023
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.53 KB | None | 0 0
  1. input_select:
  2. radio_station:
  3. name: 'Wybierz Stację Radiową:'
  4. options:
  5. - RMF FM
  6. - RMF MAXX
  7. - RMF Classisc
  8. - AntyRadio
  9. - Absolute Radio Classisc Rock
  10. - Meloradio
  11. - Muzo Radio
  12. - RadioZET
  13. - ChilliZet
  14. - Eska
  15. - Jedynka
  16. - Dwójka
  17. - Trójka
  18. - Złote przeboje
  19. - Spotyfy
  20. - Na Cały Dzień
  21. - DI Disco House
  22. - DI Funky House
  23. - DI Liquid D&B
  24. - Aloha Joe's Relaxation Island
  25. - Spectrum Fit
  26. - Open FM-Bieganie
  27. - Open FM-90`s Hits
  28. - Open FM-Polski Rock
  29. - Open FM-Praca
  30. initial: RMF FM
  31. icon: mdi:radio
  32.  
  33.  
  34.  
  35. chromecast_radio:
  36. name: 'Wybierz Głośniki:'
  37. options:
  38. - Salon
  39. - Salon Alexa
  40. - Lazienka
  41. - Kuchnia
  42. - Echo Show 5 2nd Gen
  43. - House except office
  44. - Everywhere
  45. - Everywhere except office
  46. - Back yard
  47. initial: Salon
  48. icon: mdi:speaker-wireless
  49.  
  50. input_number:
  51. volume_radio:
  52. name: Volume
  53. icon: mdi:volume-high
  54. min: 0
  55. max: 1
  56. step: 0.05
  57.  
  58. automation:
  59. - alias: 'Listen Radio'
  60. trigger:
  61. - platform: state
  62. entity_id: input_select.radio_station
  63. action:
  64. - service: script.radio
  65.  
  66. - alias: 'Set Chromecast Radio Volume'
  67. trigger:
  68. platform: state
  69. entity_id: input_number.volume_radio
  70. action:
  71. service: media_player.volume_set
  72. data_template:
  73. entity_id: >
  74. {% if is_state("input_select.chromecast_radio", "Salon") %} media_player.googlehome4300
  75. {% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
  76. {% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
  77. {% elif is_state("input_select.chromecast_radio", "Lazienka") %} media_player.pokoj_dzienny
  78. {% elif is_state("input_select.chromecast_radio", "Echo Show 5 2nd Gen") %} media_player.artur_s_echo_show_5_2nd_gen
  79. {% elif is_state("input_select.chromecast_radio", "House except office") %} media_player.house_except_office
  80. {% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.everywhere
  81. {% elif is_state("input_select.chromecast_radio", "Everywhere except office") %} media_player.all_except_office
  82. {% elif is_state("input_select.chromecast_radio", "Back yard") %} media_player.back_yard
  83. {% endif %}
  84. volume_level: '{{ states.input_number.volume_radio.state }}'
  85.  
  86. script:
  87. radio:
  88. alias: Play Radio on Chromecast Audio
  89. sequence:
  90. - service: media_player.volume_set
  91. data_template:
  92. entity_id: >
  93. {% if is_state("input_select.chromecast_radio", "Salon") %} media_player.googlehome4300
  94. {% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
  95. {% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
  96. {% elif is_state("input_select.chromecast_radio", "Lazienka") %} media_player.pokoj_dzienny
  97. {% elif is_state("input_select.chromecast_radio", "Echo Show 5 2nd Gen") %} media_player.artur_s_echo_show_5_2nd_gen
  98. {% elif is_state("input_select.chromecast_radio", "House except office") %} media_player.house_except_office
  99. {% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.everywhere
  100. {% elif is_state("input_select.chromecast_radio", "Everywhere except office") %} media_player.all_except_office
  101. {% elif is_state("input_select.chromecast_radio", "Back yard") %} media_player.back_yard
  102. {% endif %}
  103. volume_level: '{{ states.input_number.volume_radio.state }}'
  104. - service: media_player.play_media
  105. data_template:
  106. entity_id: >
  107. {% if is_state("input_select.chromecast_radio", "Salon") %} media_player.googlehome4300
  108. {% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
  109. {% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
  110. {% elif is_state("input_select.chromecast_radio", "Lazienka") %} media_player.pokoj_dzienny
  111. {% elif is_state("input_select.chromecast_radio", "Echo Show 5 2nd Gen") %} media_player.artur_s_echo_show_5_2nd_gen
  112. {% elif is_state("input_select.chromecast_radio", "House except office") %} media_player.house_except_office
  113. {% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.everywhere
  114. {% elif is_state("input_select.chromecast_radio", "Everywhere except office") %} media_player.all_except_office
  115. {% elif is_state("input_select.chromecast_radio", "Back yard") %} media_player.back_yard
  116. {% endif %}
  117. media_content_id: >
  118. {% if is_state("input_select.radio_station", "RMF FM") %} http://217.74.72.11/rmf_fm
  119. {% elif is_state("input_select.radio_station", "RMF MAXX") %} http://www.rmfon.pl/n/rmfmaxxx.pls
  120. {% elif is_state("input_select.radio_station", "RMF Classic") %} http://rmfstream1.interia.pl:8000/rmf_classic
  121. {% elif is_state("input_select.radio_station", "AntyRadio") %} http://stream.polandrockfestival.pl:8000/
  122. {% elif is_state("input_select.radio_station", "Absolute Radio Classisc Rock") %} http://icy-e-bab-04-cr.sharp-stream.com/absoluteclassicrock.mp3
  123. {% elif is_state("input_select.radio_station", "Meloradio") %} https://ml.cdn.eurozet.pl/mel-net.mp3
  124. {% elif is_state("input_select.radio_station", "Muzo Radio") %} http://stream4.nadaje.com/muzo
  125. {% elif is_state("input_select.radio_station", "RadioZET") %} https://zt.cdn.eurozet.pl/zet-tun.mp3
  126. {% elif is_state("input_select.radio_station", "ChilliZet") %} http://chi-net.cdn.eurozet.pl:8900/
  127. {% 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
  128. {% elif is_state("input_select.radio_station", "Jedynka") %} http://mp3.polskieradio.pl:8900/
  129. {% elif is_state("input_select.radio_station", "Dwójka") %} http://mp3.polskieradio.pl:8902/
  130. {% elif is_state("input_select.radio_station", "Trójka") %} http://mp3.polskieradio.pl:8904/
  131. {% elif is_state("input_select.radio_station", "Złote przeboje") %} http://mainstream.radioagora.pl/tuba9-1.mp3
  132. {% elif is_state("input_select.radio_station", "Spotify") %} spotify:playlist:37i9dQZF1E3agq9f3jFqW4
  133. {% elif is_state("input_select.radio_station", "Na Cały Dzień") %} https://stream.open.fm/69
  134. {% elif is_state("input_select.radio_station", "DI Disco House") %} http://pub1.diforfree.org:8000/di_discohouse_hi
  135. {% elif is_state("input_select.radio_station", "DI Funky House") %} http://pub1.diforfree.org:8000/di_funkyhouse_hi
  136. {% elif is_state("input_select.radio_station", "DI Liquid D&B") %} http://pub1.diforfree.org:8000/di_liquiddnb_hi
  137. {% elif is_state("input_select.radio_station", "Aloha Joe's Relaxation Island") %} http://s2.voscast.com:7932/
  138. {% elif is_state("input_select.radio_station", "Spectrum Fit") %} http://51.255.235.165:5292/
  139. {% elif is_state("input_select.radio_station", "Open FM-Bieganie") %} https://stream.open.fm/116
  140. {% elif is_state("input_select.radio_station", "Open FM-90`s Hits") %} https://stream.open.fm/14
  141. {% elif is_state("input_select.radio_station", "Open FM-Polski Rock") %} https://stream.open.fm/29
  142. {% elif is_state("input_select.radio_station", "Open FM-Praca") %} https://stream.open.fm/109?type=.aac
  143. {% endif %}
  144. media_content_type: 'audio/mp4'
  145.  
  146. radiostop:
  147. alias: Radio Stop
  148. sequence:
  149. - service: media_player.turn_off
  150. data_template:
  151. entity_id: >
  152. {% if is_state("input_select.chromecast_radio", "Lazienka") %} media_player.pokoj_dzienny
  153. {% elif is_state("input_select.chromecast_radio", "Salon Alexa") %} media_player.artur_s_echo_dot
  154. {% elif is_state("input_select.chromecast_radio", "Kuchnia") %} media_player.artur_s_echo_show
  155. {% elif is_state("input_select.chromecast_radio", "Salon") %} media_player.googlehome4300
  156. {% elif is_state("input_select.chromecast_radio", "Echo Show 5 2nd Gen") %} media_player.artur_s_echo_show_5_2nd_gen
  157. {% elif is_state("input_select.chromecast_radio", "Salon + Salon Alexa") %} media_player.group
  158. {% elif is_state("input_select.chromecast_radio", "Wszystkie") %} media_player.all
  159. {% endif %}
  160.  
  161.  
  162.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement