[Structure] Full house heating logic for a central gas heater

The idea of this post is to explain my thoughts on how I would conceptually build a heating system that is as automated as possible, that covers as many exceptions and use cases, that optimizes heating expenses and that still allows for flexibility without being invasive. Perhaps these thoughts will inspire people to build their own heating automations!

I also truly hope that you kind folk will help me build these automations as I am way way WAY underqualified for this! I am thankful for any and all help you can provide. I tried to be as logical and as structured in my thinking as possible making this post, but I ABSOLUTELY welcome improvement/ expansion suggestions as well!

My vision for a smart home: a home provides a relaxing environment all year round anticipating your needs without you needing to do anything, no matter what you are doing – only change batteries on devices when you get the notification to do so - while being as efficient and saving costs as much as possible.

1. System components

  • 8 Zigbee TRVs divided into 6 areas (2 areas have 2 grouped TRVs)
  • Each TRV is controlled by the Better Thermostat control logic
  • Each area has its own Zigbee temp sensor
  • Each area has its own Zigbee window sensors (2 areas have groups of window sensors)
  • The flat is heated by a gas heater controlled by a (dumb) temperature control unit (TCU) that gives the signal to start and stop heating (water is heated in pipes that is then pumped to radiators throughout the house – so turning this control unit on and off is essential to not overheat the flat and save on the gas bill)
  • This temperature control unit (TCU) will be automated using a Shelly switch
  • Each area has a wall-mounted tablet where the temp_target_area for each area can be set
  • …and two people living in the flat with phones always connected to home assistant :blush:

2. At the TRV level

Better Thermostat controls each individual TRV according to an AI based logic to optimize for constant temperature. It will automatically turn heating on and off based on the temperature in the room, if there are windows open, or if the temperature outside is just warm enough to stop heating altogether.

3. At the home level

We need to establish a logic on when to turn on/off the TCU

3.1. Cumulative status

For each area check if these conditions are met:

  • Last temperature sensor update was over 15 minutes ago? (if Zigbee devices drop from network or remain out of battery, this will prevent the system from continuously heating if the last temp_actual_area is lower than the temp_target_area) – if yes, disregard this area, if no continue
  • Is window open? (even though Better Thermostat can control the individual TRVs, without this check we can end up giving the heating command even when all TRVs are off – and that can damage the gas heater pump) – if yes, disregard this area, if no continue
  • If the temp_actual_area higher than the temp_target_area? – if yes, disregard this area, if no continue

If these conditions are met, then calculate the temp_delta_total for the whole flat by summing up the temp_delta_individual from each area that meets the conditions. If the sum is over threshold_heating (right now I am thinking 0.5 degrees x the number of valid areas, so if 3 of the 6 areas are valid and the temp_delta_total is over 0.5x3) – then turn on the TCU until it drops under this threshold.

3.2. Room exceptions

What if we opened in the middle of the winter the windows in a room and it got really cold in there? The individual TRVs will of course turn the radiators in that area off, but if the rest of the house is warm enough, then it is possible that the temp_delta_total will not go over the threshold_heating and the room will not start to heat back up when the windows are closed. So, we need a temp_delta_override that would turn on the TCU no matter if the temp_delta_total is not over the threshold_heating (right now I am thinking a temp_delta_override of over 1 degree – this condition will shut down under 1 degree, but due to the heating inertia, the radiators will continue to heat up the room even if the heating is off).

3.3. Vacation (away) mode

Heating the flat from a lower temperature will take many hours (about 10-14 hours – depending on how cold it’s gotten) – so turning the heating off each time neither of us are home is not a great solution for out flat, as we don’t want to come home to a cold home (yours might differ; if you have temp sensors in the house check how quickly the temp drops when you go away for a few days and how quickly it heats back up). As we all have smartphones connected to home assistant, I can define a zone_not_away (in my case the city itself). If at least one of us is within this zone, do nothing. If both of us leave this zone then save all set temp_target_area(s) and then change all temp_target_area(s) to temp_away_preset. Once at least one of us returns in the zone_not_away, restore all temp_target_area(s). If you define a larger area for zone_not_away then your home starts heating already before you get home – so a definite win.

3.4. Party mode

If we have friends over and want a higher or lower temperature in a certain room than normal, we can use the tablets to change the temp_target_area of a room temporarily by defining a temp_party_area. This setting should revert back to the last temp_target_area within a preset amount of time (countdown_party_time_preset).

3.5. Whole system on/off

The individual TRVs have this feature already with Better Thermostat, I just want to bring this feature to the home level. If the temperature outside is over temp_outside_threshold – then turn whole system off. If temperature outside is unknown, keep whatever status it was before (on or off). There needs to also be an option to override this and manually turn the whole system on if desired (switch_master_heating).

4. Notifications & statistics

Normal operation should yield no notifications. However, some notifications are helpful either for debugging, or for our peace of mind:

  • When vacation mode turns on - both our phones (no need for an off notification)
  • When party mode is on – on the tablet for the respective area – with a countdown
  • When a temperature sensor has stopped responding for let’s say over 1 hour (notify_sensor_unresponsive) – my phone and central tablet in the house (I know for the automation is 15 minutes, but I want to give them reasonable amount of time to perhaps fix themselves and not spam my phone)
  • When a window sensor stays in the open position for too longwhile the house is in heating mode only and only if the temp_actual_area goes under temp_target_area for let’s say 1 hour (notify_window_open_time) – both our phones and all tablets (perhaps battery died? Perhaps someone forgot the windows open?) – not dismissible until problem fixed
  • When any of the batteries of any components of the system reach critical levels (TRVs, window sensors, temp sensors) notify_battery_critical (10% or go below that – some of the Zigbee devices only show multiples of 10%, otherwise I would have put something like 5% here) – my phone and central tablet in the house

When it comes to statistics, it would be nice to have a monthly graph with how long was the heating system turned on and how long was the TCU on.

What do you think about such a system? Suggestions and improvements are WHOLEHEARTEDLY desired!

Wow! Very comprehensive description. I have a similar system but not nearly all these features implemented.
Suggestions:
1 You might want to look at Panhans’ Advanced Heating Control blueprint, it is very full featured and actively developed.
2 Don’t forget to build in a safety for the case that all your rooms are warmer than setpoint and all the TRV’ s close. The boiler may not like that.

Sounds great and comprehensive.

Have you got a passive mode for a rad.
I.e In itself, can not demand heat, unless another active radiator is calling for demand. I found this type of thing especially use full for toilet radiators etc