Skip to content

Instantly share code, notes, and snippets.

@f45tb00t
Forked from r3mcos3/heating.yaml
Last active November 3, 2023 14:38
Show Gist options
  • Save f45tb00t/eab416909ff6d125d7f3c6170ab017a9 to your computer and use it in GitHub Desktop.
Save f45tb00t/eab416909ff6d125d7f3c6170ab017a9 to your computer and use it in GitHub Desktop.
Home Assistant Blueprint For Heating
blueprint:
name: Heating Control and Window Sensor and boolean
description: Control your heating with options for group home, if temp is below
a specific value, set temp, and heating between specific times.
domain: automation
input:
heating:
name: Climate Device
description: The climate device to use.
selector:
entity:
domain: climate
temp_sensor:
name: Temperature Sensor
description: Temperature Sensor to check.
selector:
entity:
domain: sensor
device_class: temperature
window_sensor_1:
name: Door or Window Sensor
description: Check if window or door is open
selector:
entity:
domain: binary_sensor
#because new sensors of aqara device_class: opening
groupname:
name: Person Group
description: The group of people that have to be home.
default: []
selector:
entity:
domain: group
group_presence:
name: Group Presence
description: Heat only if Person of Group was present in a given amount of time
default: 07:30:00
selector:
time: {}
heating_boolean:
name: Heating Boolean
description: Check if Boolean is off for automation
selector:
entity:
domain: input_boolean
min_temp:
name: Minimum Temp
description: If temperature is below this value and someone is home, It turns
heating on.
default: 15
selector:
number:
min: 11.0
max: 25.0
step: 0.1
mode: slider
set_temp:
name: Temperature Target
description: If the heating turns on, It heats to this target temperature.
default: 20
selector:
number:
min: 14.0
max: 25.0
step: 0.1
mode: slider
energy_temp:
name: Energy Saving Temperature
description: When away, keep the Energy Saving Temperature
default: 17
selector:
number:
min: 14.0
max: 25.0
step: 0.1
mode: slider
time_after:
name: Time After
description: After this time the heating turns on, so it's warm in the morning
default: 07:30:00
selector:
time: {}
time_before:
name: Time Before
description: After this time the heating turns off, This to prevent the heating
is on in the middle of the night
default: '21:30:00'
selector:
time: {}
source_url: https://gist.github.com/f45tb00t/eab416909ff6d125d7f3c6170ab017a9
variables:
set_temp: !input 'set_temp'
energy_temp: !input 'energy_temp'
window_sensor_1: !input 'window_sensor_1'
heating_boolean: !input 'heating_boolean'
trigger:
- platform: homeassistant
event: start
- platform: event
event_type: automation_reloaded
- platform: time_pattern
minutes: /1
condition:
- condition: state
entity_id: !input 'heating_boolean'
state: 'off'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: !input 'temp_sensor'
below: !input 'min_temp'
- condition: time
before: !input 'time_before'
after: !input 'time_after'
- condition: state
entity_id: !input 'window_sensor_1'
state: 'off'
- condition: not
conditions:
- condition: state
entity_id: !input 'groupname'
for: !input 'group_presence'
state: not_home
sequence:
- service: climate.set_temperature
data:
entity_id: !input 'heating'
hvac_mode: heat
temperature: '{{ set_temp }}'
- conditions:
- condition: state
entity_id: !input 'window_sensor_1'
state: 'on'
sequence:
- service: climate.set_hvac_mode
data:
hvac_mode: 'off'
entity_id: !input 'heating'
default:
- service: climate.set_temperature
data:
entity_id: !input 'heating'
temperature: '{{ energy_temp }}'
mode: single
@f45tb00t
Copy link
Author

f45tb00t commented Oct 16, 2021

@thefunkygibbon Which thermostats do you have? If it's not Eurotronic Spririt (Z-Wave Version) that yours does not support that. For me it's working.

I needed to add the


    - service: climate.set_preset_mode
      data:
        entity_id: !input 'heating'
        preset_mode: none

because the default would be

  - service: climate.set_preset_mode
    data:
      entity_id: !input 'heating'
      preset_mode: Energy heat


So when triggered it would not change the energy heating back to none.

I gave all Eurotronic Z-Wave thermostats back to the seller, as I had a lot of trouble with them. I've replaced them with the zigbee Versions. The Zigbee Versions have less functionality. See below:

hvac_modes: off, heat
min_temp: 5
max_temp: 30
current_temperature: 21.5
temperature: 17
hvac_action: idle
system_mode: [4]/heat
occupied_cooling_setpoint: 2600
occupied_heating_setpoint: 1700
pi_heating_demand: 0
unoccupied_cooling_setpoint: 1600
friendly_name: Heizung_Badezimmer thermostat
supported_features: 1


So basically there is no energy heating, but the v4 still works for me

@thefunkygibbon
Copy link

ah ok. i'm using with a 'generic thermostat' (which connects a thermometer i have with a smartplug).
personally i'm not bothered about the energy heating aspect, i'm ok with it just being 'off' until i need it on. I'll look in to trying to make some more tweaks to it, and if needs be i guess i can just set the min/max temp to be the same. although i guess that will make for a lot of turning on and off which prob isn't good for any of the hardware involved.

@f45tb00t
Copy link
Author

Due to the fact that the maintainer changed the behavior onwards from Home Assistant 2022.04. I needed to remove some settings, as the Blueprint and therefore the automation did not work anymore.

Should be affected by this: home-assistant/core#68394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment