My approach to smart heating (radiators, floor heating, gas boiler)

Nice setup. At the moment we are building a new house. Had the same setup in mind.
Could you share the code to switch on-of the valves do I can test and setup my relay board with an ESP8266.

Thanks !!

This is soo impressive, awesome project @algirdasc !

I was looking for an inspiration for smart heating for a long time. So far I only found an option with ESP8266 + 8 Channel Relay Board, a project described in here:

https://khaz.me/cheap-and-easy-control-of-8-relays-through-home-assistant/

Since I have home assistant running with node-red, I think adding a RPI may not be necessary. I have Xiaomi temperature sensors already integrated in hass. I reckon I would need one ESP8266 to control the relay, and second to read the temperature coming from multiple DS18B20.

I am very much interested though in 3 things:

  1. how you wired up all connections. I am bit lost with the photos… each valve has 2 wires, why are they not connected to all to A&C on relay? I see only on CH1 you connected like that, and rest is from C to C…

  2. you used 220V actuators. Is there an advantage over 24V version? I saw there are such options on aliexpress as well

  3. node-red… ahh, I am absolute beginner with node red. I know one can do magic with this, but I am making my first steps only. Would you be so kind to share the code you are using? I wonder what is the logic to control the valves. I have gas heating with weather control, so the heating system decides on the temperature on the supply. However, in each room I would like to be able to control the temperature individually.

Node red just closes the valve fully when temperature is above target? and opens it again fully when temperature drops below target? I guess there are some delays? Or maybe it is more complicated - and we can read in % the state of valve (0% = closed, 100% = fully open)?

Anyway, project is really great, with Grafana dashboard it looks amazing and better than many professional versions :slight_smile:

1 Like

There is no code - just control your GPIO PIN to switch on or off the relay (and valve).

Hi,

When I was doing smart heating, one of the goals was to have single point of failure and heating must be as independable as possible, because it is critical system. Thats why I choose RPI and not ESP8266/Arduino. I got rid of Xiaomi BT sensors and started using Konke/Sonoff Zigbee temperature & humidity sensors (Xiaomi Zigbee sensors are too slow and theyr report time is not configurable) so they would communicate directly with RPI, in case WiFi router crashes. Anyway, that is my approach and filosofy on heating, yours can be different. Either way, you don’t need separate ESP for reading DS18B20 sensors and controling relays, because DS18B20 are 1-wire sensors (bunch of sensors would take 1 GPIO pin on ESP). Regarding your questions:

  1. I have only 7 valves, so CH1 was used to control gas boiler thermostat pin where I needed to open/close circuit. But now I’ve connected BSB controller to control my gas boiler even smarter, so this channel now is not used anymore.
  2. The only advantage is wether you have 24v power supply or not. Other than that - they work the same. Keep in mind, that 220v is much more dangerous, so be careful :slight_smile:
  3. I don’t think my example would help you. It has two controls - one if for gas boiler itself and other is open/close with additional temperature and error checks. I have 3 virtual room units (or thermostats). One for living room (it has 3 radiators in one big room), one for underfloor heating (it is set with lower flow temperature and different heating curve) and one for bedrooms (two rooms with one radiator in each room). Ok. so this is what my flow looks like. I have time trigger (runs every 30 s.) to poll data from gas boiler controller and checks if any of the room units reports heating demand. If there is no demand from room unit, then valves for that room unit is closed. If room unit reports for heating demand, then it starts checking temperature sensors and determine which valves needs to be open (each radiator has temperature sensor nearby). There are few additional checks (sensor failure and etc.) in the background, but basically this is it. If you still interested, I could share my flow on github, but as I said, this is my trial and error polished flow for my house and situation, yours could be different.

Valve full open from closed state takes ~3-4 minutes. Take into considerations to delay heating process if possible, because it could trigger overheat protection on your gas boiler when there is no flow. My boiler has setting for delay, so it is not problem at all. I tried implementing PID methods for controling valves in %, but since my boiler can modulate heating and keep flow temperature steady, having valve opened half-open ir quarter-open is not needed at all. (See screenshot attached and look at room unit 1 temperature - boiler managed to keep steady temperature throughout the day with amplitude of 0.3 degree. Valves were open or closed depending on temperature in each of zone (first was open for 10 hours and was constantly heating with low temperature, second was closed for 3 days, third was open or closed throughout the day)).

If you need more information or pictures of hardware, or anything else - let me know.

Hi,
I have a very similar approach, controlling a 6 block relay with an ESP8266 module. The automation is done in HA, since I cannot figure how to set it in Node Red (how to start the boiler if any of the relays is open, and turn off the boiler if all the relays are closed). So, can ou share the Node red config, please?

You can store relay states in global/flow context and trigger checks to calculate wether start boiler or not.

You can find my heating flow here: https://gist.github.com/algirdasc/61e513b13a990891dc479eed82c898ea

Hello! Congrats on that great heating system. As i am starting to build myself also heating system, then i see that the difference is that i am going to use air to water heat pump that is meant for floor heating. What do you think Algirdas, should i use also for DS18B20? i need to build two this kind of systems, as the pipes are in different rooms ( i have two house blocks).
Best regards from Estonia

Hi, if you have floor heating in all of the house, I think DS18B20’s are not mandatory, as flow temperature would be controlled by your heat pump, you just need to open and close valves when room temperature reaches setpoint. I’m using DS18B20’s because I need to determine if flow temperture risen above 40-ish degrees to stop floor heating.

Hi! Thank you for response, i am goinig to have one radiator, but this is just to give some warmth for winter time that the temperaturenwoulsnt go to - degrees. Any
ideas?

Hi algirdas!

Congrats for the great project!

I am planning to build underfloor water heating with Bosch gas heater (supporting EMS BUS). Already using HA with NodeRed and considering to do the control/automation following your setup. You mentioned that you have 3 virtual room units - could you share more about them?

I need something wired or wireless located in the relevant room, to use as a backup in old-style way to set the temperature, no need to measure temperature, Aqara senors are already in place. Probably the room controller should communicate with HA as well, so to become part of the common process.

Thanks and congrats again.

My gas boiler supports up to 3 room units (thermostats), each with its own settings - setpoint, schedules, flow temperatures, etc. Using BSB LAN, I can emulate each room unit as I see fit. Currently I have room unit 1 - living room with setpoint 20c, max flow temp of 70c, room unit 2 - two bedrooms with setpoint 19.5c, max flow temp of 70c and room unit 3 - floor heating in bathroom and hallway with setpoint of 25 (sensor is placed on floor), max flow temp of 40c. When all room units (RU) reached setpoints, boiler just idles. When temperature in RU3 falls below setpoint, boiler starts heating and keeps flow temp up to 40c, but when temperature in RU1 or RU2 falls below setpoint, flow temp rises. To prevent damage to floor heating I am closing floor heating valves to keep flow temperture below 40c. Let me know if I made my setup any clearer for you :slight_smile: It’s hard to explain, as boiler and valves are working both independently, but still connected to each other.

By the way, keep in mind, that Aqara zigbee sensors has slow update interval (each 1 hour or 0.5 diff, which is too much for my setup), I recommend using Konke or Sonoff temperature sensors - theyr report interval is configurable in zigbee2mqtt.

1 Like

Thank you for the detailed explanation. So your room units are virtual related to the boiler. I see, it seems that your heater has kind of complicated control. Later I saw your component for the Broadlink thermostats (Beok/Floureon) and the picture became more clear to me. Thanks for all the help that you provide!


I imagine my setup like on this simple diagram. Still hesitating between Broadlink and these Moes thermostats. Seems like both are good options. I probably will not rely on the Aqara’s but leave the measurement on the thermostat units, and using HA to setpoint T and automate with geofencing / scheduling. Any comments are welcome. :slight_smile:

I have eletrically heated floors in bedrooms & kitchen, thats why I have broadlink thermostats, they are completely separate from my central heating.

But yes, my room units are “virtual”, but there is posibility to connect physical room units, actually boiler has a lot of possibilities - connection to sun collector, pool heating, connecting multiple boilers, etc. Anyways, room units overides each other, which has more demand for heating. To prevent overheating one or another room unit, I am controlling flow with valves :slight_smile: You can see my nodered automation attached somewhere here above, if you’d like.

As for your setup - If you have conditions to run wires from thermostats to valves - great. I did not, so I had to use zigbee temperature sensors and control valves with raspberry & relay board. Also, I dont think that temperature sensors in broadlink or moes thermostats are precise. At least integrated ones.

Hello again Algirdas!
Is it possible for you to share code? or guide where to start.
Got my 8ch relay block today. And there is a diode solderd on PI, whats it for?
Best Regards

You can find my source here: https://gist.github.com/algirdasc/61e513b13a990891dc479eed82c898ea

There is pull-up resistor soldered on PI, for DS18B20 sensors.

Thanks, i will dig into it. Is there a special script running in terminal for connecting the board?

No. Just NodeRED and pigpiod to remotely control GPIO.

thanks, the node red is a very new to me, so i start from scratch in the darkness

ok. and runnig home assistantin docker supervised or?

This is very interesting . Node red is very powerful tool. I am still stuck with pigpiod, as it compiled fine no problem but it wont start (nitPeripherals: mmap gpio failed (Operation not permitted)
Can’t initialise pigpio library) and i am running it sudo.