Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. radio_start:
  2. alias: Play Radio on Chromecast Audio
  3. sequence:
  4. - service: media_player.volume_set
  5. data_template:
  6. entity_id: >
  7. {% if is_state("input_select.radio_speakers", "Living Room Audio") %} media_player.salotto_audio
  8. {% elif is_state("input_select.radio_speakers", "Chromecast Salotto") %} media_player.salotto
  9. {% elif is_state("input_select.radio_speakers", "Chromecast Camera Letto") %} media_player.camera_da_letto
  10. {% elif is_state("input_select.radio_speakers", "Gruppo Media Player") %} group.media_player
  11. {% endif %}
  12. volume_level: '{{ states.input_number.radio_volume.state | float }}'
  13. - service: media_player.play_media
  14. data_template:
  15. entity_id: >
  16. {% if is_state("input_select.radio_speakers", "Living Room Audio") %} media_player.salotto_audio
  17. {% elif is_state("input_select.radio_speakers", "Chromecast Salotto") %} media_player.salotto
  18. {% elif is_state("input_select.radio_speakers", "Chromecast Camera Letto") %} media_player.camera_da_letto
  19. {% elif is_state("input_select.radio_speakers", "Gruppo Media Player") %} group.media_player
  20. {% endif %}
  21. media_content_id: >
  22. {% if is_state("input_select.radio_station", "Q-Music") %} http://icecast-qmusic.cdp.triple-it.nl/Qmusic_nl_live_96.mp3
  23. {% elif is_state("input_select.radio_station", "3FM") %} http://icecast.omroep.nl/3fm-bb-mp3
  24. {% elif is_state("input_select.radio_station", "100% NL") %} http://stream.100p.nl/100pctnl.mp3
  25. {% elif is_state("input_select.radio_station", "Veronica") %} http://8543.live.streamtheworld.com/VERONICACMP3
  26. {% elif is_state("input_select.radio_station", "Sky Radio") %} http://19993.live.streamtheworld.com:80/SKYRADIO_SC6
  27. {% elif is_state("input_select.radio_station", "Arrow Classic Rock") %} http://91.221.151.155/listen.mp3
  28. {% elif is_state("input_select.radio_station", "Classic FM") %} http://19143.live.streamtheworld.com/CLASSICFM_SC
  29. {% elif is_state("input_select.radio_station", "BNR Nieuwsradio") %} http://icecast-bnr.cdp.triple-it.nl/bnr_mp3_96_03
  30. {% elif is_state("input_select.radio_station", "SLAM! Hardstyle") %} http://vip-icecast.538.lw.triple-it.nl/WEB17_MP3
  31. {% elif is_state("input_select.radio_station", "Sleep Radio") %} http://37.59.28.208:8453/stream
  32. {% elif is_state("input_select.radio_station", "Ambient Sleeping Pill") %} http://perseus.shoutca.st:8447/h
  33. {% elif is_state("input_select.radio_station", "Radio Art - Sleep") %} http://live.radioart.com/fSleep.mp3
  34. {% elif is_state("input_select.radio_station", "Ambi Nature Radio") %} http://94.23.252.14:8067/stream
  35. {% elif is_state("input_select.radio_station", "Calm Radio - Sleep") %} http://streams.calmradio.com/api/39/128/stream
  36. {% elif is_state("input_select.radio_station", "Dinamo.FM Sleep") %} http://channels.dinamo.fm/sleep-aac
  37. {% elif is_state("input_select.radio_station", "Hot 108") %} http://jbmedia-edge1.cdnstream.com:80/hot108
  38. {% elif is_state("input_select.radio_station", "The Beat") %} http://live.leanstream.co/CKBTFM-MP3
  39. {% elif is_state("input_select.radio_station", "Alt Rock") %} http://149.56.23.7:20254/stream
  40. {% elif is_state("input_select.radio_station", "Energy 98") %} http://174.127.85.10:8800
  41. {% elif is_state("input_select.radio_station", "Hit Remixes") %} http://149.56.23.7:20252/stream
  42. {% elif is_state("input_select.radio_station", "Play Radio") %} http://176.9.31.78:8222
  43. {% elif is_state("input_select.radio_station", "Elium-Rock") %} http://listen.radionomy.com/Elium-Rock
  44. {% elif is_state("input_select.radio_station", "Classic Rock Florida") %} http://listen.shoutcast.com/Classic-RockFlorida
  45. {% endif %}
  46. media_content_type: 'audio/mp4'
  47. radio_stop:
  48. alias: Stop Radio on Chromecast
  49. sequence:
  50. - service: media_player.media_stop
  51. data_template:
  52. entity_id: >
  53. {% if is_state("input_select.radio_speakers", "Living Room") %} media_player.salotto_audio
  54. {% elif is_state("input_select.radio_speakers", "Chromecast Salotto") %} media_player.salotto
  55. {% elif is_state("input_select.radio_speakers", "Chromecast Camera Letto") %} media_player.camera_da_letto
  56. {% elif is_state("input_select.radio_speakers", "Gruppo Media Player") %} group.media_player
  57. {% endif %}
  58. radio_change_speakers:
  59. alias: Change Radio Speakers
  60. sequence:
  61. - service: media_player.media_stop
  62. data_template:
  63. entity_id: >
  64. {% if previous_speakers == "Living Room" %} media_player.salotto_audio
  65. {% elif previous_speakers == "Chromecast Salotto" %} media_player.salotto
  66. {% elif previous_speakers == "Chromecast Camera Letto" %} media_player.camera_da_letto
  67. {% elif previous_speakers == "Gruppo Media Player" %} group.media_player
  68. {% endif %}
  69. - service: input_boolean.turn_off
  70. entity_id: input_boolean.radio_play
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement