Guest User

Untitled

a guest
Mar 7th, 2019
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 11.86 KB | None | 0 0
  1. #groups.yaml
  2. media:
  3.   name: Media
  4.   view: true
  5.   entities:
  6.  - group.music
  7.   - group.speakers
  8.   - group.displays
  9. music:
  10.   name: Music
  11.   control: hidden
  12.   entities:
  13.  - input_select.speakers
  14.   - input_select.music_station
  15.   - script.music_start
  16.   - script.music_stop
  17.   - script.music_all_stop
  18.   - input_number.volume
  19.   - input_number.volume_office
  20.   - input_number.volume_kitchen
  21.   - input_number.volume_dining
  22.   - input_number.volume_living
  23.   - input_number.volume_soundbar
  24.   - input_number.volume_bedroom
  25.   - input_number.volume_bathroom
  26. speakers:
  27.   name: Speakers
  28.   entities:
  29.  - media_player.house
  30.   - media_player.bathroom_speaker
  31.   - media_player.bedroom_speaker
  32.   - media_player.dining_room_speaker
  33.   - media_player.kitchen_speaker
  34.   - media_player.living_room_speaker
  35.   - media_player.soundbar_speaker
  36. displays:
  37.   name: Displays
  38.   entities:
  39.  - media_player.livingroom_tv
  40.   - media_player.bedroom_tv
  41.   - media_player.kitchen_display
  42.   - media_player.office_display
  43.  
  44. #scripts.yaml
  45. music_stop:
  46.   alias: Stop streaming music
  47.   sequence:
  48.     -  service: media_player.media_stop
  49.        data_template:
  50.          entity_id: >
  51.          {% if is_state("input_select.speakers", "House") %} media_player.house
  52.           {% elif is_state("input_select.speakers", "Office") %} media_player.office_display
  53.           {% elif is_state("input_select.speakers", "Kitchen") %} media_player.kitchen_speaker
  54.           {% elif is_state("input_select.speakers", "Dinning Room") %} media_player.dinning_room_speaker
  55.           {% elif is_state("input_select.speakers", "Living Room") %} media_player.living_room_speaker
  56.           {% elif is_state("input_select.speakers", "Roaming") %} media_player.soundbar_speaker
  57.           {% elif is_state("input_select.speakers", "Bedroom") %} media_player.bedroom_speaker
  58.           {% elif is_state("input_select.speakers", "Bathroom") %} media_player.bathroom_speaker
  59.           {% endif %}
  60.     -  service: input_select.select_option
  61.        data:
  62.          entity_id: input_select.music_station
  63.          option: Stopped
  64.  
  65. music_all_stop:
  66.   alias: Stop all streaming music
  67.   sequence:
  68.     -  service: media_player.media_stop
  69.        entity_id: media_player.house
  70.     -  service: media_player.media_stop
  71.        entity_id: media_player.office_display
  72.     -  service: media_player.media_stop
  73.        entity_id: media_player.kitchen_speaker
  74.     -  service: media_player.media_stop
  75.        entity_id: media_player.dinning_room_speaker
  76.     -  service: media_player.media_stop
  77.        entity_id: media_player.living_room_speaker
  78.     -  service: media_player.media_stop
  79.        entity_id: media_player.soundbar_speaker
  80.     -  service: media_player.media_stop
  81.        entity_id: media_player.bedroom_speaker
  82.     -  service: media_player.media_stop
  83.        entity_id: media_player.bathroom_speaker
  84.  
  85. music_start:
  86.   alias: Start streaming music
  87.   sequence:
  88.     - service: automation.trigger
  89.       entity_id: automation.play_music_on_chromecast
  90.      
  91. #input_number.yaml
  92. # Input Number Statements
  93.   volume:
  94.     name: Master
  95.     icon: mdi:volume-high
  96.     min: 0
  97.     max: 1
  98.     step: 0.05
  99.   volume_office:
  100.     name: Office
  101.     icon: mdi:volume-high
  102.     min: 0
  103.     max: 1
  104.     step: 0.05
  105.   volume_kitchen:
  106.     name: Kitchen
  107.     icon: mdi:volume-high
  108.     min: 0
  109.     max: 1
  110.     step: 0.05
  111.   volume_dining:
  112.     name: Dining
  113.     icon: mdi:volume-high
  114.     min: 0
  115.     max: 1
  116.     step: 0.05
  117.   volume_living:
  118.     name: Living
  119.     icon: mdi:volume-high
  120.     min: 0
  121.     max: 1
  122.     step: 0.05
  123.   volume_soundbar:
  124.     name: Soundbar
  125.     icon: mdi:volume-high
  126.     min: 0
  127.     max: 1
  128.     step: 0.05
  129.   volume_bedroom:
  130.     name: Bedroom
  131.     icon: mdi:volume-high
  132.     min: 0
  133.     max: 1
  134.     step: 0.05
  135.   volume_bathroom:
  136.     name: Bathroom
  137.     icon: mdi:volume-high
  138.     min: 0
  139.     max: 1
  140.     step: 0.05
  141.  
  142. #input_select.yaml
  143. # Input Select Statements
  144.   music_station:
  145.     name: Source
  146.     icon: mdi:music
  147.     initial: Stopped
  148.     options:
  149.     - Stopped
  150.      - Vanilla Deep
  151.      - Vanilla Smooth
  152.      - Vanilla Greek
  153.      - Arion
  154.      - Athens Party
  155.      - MAD Radio
  156.      - Diesi
  157.      - Derti
  158.      - Dromos FM
  159.      - Sok FM
  160.      - Sfera
  161.      - Jams 104.3
  162.      - B96
  163.      - Greek Summer 2018 vol2
  164.      - Greek Summer 2018
  165.      - Παλιά Ελληνικά
  166.      - Αξέχαστα Ελληνικά Λαϊκά
  167.      - Αθάνατα Λαϊκά
  168.      - Τα Χρυσά Λαϊκά
  169.      - Summer 2018 vol2
  170.      - Summer 2018
  171.      - Winter 2017
  172.      - Fall 2017
  173.      - Spring 2018
  174.   speakers:
  175.     name: Speakers
  176.     icon: mdi:speaker-wireless
  177.     options:
  178.     - House
  179.      - Kitchen
  180.      - Dining Room
  181.      - Living Room
  182.      - Soundbar
  183.      - Office
  184.      - Bedroom
  185.      - Bathroom
  186.  
  187. #automation.yaml
  188. #DJ Panel
  189. - alias: Play music on Chromecast
  190.   trigger:
  191.     platform: state
  192.     entity_id: input_select.music_station
  193.   action:
  194.     - service: media_player.play_media
  195.       data_template:
  196.         entity_id: >
  197.          {% if is_state('input_select.speakers', 'House') %} media_player.house
  198.           {% elif is_state('input_select.speakers', 'Office') %} media_player.office_display
  199.           {% elif is_state('input_select.speakers', 'Kitchen') %} media_player.kitchen_speaker
  200.           {% elif is_state('input_select.speakers', 'Dining Room') %} media_player.dining_room_speaker
  201.           {% elif is_state('input_select.speakers', 'Living Room') %} media_player.living_room_speaker
  202.           {% elif is_state('input_select.speakers', 'Soundbar') %} media_player.soundbar_speaker
  203.           {% elif is_state('input_select.speakers', 'Bedroom') %} media_player.bedroom_speaker
  204.           {% elif is_state('input_select.speakers', 'Kitchen') %} media_player.kitchen_speaker
  205.           {% elif is_state('input_select.speakers', 'Bathroom') %} media_player.bathroom_speaker
  206.           {% endif %}
  207.         media_content_id: >
  208.          {% if is_state('input_select.music_station', 'Vanilla Deep') %} http://ample-01.radiojar.com/egqwgc0q52mtv
  209.           {% elif is_state('input_select.music_station', 'Vanilla Smooth') %} http://ample-01.radiojar.com/w0b4xf0q52mtv
  210.           {% elif is_state('input_select.music_station', 'Vanilla Greek') %} http://ample-01.radiojar.com/exdncp89fnwtv
  211.           {% elif is_state('input_select.music_station', 'Arion') %} http://ice.onestreaming.com/arion
  212.           {% elif is_state('input_select.music_station', 'Athens Party') %} http://ice.onestreaming.com/athensparty
  213.           {% elif is_state('input_select.music_station', 'MAD Radio') %} http://mediaserver.mad.tv:8000/stream
  214.           {% elif is_state('input_select.music_station', 'Diesi') %} http://diesi.live24.gr/diesi1013
  215.           {% elif is_state('input_select.music_station', 'Derti') %} http://derti.live24.gr/derty1000
  216.           {% elif is_state('input_select.music_station', 'Dromos FM') %} http://dromos898.live24.gr/dromos898
  217.           {% elif is_state('input_select.music_station', 'Sok FM') %} http://sokfm.lalala.gr:8000/stream
  218.           {% elif is_state('input_select.music_station', 'Sfera') %} http://sfera.live24.gr/sfera4132
  219.           {% elif is_state('input_select.music_station', 'Jams 104.3') %} http://15113.live.streamtheworld.com/WBMXFMAAC_SC
  220.           {% elif is_state('input_select.music_station', 'B96') %} http://17793.live.streamtheworld.com/WBBMFM_SC
  221.           {% elif is_state('input_select.music_station', 'Greek Summer 2018 vol2') %} https://gtmasters.duckdns.org/local/GreekSu$
  222.           {% elif is_state('input_select.music_station', 'Greek Summer 2018') %} https://gtmasters.duckdns.org/local/GreekSummer2$
  223.           {% elif is_state('input_select.music_station', 'Παλιά Ελληνικά') %} https://gtmasters.duckdns.org/local/Παλία_Ελληνικά.$
  224.           {% elif is_state('input_select.music_station', 'Αξέχαστα Ελληνικά Λαϊκά') %} https://gtmasters.duckdns.org/local/Αξέχασ$
  225.           {% elif is_state('input_select.music_station', 'Αθάνατα Λαϊκά') %} https://gtmasters.duckdns.org/local/Αθάνατα_Λαϊκά.mp3
  226.           {% elif is_state('input_select.music_station', 'Τα Χρυσά Λαϊκά') %} https://gtmasters.duckdns.org/local/Τα_Χρυσά_Λαϊκά.$
  227.           {% elif is_state('input_select.music_station', 'Summer 2018 vol2') %} https://gtmasters.duckdns.org/local/Summer2018vol$
  228.           {% elif is_state('input_select.music_station', 'Summer 2018') %} https://gtmasters.duckdns.org/local/Summer2018.mp3
  229.           {% elif is_state('input_select.music_station', 'Winter 2017') %} https://gtmasters.duckdns.org/local/Winter2017.mp3
  230.           {% elif is_state('input_select.music_station', 'Fall 2017') %} https://gtmasters.duckdns.org/local/Fall2017.mp3
  231.           {% elif is_state('input_select.music_station', 'Spring 2018') %} https://gtmasters.duckdns.org/local/Spring2018.mp3
  232.           {% endif %}
  233.         media_content_type: 'audio/mp4'
  234. - alias: Set Volume
  235.   trigger:
  236.     platform: state
  237.     entity_id: input_number.volume
  238.   action:
  239.     service: media_player.volume_set
  240.     data_template:
  241.       entity_id: >
  242.        {% if is_state('input_select.speakers', 'House') %} media_player.house
  243.         {% elif is_state('input_select.speakers', 'Office') %} media_player.office_display
  244.         {% elif is_state('input_select.speakers', 'Kitchen') %} media_player.kitchen_speaker
  245.         {% elif is_state('input_select.speakers', 'Dinning Room') %} media_player.dining_room_speaker
  246.         {% elif is_state('input_select.speakers', 'Living Room') %} media_player.living_room_speaker
  247.         {% elif is_state('input_select.speakers', 'Roaming') %} media_player.soundbar_speaker
  248.         {% elif is_state('input_select.speakers', 'Bedroom') %} media_player.bedroom_speaker
  249.         {% elif is_state('input_select.speakers', 'Bathroom') %} media_player.bathroom_speaker
  250.         {% endif %}
  251.       volume_level: '{{  states.input_number.volume.state  }}'
  252. - alias: Set Volume Office
  253.   trigger:
  254.     platform: state
  255.     entity_id: input_number.volume_office
  256.   action:
  257.     service: media_player.volume_set
  258.     data_template:
  259.       entity_id: media_player.office_display
  260.       volume_level: '{{  states.input_number.volume_office.state  }}'
  261. - alias: Set Volume Kitchen
  262.   trigger:
  263.     platform: state
  264.     entity_id: input_number.volume_kitchen
  265.   action:
  266.     service: media_player.volume_set
  267.     data_template:
  268.       entity_id: media_player.kitchen_speaker
  269.       volume_level: '{{  states.input_number.volume_kitchen.state  }}'
  270. - alias: Set Volume Dining Room
  271.   trigger:
  272.     platform: state
  273.     entity_id: input_number.volume_dining
  274.   action:
  275.     service: media_player.volume_set
  276.     data_template:
  277.       entity_id: media_player.dining_room_speaker
  278.       volume_level: '{{  states.input_number.volume_dining.state  }}'
  279. - alias: Set Volume Living Room
  280.   trigger:
  281.     platform: state
  282.     entity_id: input_number.volume_living
  283.   action:
  284.     service: media_player.volume_set
  285.     data_template:
  286.       entity_id: media_player.living_room_speaker
  287.       volume_level: '{{  states.input_number.volume_living.state  }}'
  288. - alias: Set Volume Soundbar
  289.   trigger:
  290.     platform: state
  291.     entity_id: input_number.volume_soundbar
  292.   action:
  293.     service: media_player.volume_set
  294.     data_template:
  295.       entity_id: media_player.soundbar_speaker
  296.       volume_level: '{{  states.input_number.volume_soundbar.state  }}'
  297. - alias: Set Volume Bedroom
  298.   trigger:
  299.     platform: state
  300.     entity_id: input_number.volume_bedroom
  301.   action:
  302.     service: media_player.bedroom_speaker
  303.     data_template:
  304.       entity_id: media_player.soundbar_speaker
  305.       volume_level: '{{  states.input_number.volume_bedroom.state  }}'
  306. - alias: Set Volume Bathroom
  307.   trigger:
  308.     platform: state
  309.     entity_id: input_number.volume_bathroom
  310.   action:
  311.     service: media_player.bedroom_speaker
  312.     data_template:
  313.       entity_id: media_player.bathroom_speaker
  314.       volume_level: '{{  states.input_number.volume_bathroom.state  }}'
Advertisement
Add Comment
Please, Sign In to add comment