Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######################
- # Climate - central heater
- ######################
- climate:
- - platform: generic_thermostat
- name: Heater
- heater: switch.heater
- target_sensor: sensor.sn1_temperature
- min_temp: 20
- max_temp: 29
- target_temp: 21
- tolerance: 0.3
- ######################
- # Automation part
- ######################
- automation:
- - alias: 'Time heater on'
- hide_entity: true
- trigger:
- - platform: template
- value_template: '{{ states.sensor.time.state == states.sensor.alarm_time_heater.state }}'
- condition:
- condition: or
- conditions:
- - condition: and
- conditions:
- - condition: state
- entity_id: input_boolean.alarmweekday_heater
- state: 'on'
- - condition: state
- entity_id: binary_sensor.working_day
- state: 'on'
- - condition: state
- entity_id: input_boolean.alarmweekday_heater
- state: 'off'
- action:
- - service: climate.set_operation_mode
- data:
- entity_id: climate.heater
- operation_mode: "auto"
- - service: climate.set_temperature
- data_template:
- entity_id: climate.heater
- temperature: '{{ states.input_number.set_temp_heater.state }}'
- - alias: 'Turn heater ON boolean switch'
- hide_entity: true
- trigger:
- - platform: state
- entity_id: climate.heater
- to: 'heat'
- action:
- - service: homeassistant.turn_on
- entity_id: input_boolean.automode_heater
- - alias: 'Turn time heater OFF'
- hide_entity: true
- trigger:
- - platform: state
- entity_id: input_boolean.timeonoff_heater
- to: 'off'
- action:
- - service: automation.turn_off
- entity_id: automation.time_sheduler_heater
- - alias: 'Timer scheduler ON'
- hide_entity: true
- trigger:
- - platform: state
- entity_id: input_boolean.timeonoff_heater
- to: 'on'
- action:
- - service: automation.turn_on
- entity_id: automation.time_sheduler_heater
- - alias: 'thermostat_heater Temp'
- hide_entity: true
- trigger:
- - platform: state
- entity_id: input_number.set_temp_heater
- action:
- - service: climate.set_temperature
- data_template:
- entity_id: climate.heater
- temperature: '{{ states.input_number.set_temp_heater.state }}'
- - alias: "thermostat_heater On"
- hide_entity: true
- trigger:
- platform: state
- entity_id: input_boolean.automode_heater
- from: 'off'
- to: 'on'
- action:
- - service: climate.set_operation_mode
- data:
- entity_id: climate.heater
- operation_mode: "auto"
- - service: climate.set_temperature
- data_template:
- entity_id: climate.heater
- temperature: '{{ states.input_number.set_temp_heater.state }}'
- - alias: "thermostat_heater Off"
- hide_entity: true
- trigger:
- platform: state
- entity_id: input_boolean.automode_heater
- from: 'on'
- to: 'off'
- action:
- - service: climate.set_operation_mode
- data:
- entity_id: climate.heater
- operation_mode: "off"
- # thermostat INITIALIZATION
- - alias: 'HASS startup'
- initial_state: true
- hide_entity: true
- trigger:
- - platform: homeassistant
- event: start
- action:
- - service: climate.set_operation_mode
- data:
- entity_id: climate.heater
- operation_mode: "off"
- - service: climate.set_operation_mode
- data:
- entity_id: climate.heater
- operation_mode: "off"
- - service: homeassistant.turn_on
- entity_id: input_boolean.timeonoff_heater
- - delay: '00:00:02'
- - service: homeassistant.turn_off
- entity_id: input_boolean.timeonoff_heater
- - service: homeassistant.turn_on
- entity_id: input_boolean.timeonoff_heater
- - delay: '00:00:02'
- - service: homeassistant.turn_off
- entity_id: input_boolean.timeonoff_heater
- sensor:
- - platform: template
- sensors:
- alarm_time_heater:
- friendly_name: 'Time'
- value_template: '{{ "%0.02d:%0.02d" | format(states("input_number.alarmhour_heater") | int, states("input_number.alarmminutes_heater") | int) }}'
- input_boolean:
- alarmweekday_heater:
- name: Worday only
- icon: mdi:calendar
- automode_heater:
- name: 'Set AUTO / OFF'
- initial: off
- timeonoff_heater:
- name: 'Scheduled heater'
- initial: off
- input_number:
- alarmhour_heater:
- name: Hour
- icon: mdi:timer
- min: 0
- max: 23
- step: 1
- alarmminutes_heater:
- name: Minutes
- icon: mdi:timer
- min: 0
- max: 59
- step: 1
- set_temp_heater:
- mode: slider
- name: Set temperature
- initial: 21
- min: 15
- max: 30
- step: 0.5
- unit_of_measurement: "°C"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement