Micke_H

Untitled

Jul 14th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. entity_register.yaml
  2. ###
  3. media_player.kok:
  4. config_entry_id:
  5. name:
  6. platform: cast
  7. unique_id: d10e088a-d912-3e33-ab99-d0a40de8ded7
  8.  
  9.  
  10. scripts.yaml
  11. ###
  12. radio538:
  13. alias: Play Radio on Chromecast Audio
  14. sequence:
  15. - service: media_player.volume_set
  16. data:
  17. entity_id: media_player.sovrum
  18. volume_level: '0.75'
  19. - service: media_player.play_media
  20. data_template:
  21. entity_id: >
  22. {% if is_state("input_select.chromecast_radio", "Sovrum") %} media_player.sovrum
  23. {% endif %}
  24. media_content_id: >
  25. {% if is_state("input_select.radio_station", "P4 Sjuhärad") %} http://http-live.sr.se/p4sjuharad-mp3-192
  26. {% elif is_state("input_select.radio_station", "Lugna Favoriter") %} http://fm03-icecast.mtg-r.net/fm03_mp3
  27. {% elif is_state("input_select.radio_station", "Bandit Rock") %} http://fm02-icecast.mtg-r.net/fm02_mp3
  28. {% endif %}
  29. media_content_type: 'audio/mp4'
  30.  
  31.  
  32. configuration.yaml
  33. ###
  34. input_select:
  35. radio_station:
  36. name: 'Select Radio Station:'
  37. options:
  38. - P4 Sjuhärad
  39. - Lugna Favoriter
  40. - Bandit Rock
  41. chromecast_radio:
  42. name: 'Select Speakers:'
  43. options:
  44. - Sovrum
  45. - kok
  46. initial: Sovrum
  47. icon: mdi:speaker-wireless
Advertisement
Add Comment
Please, Sign In to add comment