Smart heating scheduler for Home Assistant (extra: multi-zones version)

Hi, it’s in the documentation:

Hi Rob

This looks really good. I followed an OpenHab project where each room had a TRV controller on the radiator - in the middle of installing something similar and a lot of code to write but yours looks a great start.

Have you considered making each room individually controllable?

I am actually thinking about how to do it currently, as my complete heating system will be replaced during next summer and I will also have TRVs everywhere, as I’ve counted there will have to be around 20 of them. Only that I’m gonna place them all on centrally located manifold splitters, rather than on the heater itself, as control and cabling would be much easier (with multi-relay cards rather than separate relays for each).

I don’t think that this should result in a 20-zones system, but I’m thinking in grouping them in 3 or 4 zones, so I’ll just have to expand the 2-zones scripts above.
There will be rooms with multiple heating circuits so that means some rooms will have multiple TRVs to handle in parallel.
Also the zones will contain multiple rooms as I consider differentiating the zones based on the usage differences (for example the bedrooms need different style of heating than living room and kitchen or workplace/office/garage etc) as they may need different temperatures on different times of day.

So what I’m thinking now is to add one or more temperature (and perhaps humidity) sensor to each room. If more TRVs need to be switched for the same room those will be grouped into a single switch group entity (given that all heating elements have similar efficiencies for the room they need to heat). Than make a generic_thermostat for each room, which is using the temperature sensor and the group of TRV switches corresponding to that room (if multiple temperature sensors for the same room, average their values first).

Then in the heating control, for each zone I would add to the climate.set_temperature service call in the automation, a comma separated list of all the generic_thermostats (rooms) belonging to that zone. Maybe with configurable offsets for each room so if someone wants +/- half a degree or so in his/her room, have that too.

This would be I think the principle, and the way it’s written now allows this with relatively few modifications.

For now I’ve ordered 1 piece of this type of sensor to evaluate it for using in each room.
kép
This combined with the recently released Sonoff ZBBridge running Tasmota would not only be a very effective way to gather temperature and humidity data from everywhere, but would also look pretty good. It’s important to keep in mind that cabling can make it very difficult to (re)locate temperature sensors to proper measurement places so this done wirelessly should be give more accurate results on the long term imho.

I will also have some of the water pipe segments going almost outdoors, so I’ll also have to add extra, independent generic_thermostats with sensors beneath their thermal insulation just to make sure they don’t freeze, these will be set as overrides for those TRVs which the pipes belong to - but this will be very specific to my setup.

2 Likes

A great addition is htmltiger’s numberbox-card , which offers this great Lovelace possibility, to replace the imprecise sliders with +/- or up/down controls in a row:
kép
Code:

type: entities
entities:
  - entity: input_number.heating_temp_morning
    type: 'custom:numberbox-card'
    icon_plus: 'mdi:chevron-up'
    icon_minus: 'mdi:chevron-down'
    style: |
      .cur-num{font-size:20px!important}
  - entity: input_number.heating_temp_day
    type: 'custom:numberbox-card'
    icon_plus: 'mdi:chevron-up'
    icon_minus: 'mdi:chevron-down'
    style: |
      .cur-num{font-size:20px!important}
  - entity: input_number.heating_temp_evening
    icon_plus: 'mdi:chevron-up'
    icon_minus: 'mdi:chevron-down'
    type: 'custom:numberbox-card'
    style: |
      .cur-num{font-size:20px!important}
  - entity: input_number.heating_temp_night
    type: 'custom:numberbox-card'
    icon_plus: 'mdi:chevron-up'
    icon_minus: 'mdi:chevron-down'
    style: |
      .cur-num{font-size:20px!important}
title: Kívánt hőmérsékletek
show_header_toggle: false
2 Likes

Sounds good - will follow with interest. I am in a slow refurb so unfortunately TRV controllers have to go at the radiator for most of the house however the first one is easy enough, and it will be nice to have temperature control of pretty much every room, just need to work on the averages so the boiler isn’t running just to heat one room.

Hi Rob,
Quick question, do you think there is a possibility to set away temperature from a switch ?
Since I have cooler and heater units. During winter, away temp would be 18° but during summer when the unit will be in cooling mode, I would need something like 28°.
I now that I can change it in the conf of the thermostat… But would love to do it from a switch.
I’m not sur that it is possible to dynamically change the away_temp value from a switch.
Thanks for your help!

That’s not possible officially as Home Assistant doesn’t support that (at least not yet), but hacks exist to partially achieve this.

1 Like

Thanks for your answer Rob! Will look into this.

Well unfortunately this kind of thermometer although looks great, is not a good solution for feeding data to a reliable heating control, here’s the reason why:
kép
Precision is one thing, that can be handled with an offset. The big issue is that i reports temperatures through Zigbee way too rare. Imho we need to know the actual temperature at least every minute (I prefer 30 seconds). Based on my research on Zigbee wireless thermometers, it can take even 10 hours between temperature reports through Zigbee. It looks like it takes almost 1 degree difference to trigger reporting a value and this cannot be controlled/modified. Strangely though, the value on the LCD updates more often.
This particular device I tested has a button on top which after a short press reports the value through Zigbee instantly. I’ll see if I could hack something in it to simulate a button press every minute (and will that cause battery drain). The funniest thing that the actual sensor inside is an SHTC3 which is one of the best ones existing with precision of ±0.2°C @ -40°C to +125°C !!!

So for the moment I don’t recommend any Zigbee-based temperature sensor as a base for an accurate heating control.

My understanding is that the battery-powered sensors typically report temperature only when it changes by some amount, not on a timer. Mine seem to. Here’s one (brand name CentraLite):
image

And another one (Visonic brand):
image

The CentraLite is powered by two (I think) AA batteries, while the Visonic uses one small button battery. So maybe the one with more battery power updates for smaller changes. The first one is also in an unheated structure, so it shows more temperature swings than the second, which is located inside in my boiler room so doesn’t experience wide swings.

My point is, you might not have to totally rule out Zigbee if you need a reliable, battery-powered thermometer. It seems to me you really only need updates when the temperature changes by some amount, not continuously.

Agree. But my problem is:

We can’t control that and what’s worse we don’t even know what’s that amount. It’s not something written to a spec sheet of the product so more or less it’s a question of luck if you can get hold of some which react on smaller changes. As far as I noticed, CentraLite temp sensors are not even availble anymore :frowning:

To have a good control of the heating we need at least ±0.5° precision and that’s not something extra. Half a degree temperature difference in a 20sqm room is quite a lot and requires more energy to compensate if lost, not to speak about the loss of comfort. DS18B20 have ±0.5° precision but they do some interpolation for in-between values (or the driver does in Tasmota) so by this means they are actually quite usable.

All true. But it’s not the protocol to blame. It seems to me the constraint is using battery-powered devices, which are going to die pretty quickly if they report every 30 seconds. Far better to only report when the temperature changes, be that in 30 seconds or 3 hours.

I agree it’s bad if this sort of information isn’t included in the specs. I haven’t really needed to, so I haven’t gone looking for it.

You misunderstand, I don’t blame the protocol, just the lazy manufacturers.

For example I also bought a couple of Xiaomi Mijia Smart Light Sensors, which are also battery powered. They report the light level in lx every 10-20 seconds. Again lazyness, it was not stated in the specs at all. And having the light level this often is mostly useless…
But again it is excellent to automate cover opening and closing.

I didn’t give up to hack the LCD sensor above to make it report every minute. If successful, I’ll buy one for each room.

hi @robi
is it possible to use your aweful smart heating code w/o mqtt?
I have window and temperature sensors from Xiaomi and use a thermostat from Fritz AVM301.
We had a floor heating, but 3 radiators (bath-, office- and bedroom) which I want to control and adjust with HA.
Currently I test if I can use Schedy heating, but I recommend your UI really!
So everyone can change the time or the temperature directly at my wall tablet :slight_smile:

I’m not really sure, where is the best way to start with implement and change your settings…

What do you mean by w/o mqtt?

I dont use mqtt commands right now.
If its possible I want to use the code with my entities
I dont know how is the best way to start to implement your code into my system.
As written above, I use currently Schedy, but Im very unlucky with this.
Your code is awesome and I want to use this in the future, but I use home assistant since january and have no experience at all :frowning:

There’s no MQTT command there as far as I know. I only have sensors and the heater switch implemented through MQTT but you can use yorus directly from any platform.

1 Like

oh okay, than I missunderstand your first post^^
So I can add your separate files and change them into my config.yaml and it will be run - if I dont create any misstakes :D?

Of course.

3 types of temperature sensors comparison (all located in the same place, a few cm distance):
kép

  • red line is DS18B20 sensor, on a Tasmota with teleperiod 30
  • green line is the Zigbee-based sensor TS0201 (the LCD one linked above)
  • blue line is the Zigbee-based sensor TH01 (Sonoff SNZB-02)

I still think that DS18B20 or any other wired sensor can be a better choice for heating automation as through Tasmota it can be precisely controlled how often to report temperature. Disadvantage that although technically Tasmota is wireless (WiFi) it still requires wired power and that limits the possibilities of optimal placement.

TS0201 is out of the question. If you keep the button on top of it depressed continuously it’s quite precise and it reports temp every minute but it also stays in pairing mode, so as soon as your neighbor puts its gateway in persmission to connect, it will move there… (security issue). Plus battery drains faster.

Sonoff SNZB-02 is not bad. Given that it’s wireless, can be placed optimally according to the room’s specifics. It also reports humidity.

3 Likes