comment 0

Temperature Regulation on a Saunier Duval Gaz Boiler with Domoticz on a Raspberry Pi 3

Me and my lovely girldfriend rent a nice house near Toulouse, France, which has a Saunier Duval C25E gaz boiler, which does not have a thermostat. This makes regulating the temperature inside the house quite hard, having to turn on and off several times a day.

I have a Domoticz server running on a Raspberry Pi 3, and wanted to regulate the temperature for this winter. Follow is a description of this installation I set up the last september.



Here are some requirements I really wanted.

Isolated module

In my domotic installation, I try to follow as much as possible the “Do not put all eggs in one basket” principle. That means I do not want to “couple” too much the heat regulation with the domotic server. I want to be able to change the regulator to another one easily.

PID regulation

This is much more efficient and confortable than the hysteresis regulation. And I do not want to hardcode this PID within the Domoticz server. I need an independent module that handle than automatically with its own thermostat.

PID is short for Proportional, Integral, DerivativeIt is heavily used for driving real-life systems. If you want a given temperature in your room, you cannot just change the temperature. You have to act on an actuator that will perform some job (send hot air, turn the wheel, etc). The goal is to have the optimal response from the system, ie, to reach the asked value (“set-point” temperature) the quickest as possible.

PID is not mathematically optimal, ie, there is way to have a quickest and more accurate response, BUT, it is efficient enough and not that complex to implement. At least, compared to the most simple regulation done in the simplest thermostats, the hysteresis. Turn on until 20° is reach. Wait for the temperature to go bellow 19° before restarting it. This result in overconsumption and inconfort because the temperature kind of play yo-yo:

Using PID regulation, the heat will be turned on more irregularly so the temperature increase in a way it seems to stay at the same level. See:


Thermostat will be placed anywhere in the house, so I need the regulation to happen wireless. I do not like using Wifi, because of the central network vulnerability it suppose. When the router is down, no more regulation. Z-Wave seems cool, mesh network, so without central point of failure. If also to be a bit open: I want to be able to use this system when we will move to another house with another kind of gaz boiler.

Failsafe mode

If Domoticz crash, I would like to still have the system working with a hardcoded week program. On all the previous requirements, I had to drop this one because I simply did not find a Z-Wave module that can easily handle both autonomous week program and still allow a domotic controller to override the mode. Most of the system I have studied, overriding weekly program by Domoticz server requires complex hacks I did not want to enter.

Before describing the setup, I would like to thanks the support of the french online domotic store Domotic-store. They really helped my with many questions I had even before I purchased. Of course, provided such good quality pre-sale support, I’ve purchased the needed items to them.


Here is the installation:

Setting up the Z-Wave network

I set up a Z-Wave controller on my Domoticz server. I simply linked my Raspberry Pi to the newly bought Aeon ZW090 Gen5 Z-Wave USB key using a 1m USB cable, so the Key is outside of my metal, network cabinet.

Setting up with Domoticz is pretty easy, in my distribution I did not have any issue with the TTY mounting. You probably want a fixed USB TTY mount point in the /dev directory. If the USB key appear as something like /dev/ttyUSB0, you better follow some tutorials on how to have it frozen, for example to /dev/tty/ACM0.

The key appear under an Open Z-Wave hardware:

In Open Z-Wave nodes page, the key appears as first node:

SRT321 Thermostat

So I choose the SRT321 Thermostat, part of the Secure SRT 322 Pack.

In Domoticz, the device appears in the Open Z-Wave nodes as Horstmann HRT4-ZW Thermostat Transmitter:

SSR303 Actuator

Setting up the SSR303 is more tricky, you cannot simply set the battery and press the network association button.

First, I created a 220V AC cable to power this little baby. The provided sheet explain this correctly except on a small thing to know: it will run on 24V DC (main power on 220V AC, drives 24V DC), and this wasn’t obvious in the sheet. To have this relay run on 24V, simply ignore the wire bridge described in the sheet.

Once powered up, I linked this actuator to the Z-Wave networks by pressing long the “>||<” button and setting Domoticz in discovery mode. For an unknown reason, the procedure by pressing the button on top of the Aon USB Key didn’t worked, I had to use the Open Z-Wave’s “Include Node”.

SSR303 operates on the Z-Wave network as an “Always on” Z-Wave device, so there is no poll issue like we will see on the SRT321.

Linking Thermostat with the Actuator

Turn the wheel on the thermostat util a “L” appear. Click on the wheel so the “L” blink

When the Actuator is included, “LP” is displayed.


So, now I’ve set up the link between the thermostat and the actuator, and between both of them and Domoticz.

Choosing the Wake Interval

The thermostat module works on battery, and thus one needs to find a tradeoff between reactivity and power consumption. A thermostat with a short wake interval, such as 5 minutes, will consume the battery much faster than with the default value set to 12 hours.

I found that 10 minutes is the right tradeoff. At 5 minutes, the battery last 4 months, with standard AAA. At 10 with NiMh battery, it is around 6 months. Still not perfect, but acceptable. And during summer, a script automatically set the interval to 1h to preserve battery life.

PID Regulation

Let’s look at a real-life situation. Here is a graph made with Grafana, from data provided by Domoticz:

I have changed the order temperature, the yellow line, from 18°C, the current room temperature, to 19°C. See in green how the PID regulation turns on and off  the SSR actuator. When the temperature reach near the wanted set-point, the regulation turn on and off less often. Even with that, there is still some inertia and the temperature continues to rise.


When the first cold night happened in our new room, I’ve experienced the usage of the boiler without any regulation. I had to manually start the boiler and then shut it down manually to save some money. Temperature wasn’t confortable, so the Wife Acceptance Factor was very low. Once the regulation was set up, we feel much better with constant, pleasant temperature in the whole house. I also set up various temperature scenario to warm the bathroom on the morning, handle vacations and day off, and so on. I’ll describe it in a later article.