Heating automation ideas needed

Hello Community. First off all thanks all of you for so much information I’ve found here already. I’ve recently started with HA and somehow automated my heating system. However I want more :wink:

I have zwave radiator valves which can be controlled with homeassistant. I made a simple automation and it puts 20 degrees in the day time and 10 in the night based on time triggers.
Also I set lower temperature when everybody are away. In order to restore day temperature when someone gets home I put a trigger every 15 minutes for changing temperature. Also zwave valve sometimes doesn’t get commands for some reason so that periodical trigger also helps.
Next step I want to achieve is to be able to set temperature manually if needed. For example if I feel colder I want to set temperature to 22 instead of automatic 20. But as soon as my automation is triggered periodically this 22 will reset to 20 every 15 minutes. And this is where I stuck.

Long story short:
I want to have 2 main temperature modes: day and night.
I want to be able to override default temperatures manually.
I want to be able to set lower temperature when I’m away and restore it when I’m back to the default one (from current mode).

All ideas are welcome. Looks like I need someone who can look at the problem from the different angle.

Not sure it will work for you, but you should check out the Generic Thermostat. I don’t think it implements scheduling, but it should provide most everything else you’re looking for. Then you can use automations for scheduling

Thanks for advice. Unfortunately I don’t have a temperature sensor yet. It is all in radiator valve. Also scheduling is very important.
Maybe I will use it for some custom automation because it has away mode support out of the box.

1 Like

I have something similar set-up. I have an input boolean which I am using in my automation as a condition.
So when input boolean override is active, I don’t lower my heating.

It sounds like you have your temperature set points hard coded into the automations.

I’d use input_numbers instead, you can ‘pre-fill’ them with the current values and - very important - after a restart, it would work with these values.

While the system is running, you can change the input_number value for ‘daytime temperature’ to the desired number - and at the same time trigger that the current temperature for your radiator valves is set to the same value. This way you have the new temperature stored for when thy system checks every 15 minutes and you have the change executed immediately.

For demo purposes take a look at my ‘heating control panel’ - it’s all set up using input_number and input_datetime ‘variables’:

I can change all the temperature and time settings in the Lovelace frontend and can make sure that, e.g. my vacation setup is triggered when I think about it, I don’t have to do it when I leave the house for a longer period of time :grin:

2 Likes

Take a look at schedy.

1 Like

@chairstacker I like the layout of your heating control. What type of system do you use behind it to control temperatures?

Sounds like this is what I need.
The only question is how to set input_number value based on time (or any other condition).
So when I restart hass or switch from away mode to the home mode it should set 20 degrees during the day and 10 in the night as default.
Would you recommend to use template for default value or write a script? Or maybe something else?

My thermostat is a Sensi “Classic” from Emerson; it’s connected to HA hubless via Wink.

Not really sure what that would have to do with the way you set the actual value, i.e. template vs script.

I like to keep thing simple, if possible, so I just created a series of automations that make the necessary changes like this one:

# Workday Startup & Increase Temp Procedures
- alias: HT Start Up Heat On Workdays
  trigger:
    platform: template
    value_template: "{{ states('sensor.time') == (states.input_datetime.ht_workday_startup_time.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}"
  condition:
    - condition: state
      entity_id: 'binary_sensor.workday_sensor'
      state: 'on'
    - condition: state
      entity_id: 'input_boolean.ht_vacation_mode'
      state: 'off'
  action:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.gerstmeyers
        temperature: "{{ states('input_number.ht_startup_temp') }}"

One of the things I changed later on is to not have an initial for my input_number values:

input_number:
  ht_startup_temp:
    name: Startup Temperature
#    initial: 67
    min: 50
    max: 80
    step: 1

This keeps the last value after a restart of HA - and unless the database gets bungled it works very well.

Ok, after restart it will work. You are absolutely right.
But let’s imagine the scenario.
Temperature is set to 20 degrees. I’m leaving home. Based on that it will be set to 10 degrees.
Then I’m back home. If I came back during a day it should set temperature back to 20, but if I’m back in the night it should stay 10.
And this is the whole point. How to set this default temperature for the time period correctly.

The automation that turns it up to 20 should simply have a condition that it doesn’t apply at night.

I would probably use 3 input_number variables:

  1. For the ‘standard’ daytime temperature, i.e. 20
  2. For the ‘standard’ nighttime temperature, i.e. 10
  3. For the current temperature.

#3 is set at certain points in time, e.g.:

  1. at 6:15h the current temperature is set according to the daytime value
  2. at 22:30h the current temperature is set according to the nighttime value
  3. when you leave for work, maybe based on the state of the device_tracker for your phone, the current temperature is set according to the nighttime value
  4. when you get home from work, again maybe based on the state of the device_tracker for your phone, the current temperature is set according to the daytime value
  5. if the temperature is set to daytime value but it feels too cold, you can
  • either change the current value directly to a 22 (and make sure it’s sent to the thermostat immediately as well) - this will set tomorrow’s daytime value at 20 again
  • or you can change the daytime value directly to 22 (and make sure it’s sent to the current value as well as the thermostat immediately as well) - this will make tomorrow’s daytime temperature to start at 22

This is all under the assumption that you want to check the temperature every 15min according to the above - or you could just rely on presence detection triggering the temperature change and do away with that completely.

1 Like

Here is what I implemented for my setup:

group.occ_card holds my device trackers (via template binary sensor)
input_datetime.hvac_morning set to 6:30am
input_datetime.hvac_sleep set to 10:00pm

Automation between morning and sleep:

- alias: 'Occupancy during Day'
  hide_entity: true
  initial_state: true
  trigger:
    - platform: state
      entity_id: group.occ_card
      to: 'on'
      for:
        minutes: 5
  condition:
    condition: and
    conditions:
      - condition: template
        value_template: "{{ states('sensor.time') >= (states.input_datetime.hvac_morning.attributes.timestamp | int ) | timestamp_custom('%H:%M', False) }}"
      - condition: template
        value_template: "{{ states('sensor.time') <= ((states.input_datetime.hvac_sleep.attributes.timestamp | int ) - ('5' | int) * 60) | timestamp_custom('%H:%M', False) }}"
  action:
    - service: script.s_hvac_home

Automation after sleep or before morning

- alias: 'Occupancy during Night'
  hide_entity: true
  initial_state: true
  trigger:
    - platform: state
      entity_id: group.occ_card
      to: 'on'
      for:
        minutes: 5
  condition:
    condition: or
    conditions:
      - condition: template
        value_template: "{{ states('sensor.time') >= (states.input_datetime.hvac_sleep.attributes.timestamp | int ) | timestamp_custom('%H:%M', False) }}"
      - condition: template
        value_template: "{{ states('sensor.time') <= ((states.input_datetime.hvac_morning.attributes.timestamp | int ) - ('5' | int) * 60)| timestamp_custom('%H:%M', False) }}"
  action:
    - service: script.s_hvac_sleep

Scripts hold fan modes and temperature setpoints.

1 Like

Looks very nice. Thanks!

That sounds interesting…

Does it still need the cloud to function or does it become all local after you set it up?

Unfortunately, it still needs cloud access :frowning:

It’s the only one of my smart devices I cannot block from having internet access because it does.

I just don’t see the advantage to a company to require you to use their cloud servers to run your local equipment. Obviously there are some things that have to have external access to work just because it’s easier to store large amounts of data in the cloud. But for stuff like lights, switches and thermostats I can’t imagine the benefit the company is receiving from it. It’s not as if they are charging a subscription fee for remote access to your thermostat.

In principle, I agree.

But I could either use the Sensi thermostat with the Sensi app (only possible through the cloud, though) or use Wink to have it integrated with HA - I decided to take the 2nd route.

As I had the thermostat before I started with HomeAssistant, and as it works fine, I have not done any research on a potential ‘cloud-free’ replacement.

I was thinking of using my Aqara Zigbee temperature sensors as a replacement for the thermostat one, but that would
a) only add complexity
and
b) still require a cloud connection to start and stop the furnace through Sensi.

So, until the Sensi croaks, I will probably stick with it.

Take a look at the tado.com website. I guess you want to mimic their product functionality:
-Different schedules per room.
-Geo-location of users to turn on and turn off heating (when somebody/nobody is at home)
-Open window detection (so a radiator valve closes for 10 minutes when temperature falls xº in a short period of time)
-Turn on and off the boiler when some of the radiator valves opens.
-Manual control (with timer function) per room
-Be able to modulate boiler power
-Nice graphs
-Monthly reports

By the way, their system has smart thermostat and radiator valves.
Netatmo and other makers have similar products.