Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.01 KB | None | 0 0
  1. alias: Radio
  2. trigger:
  3.   platform: state
  4.   entity_id: input_select.radio_station
  5. action:
  6.   - service: script.turn_on
  7.     data_template:
  8.       entity_id: >
  9.         - service: media_player.play_media
  10.             data_template:
  11.                 entity_id: >
  12.                  {% if input_select.radio_station_location == 'Kitchen' %}
  13.                     media_player.kitchen
  14.                   {%-elif input_select.radio_station_location == 'Backyard' %}
  15.                     media_player.backyard
  16.                   {% endif %}
  17.                 media_content_id: >
  18.                  {% if input_select.radio_station == 'Hot108' %}
  19.                     "http://jbmedia-edge1.cdnstream.com:80/hot108"
  20.                   {%-elif input_select.radio_station == 'The Beat' %}
  21.                     "http://live.leanstream.co/CKBTFM-MP3"
  22.                   {% endif %}
  23.                 media_content_type: 'audio/mp3'
  24.   - service: input_select.select_option
  25.     data:
  26.       entity_id: input_select.radio_station
  27.       option: "-"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement