Advertisement
Guest User

Climate

a guest
Jul 23rd, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.15 KB | None | 0 0
  1. input_select:
  2.   climate_mode:
  3.     name: Preset mode
  4.     icon: mdi:thermostat
  5.     options:
  6.      - Comfort
  7.       - Away
  8.       - Sleep
  9.       - Eco
  10.  
  11. input_datetime:
  12.   weekdays_comfort:
  13.     name: Comfort
  14.     has_date: false
  15.     has_time: true
  16.  
  17.   weekdays_sleep:
  18.     name: Sleep
  19.     has_date: false
  20.     has_time: true
  21.  
  22.   weekends_comfort:
  23.     name: Comfort
  24.     has_date: false
  25.     has_time: true
  26.  
  27.   weekends_sleep:
  28.     name: Sleep
  29.     has_date: false
  30.     has_time: true
  31.  
  32. input_boolean:
  33.   heating_schedule:
  34.     name: Enable schedule
  35.     icon: mdi:calendar-clock
  36.  
  37. script:
  38.   set_climate_mode:
  39.     sequence:
  40.       service: climate.set_preset_mode
  41.       data_template:
  42.         preset_mode: "{{ mode }}"
  43.         entity_id:
  44.          - climate.hallway
  45.           - climate.av_room
  46.           - climate.lounge
  47.           - climate.dining_room
  48.           - climate.kitchen
  49.           - climate.utility_room
  50.           - climate.landing
  51.           - climate.master_bedroom
  52.           - climate.master_bathroom
  53.           - climate.kids_room
  54.           - climate.study
  55.           - climate.guest_room
  56.           - climate.bathroom
  57.  
  58. automation:
  59.   - alias: Set climate mode for all contollers
  60.     initial_state: 'on'
  61.     hide_entity: true
  62.     trigger:
  63.       platform: state
  64.       entity_id: input_select.climate_mode
  65.     action:
  66.       service: script.set_climate_mode
  67.       data_template:
  68.         mode: '{{ trigger.to_state.state | lower }}'
  69.  
  70.   - alias: Weekdays climate to comfort
  71.     initial_state: 'on'
  72.     hide_entity: true
  73.     trigger:
  74.       platform: template
  75.       value_template: "{{ states('sensor.time') == state_attr('input_datetime.weekdays_comfort', 'timestamp') | int | timestamp_custom('%H:%M', false) }}"
  76.     condition:
  77.       condition: and
  78.       conditions:
  79.         - condition: time
  80.           weekday:
  81.          - mon
  82.           - tue
  83.           - wed
  84.           - thu
  85.           - fri
  86.         - condition: state
  87.           entity_id: input_boolean.heating_schedule
  88.           state: 'on'
  89.     action:
  90.       service: input_select.select_option
  91.       data:
  92.         entity_id: input_select.climate_mode
  93.         option: "Comfort"
  94.  
  95.   - alias: Weekdays climate to sleep
  96.     initial_state: 'on'
  97.     hide_entity: true
  98.     trigger:
  99.       platform: template
  100.       value_template: "{{ states('sensor.time') == state_attr('input_datetime.weekdays_sleep', 'timestamp') | int | timestamp_custom('%H:%M', false) }}"
  101.     condition:
  102.       condition: and
  103.       conditions:
  104.         - condition: time
  105.           weekday:
  106.          - mon
  107.           - tue
  108.           - wed
  109.           - thu
  110.           - fri
  111.         - condition: state
  112.           entity_id: input_boolean.heating_schedule
  113.           state: 'on'
  114.     action:
  115.       service: input_select.select_option
  116.       data:
  117.         entity_id: input_select.climate_mode
  118.         option: "Sleep"
  119.  
  120.   - alias: Weekends climate to comfort
  121.     initial_state: 'on'
  122.     hide_entity: true
  123.     trigger:
  124.       platform: template
  125.       value_template: "{{ states('sensor.time') == state_attr('input_datetime.weekends_comfort', 'timestamp') | int | timestamp_custom('%H:%M', false) }}"
  126.     condition:
  127.       condition: and
  128.       conditions:
  129.         - condition: time
  130.           weekday:
  131.          - sat
  132.           - sun
  133.         - condition: state
  134.           entity_id: input_boolean.heating_schedule
  135.           state: 'on'
  136.     action:
  137.       service: input_select.select_option
  138.       data:
  139.         entity_id: input_select.climate_mode
  140.         option: "Comfort"
  141.  
  142.   - alias: Weekends climate to sleep
  143.     initial_state: 'on'
  144.     hide_entity: true
  145.     trigger:
  146.       platform: template
  147.       value_template: "{{ states('sensor.time') == state_attr('input_datetime.weekends_sleep', 'timestamp') | int | timestamp_custom('%H:%M', false) }}"
  148.     condition:
  149.       condition: and
  150.       conditions:
  151.         - condition: time
  152.           weekday:
  153.          - sat
  154.           - sun
  155.         - condition: state
  156.           entity_id: input_boolean.heating_schedule
  157.           state: 'on'
  158.     action:
  159.       service: input_select.select_option
  160.       data:
  161.         entity_id: input_select.climate_mode
  162.         option: "Sleep"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement