Angelos Orfanakos

Making a dumb gas boiler smart with Shelly and Home Assistant

WARNING: Danger of death

The process described in this post entails significant risk as it entails working with lethal 230 VAC voltage. This should only be carried out by a licensed electrician. Do not attempt to do this by yourself. I cannot be held liable for any damage (e.g. fire, damaged gas boiler), injury or death that results by following all or part of the information contained in this post.

Background story

Feel free to skip this section if it’s of no interest to you.

It all started with some sweaty nights under our very warm duvet. We had, for once more, forgotten to dial down the gas boiler thermostat a few hours before going to bed and it kicked in during the night. Once the radiator started heating the bedroom, we would wake up several times from the heat to remove the duvet and drink water. In my endless quest to make every possible thing in the house smart, this seemed like the next best thing to tackle.

I started by examining our existing thermostat, a Siemens RDD100.1 You can tell just by the name that this thing is a disaster. The target temperature +/- buttons work some of the time, the screen has no backlight and there is no way to see both the target temperature and the actual temperature of the space. Moreover, it suffers from what most dumb thermostats usually do: their location is not in the main living space, so once they reach the target temperature e.g. in the hallway, they turn off the boiler even if the main living space is still cold.

THERMOSTAT FRONT IMAGE HERE

I removed the front panel and was left with a backplate that had 2 wires connected to 2 pins (out of 3 pins in total) Using a multimeter, I measured 24 VDC. Based on the fact that the thermostat ran on 2 AAA alkaline batteries and produced an audible “clack” sound each time the gas boiler turned on/off, I figured this was the sound of a latching relay (keeps its position without consuming power) and the 2 wires were the control signal circuit from the boiler: a closed/open circuit turned on/off the gas boiler. This seemed like a perfect fit for a Shelly 1 Gen4 smart switch that has dry (a.k.a. potential-free) contacts, which means the switch is electrically isolated from the circuit it’s switching; exactly what the dumb thermostat was doing. I chose Gen4 to try out the Zigbee support, which turned out to be somewhat great (more on that later)

Thermostat back

Thermostat backplate

I quickly realized there’s no 230 VAC power near the legacy thermostat to power the Shelly. In Greece, regulations require that gas pipelines terminate outside to avoid potentially lethal leaks, so almost all gas boilers are installed in balconies and have a dedicated exhaust. This meant I had to place the Shelly outside, next to the boiler. I figured this would be no problem if I used a waterproof electrical panel enclosure to house the Shelly and any cabling. To power everything, I’d disconnect the power cord from the gas boiler, use it inside the enclosure and then continue outside to the boiler to power that as well. To replace the thermostat, I would connect the Shelly’s I/O dry contacts to the gas boiler thermostat terminals (marked “E1” on the gas boiler circuit board)

Gas boiler circuit board

To make the installation more complete, I ended up adding:

  • Power switch (DIN) to cut off power e.g. for maintenance (the apartment has no dedicated switch for the gas boiler - duh!)
  • Backup push button (DIN) to turn on/off the Shelly manually (e.g. in case I can’t do it from Home Assistant) with a LED to signify whether there’s power or not
  • Shelly EM Mini Gen4 to measure the consumption as well as when the gas boiler is on: apart from heating, the gas boiler also works independently when there’s demand for hot water
  • Some Wago clamps for all electrical connections
  • Flexible, multi-strand, insulated (NYAF) 3-wire cable terminated with ferrules; 1.5 mm² wide for powering the Shelly/boiler and 1 mm² wide for the control signal (24 VDC)
  • Tie-wraps around the cables for strain relief

Note: All of the above is already behind a 10 A circuit breaker.

Electrical diagram

Here’s the diagram I sketched before assembling everything:

Schematic

Legend:

  • Brown/Blue: 230 VAC Live/Neutral
  • Green: Ground
  • Red/Black: Gas boiler signal (24VDC)
  • Dashed line means “switch”

Assembled panel

The final result:

Enclosure, open

Enclosure, mounted

Setup in Home Assistant

Adding the Shelly devices in Home Assistant with Zigbee is very easy and I didn’t have to use the Shelly app at all. I used an electrically insulated screwdriver (Shelly devices are powered by 230 VAC and touching them can be lethal!) to quickly press 5 times the reset button on the back of each device and it switched to Zigbee mode. I then went to the Home Assistant Zigbee integration page and watched the devices get discovered!

Sadly, I quickly found out configuring the Shelly 1 input to be a push button (instead of a persistent on/off switch) in Zigbee mode is not supported yet by the firmware. Support is coming with the 1.8 version though and then ZHA has to ship a version that supports it as well. But I can wait.

To operate the gas boiler in Home Assistant, I installed install the Generic Thermostat integration and picked the Shelly 1 as the switching device and the living room temperature sensor in Home Assistant setup as a thermometer. This solved the “warm hallway, cold living room” problem I mentioned earlier!

Here are some automations I set up so that I rarely have to operate the thermostat from Home Assistant:

  • Set thermostat preset to “away” when the alarm is armed away (left home)
  • Set thermostat preset to “home” when alarm is disarmed from armed away (arrived home)
  • Set thermostat preset to “sleep” at 20:00 to ensure the bedroom temperature drops by sleep time
  • Set thermostat preset to “home” when the alarm is disarmed from armed night (pre-wake up routine)