Approaches to controlling boiler temperature (not simple ON\OFF)

Hi!

I’m planning some gas boiler\heater automation for a house, it’s a boiler that support OpenTherm protocol which means that I can not only turn it on or off but also set target coolant temperature.

The problem is that most information I can find is about how to basically setup Generic Thermostat in one way or another, meaning that everyone focuses on just turning it on or off, not adjusting it’s target temperature.

In my mind there should be better ways than just setting it to “slightly above target temperature”, because this might not quite work correctly for larger houses and it will work very differently in summer and winter, so it should probably also take external temperature into account.

Are there any go-to algorithms or approaches at achieving this? Or should I just come up with something on my own? I mean I can think of some way to calculate required target coolant temperature based on current temperature, desired temperature and outside temperature. But I would be surprised if this problem was not tackled by someone else before.

I’m planning to use a Wemos D1 board with OpenTherm adapter and Tasmota. It’s already soldered, flashed and working, so it’s just the automation part that I’m looking into.

I am also thinking about keeping it ‘ON’ most of the time, and lowering it’s temperature instead. Because if it turns off entirely during winter coolant gets quite cold before the temperature in the house drops. So by the time boiler has to turn on it takes it a long time to heat it back up OR it will have to work at 100% power to heat everything up again, which is not ideal either, it can damage pipes for one.

It is not an easy problem. Here is a white paper from UC-Berkeley:

It is loaded with engineering thermodynamics and heat transfer. My intuition says to experiment and try things. The best test I can think of is to set the fluid temp and room temp the same and see if if keeps the room at temp. Keep increasing fluid temp until it does. This will be a minimum temp for the current weather. Keep doing this for a number of conditions and you will have a response cure.

My gut feel is to allow the circulating fluid temperature to drop 1-3 degrees below the lowest temperature you set at night. And when the call for heat comes, I would raise to 5-10 degrees above the target temperature. This will allow better heat transfer to the room.

I don’t understand what you mean that 100% power will damage pipes. The design should have taken this case into account and specified materials and expansion to prevent any damage. 100% power will cause greater expansion and contraction of lines as they are heated and cooled but no damage should occur.

This is a tough problem - Hope this helps a little.

Thanks for the white paper. I did not open it yet as of writing this comment, so keep it in mind. I will take a closer look at it some time soon.

What you describe is what I thought about. Starting with fluid temp = desired room temp, and adjust from there. Come to think of this, it might also be a good task for a neural network to figure out the correlation. But that would be step 2, for step 1 I just want to come up with a dumber but working solution, haha.

Heat pipes, while plastic, can handle it, boiler’s max temp is 80, but it can go to 85 or so, sometimes. The problem is that at that temperature pipes start to curl. They can take that heat, but if one keeps turning boiler on and off constantly (which is how most thermostats works when in ON\OFF mode at least with this boiler\heater model), it results in fluid temperature rapidly changing between like 20-30 degrees and 80 degrees. Which results in pipes moving like snakes and rubbing against stuff basically. It wont damage them quickly, but over time you can see the problem.

But how exactly boiler operates and how pipes react is a whole other problem, which we are solving in parallel. Boiler\heater has tons of service menus and settings and we had technicians come a few times and they kept adjusting it. At the moment it seems to be working in a much softer mode, so it should not be such a problem anymore.

But it works in manual mode. As in we can only set the desired fluid temperature. My current task is to make it work with temp sensors. Simply turning it on and off could work, in conjunction with being able to remotely change it’s fluid temperature. But I think that a perfect automation should also be able to adjust that temperature better than a human would, to achieve the desired target room temp.

I’m not opposed to even writing automations in python if that’s required.

But as I mentioned, I was under an impression that approaches to this should not be some kind of novelty. At the very least there are quite a lot of smart thermostats out there that seem to do that. Thought that something like that should also exist for Hass.

SWAG here… …what about an ESPHome PID Climate with autotuning enabled?

Correct me if I’m wrong, but that looks like it would need to run on an ESPHome device, where’s I don’t think there’s an OpenTherm module for ESPHome. I saw some in some kind of ‘beta’ state, where’s the one for Tasmota seems to be more or less stable.

Also this line makes me worry:

For example, in the output above, the autotuner is driving the heating output at 100%
and trying to reach 24.25 °C.

It implies that it has to run through some kind of relatively short tuning process, which also sets heater to 100%. Neither of which would work for me. First is because it should work throughout the year with temperatures outside changing in range between -30C and +30C. Just this week we had a few days with -1C and a few days with -25C or so.

And running heater at 100% is something I specifically have to avoid, even for tuning process.

What I currently have in mind is some algorithm that would try to adjust dynamically. For example, it starts with setting fluid temp to be equal to desired temp. Then while the target temperature is not reached (within margin) it should every minute or so check if the temperature is moving towards the target one or not, and how fast it’s moving towards there, checking the delta. If the delta is too fast - lower the fluid temperature by a degree or so. If delta is too slow - increase the temperature. Repeat until target temp is reached. Then I dunno, switch to some preset lowest ‘support’ temperature ors omething.

Correct. You mentioned having a Wemos, so it seemed plausible.

Only if you enable autotuning. You can set the parameters yourself if you want.

Most thermostats are boolean to my limited knowledge. They call for cooling/heat or they don’t. So it sounds like you want a thermostat AND a power monitor to disrupt it. The problem is, if the delta is high, I would expect 100% power usage to be called for.

Sounds like PID autotuning to me… :wink:

Sounds like a PID to me…

Use an automation to turn off the thermostat/PID if > 90% power ? But again, if it needs 100% before the disuption, unclear why it wouldn’t just need 100% after the disruption. Am all ears on this one.

Going to call myself out on this assumption after doing a little thought. Having just replaced a few line-voltage thermostats w/ some Sinope’s. I have observed behavior that somewhat mirrors OP’s goals. They turn on in “steps”. Aprox 15, 33, 66 then 100%. Now while you cannot directly control these steps, certain behaviors do influence the response. A “call for heat” 0.5°C higher than actual never uses more than 33%. Any call for cooling approx 1°C or higher than actual jumps to 100%.

Perhaps a similar “constrained call for heat” could be a means to avoid using 100% boiler?

Most thermostats are boolean to my limited knowledge. They call for cooling/heat or they don’t. So it sounds like you want a thermostat AND a power monitor to disrupt it. The problem is, if the delta is high, I would expect 100% power usage to be called for.

Most thermostats do work in simple ON\OFF mode(dry contact is another term used at least in my country, not sure how well it translates though). That is because this is a mode that is universally supported by every heater\boiler and is relatively simple to achieve.

However many heaters\boilers do have more granular APIs\protocols to control them. (and I may be confusing the name, the model we have specifically is a Buderus Logamax U072, easily searchable in google (funny, just tried googling for it myself to make sure, and they still use frames from a promo video I made for them about 10 years ago as a gig while I was still a student)

For example Buderus (and Bosh too I think) heaters use OpenTherm protocol. It allows you to get all sorts of readings from internal sensors of the boiler, as well as directly set desired water and fluid temperatures as you would do it on the physical control panel. And there are thermostats available that utilize this protocol, for example here in Russia we have a company called ZONT that makes them. But it’s cloud based, and I’m sure that core automation happens on the device, I still would prefer something where I directly control the code that runs on the device.

Not sure what you mean by power monitor and disrupting something. As I said, in the case of this gas heater it itself does gas burner modulation, and you can set the desired fluid temperature. So all I need to do from my end is to tell it which temperature of the fluid I want, through opentherm. This part is already solved (not tested yet though, waiting for warmer weather, because atm it’s dangerous to mess with heater, if it stops working everything can freeze within a day and pipes will break).

Sounds like PID autotuning to me… :wink:

Possibly. Though that means that it would be running in autotuning 24\7, basically. And it should have protections against going too crazy, like I would NEVER want it to turn boiler fluid temperature to 100% and NEVER to make it change temperature too drastically too quickly. It should be nice and smooth. Except for maybe emergency situations, where there is a risk of freezing, then it could crank things up, but even then not to 100%. Or maybe only allow that through a confirmation with a notification. Like sending notification “Hey, house is freezing, should I crank it all up to 100% or do you think it’s a sensor fluke or something? [Heat up] [Ignore]”.

Use an automation to turn off the thermostat/PID if > 90% power ? But again, if it needs 100% before the disuption, unclear why it wouldn’t just need 100% after the disruption. Am all ears on this one.

As I said, it should never need 100%. If you have a fluid at say 10C, and you want to heat it up to 30C. You can either burn the heater at 100% for a few minutes to quickly bring the fluid up to 30C, at the cost of deforming the pipes (not permanently, mind you, but any material will expand and contract with change in temperature). And in case of a simple ON\OFF thermostat that’s how they operate, and it means it will then turn heater off, and the fluid will cool down back to 10C within a few minute… then ON again… then OFF… ON… OFF… A cycle repeating every few minutes, with pipes going crazy.

Or you could set the heater to like 50%. It will take longer to heat up the fluid but it will be a smooth change, pipes will be happier. And instead of turning it off entirely you could just turn it down to like 25%, so that fluid temperature will start dropping, but it will take hours for it to drop to 10C. And like that you could potentially even find the correct % for the heater to keep both the fluid and room temperatures constant. Just enough slow burning to keep it.

I think the term for some of this is thermal hysteresis