Skip to main content

Building a Control Box to Enable Boiler Remote Control

Boiler Control Panel

Adding smarts to a not-smart combi boiler, enabling remote heating control and scheduling flexibility.

Introduction

As winter is rapidly approaching here in the UK, usage of heating is beginning to increase. Most central heating installations can be as simple as a combi boiler controlled by a fixed timer or can be as involved as using COTS “smart” heating controls, such as Google’s Nest thermostat or British Gas’ “Hive” product offering.

Room thermostats and programmers boil down to nothing more than a dry contact that is closed with heating demand, with the boiler usually providing a 230V mains output and an input that is connected to the contacts.

Currently, the controls for my heating system consist of a combination timer and room thermostat, which leads to a number of frustrations – only two programmable time slots with no option to run only one and the temperature of one room is monitored. There is also no option of “boosting” for a time period which would be beneficial for doing things like drying washed clothes.

After having my patience tested one final time dealing with the rigidity of the timer, I set out to build a replacement control box that would interface with the boiler. Other devices around my house are controlled from Home Assistant as I prefer to keep more critical controls and services local rather than relying on a cloud, so building a system that integrates with this was a no-brainer.

DISCLAIMER: This article is not intended as a how-to guide and nothing in it constitutes professional advice regarding working with mains electricity. Mains electricity and wiring issues can easily kill, and work on mains equipment and associated wiring should only be carried out by a competent person.

Component Selection

The controls required to interface with the boiler are simple: a switch capable of handling 230V, a suitable microcontroller and a power supply. Additional components were chosen to allow for a fall-back mode of operation that relies on the existing room thermostat to take control, should either the WiFi connection become unavailable or Home Assistant crashes.

ESP8266 Microcontroller

As the microcontroller needs to be capable of communicating over a network connection to be able to interface with Home Assistant, I settled on using an ESP8266 which is supported by ESPHome. For ease of use, a development board (216-3757) manufactured by DFRobot was selected; this features the ESP-12F module paired with 16MB Flash, an on-board lithium-ion battery charger and voltage regulators to deliver the necessary voltage rails.

mounts for Microcontroller

To mount the microcontroller board on DIN rail an interposer plate was laser-cut from acrylic sheet, then fastened to two Hammond clips (773-3296) . These clips provide an ideal solution for attaching non-DIN rail compatible parts.

The breakout board accepts a 5V input on the “Vcc” pin which makes selecting a power supply easy. I settled upon the RS Pro 5V, 2.4A DIN rail-mounted power supply (235-8689) which features a slim design, saving space that was already at a premium.

Relay wired into control panel

A relay was required to bridge the gap between the microcontroller GPIO pins that operate at 3.3Vdc and the 230Vac used by the boiler. To avoid having to build an interface circuit to drive a relay coil, a suitably rated Solid State Relay was chosen. Crydom produce a slim “interface” SSR (720-3988) that nicely fits this bill, featuring a maximum output current of 2A at 230Vac, which is plenty for my application.

One thing to note even with using an SSR is the required input current to turn on the output. Crydom quotes the “typical input current” as being 15mA at 5Vdc, with an input impedance typically of 333 ohms. At 3.3Vdc this gives an input current of 9mA, which is just within the maximum permissible single-pin GPIO current of the ESP8266, at 12mA.

The front panel controls consist of two rotary switches and two LED indicators. Both rotary switches are Siemens parts, one a three-position (874-1787) to give auto-off-manual control and a two-position (103-8504) that switches between the existing thermostat output and an always-on “hand” position – providing a backup control should the ESP8266 become inoperable. A white (763-7937) and green (763-7949) LED indicator reflect the status of the incoming mains supply and heating demand on the control output.

Wall box enclosure

A compact steel enclosure (775-5785) was selected to house all the components. Steel was the preferable choice to using a plastic enclosure for fire safety reasons should anything fail within the enclosure. It feels more “correct” using a steel enclosure when 230V mains supplies are involved, but this is a matter of preference. Steel enclosures such as the one selected also tend to feature permanently affixed hinged doors which is ideal for controls installation, as plastic enclosures tend to have loose lids.

To round off the component selection process, a number of terminals from Phoenix Contact’s PTFIX series were selected from our stock. These terminals feature push-fit connections that make wiring quick and easy, plus the ability to connect terminals together with shorting bars means that large terminal gangs are easily made.

Assembling the Control Box

The first step was to assemble two sections of DIN rail onto the mounting plate included with the enclosure. Two sections were used to provide enough space for the power supply, microcontroller, relay and terminals. Due to the mounting plate being retained with nuts that tighten onto studs within the box approximately ten millimetres at either end of the rail cannot be used – sufficient clearance is required to be able to get a nut driver in.

DIN Rail Terminals

With both DIN rails in place, terminals and the relay were snapped onto the lower rail. Eight terminals were grouped together into four sets of two – one for mains live, neutral, earth and the boiler thermostat live output. The thermostat return was connected to a terminal on the heat demand indicator. 

Controls fitted to front panel

The front panel was removed and four 22mm holes were drilled with a step drill bit to allow for installation of controls.

front panel controls and indicators

A laser-cut and etched sheet of IPI Laserables II was used to label the front panel controls. This material consists of a thin layer of acrylic bonded to a thicker sheet, once the top layer is etched through the colour underneath shows through. Using this material produces a high quality and robust label and lately has become my favourite way of marking panels.

Power supply with adjustable output

Moving back to the internals, the power supply was clipped in and wired to the mains distribution terminals. A quick power-on check was done so that the output voltage could be set correctly, as a small potentiometer permits adjustment within a 4.5-5.5Vdc range.

Before installing the microcontroller board some minor modifications needed to be done. Given the steel enclosure selected, the ESP8266 would be unable to receive any WiFi signal at all and the stock ESP-12F module does not have a footprint for a u.FL antenna connector. Some careful modification with a scalpel and soldering iron permitted a connector to be soldered and the on-board antenna disconnected.

Quick test using Arduino sketch

A quick test using an Arduino sketch proved that the modifications were successful and WiFi networks could be received with the board mounted inside the box.

Connecting the ESP8266 to Home Assistant

As the initial setup of ESPHome requires a USB connection to the microcontroller to flash firmware, just before final installation was the prime time to do this. Once the firmware is installed over-the-air updates can be performed and configuration remotely downloaded.

ESPHome screen

ESPHome has an easy-to-use onboarding tool that prompts for access to the device, using WebUSB to access the serial port presented by the microcontroller board. With the board successfully connected, the firmware is installed then a prompt appears to enter WiFi credentials. This builds a basic configuration that is pushed to the device, containing nothing more than the board type, an API key used by Home Assistant, an OTA key used by ESPHome and WiFi settings (including a fallback hotspot mode should the connection fail)

switch:
  - platform: gpio
    pin: 12
    name: "Boiler thermostat input"

The configuration was then updated to have the correct board type (the ESP-12F module appears to be compatible with the NodeMCU v2 modules) and a “switch” component configured connected to GPIO pin twelve. Creating a switch component in ESPHome exposes a switch entity within Home Assistant.

Home Assistant Showing Boiler Interface

With the configuration created this was updated using OTA to verify the microcontroller was properly connected and communicating. Through the magic of Home Assistant device discovery, the new entity is found and a notification delivered prompting for final configuration.

At present, I have the entity connected to a button control on my dashboard, but I plan to connect this to a generic thermostat control in combination with a scheduler to allow me to fulfil my goal of flexible heating controls.

Progress on the final wiring continued once the microcontroller was installed, which consisted of connecting the GPIO output to the SSR and adding the external connector plate. This holds two five-pole connectors in male (250-6120) and female (250-6129) variants to allow the boiler and thermostat to be plugged in. The external interfaces were wired using Igus chainflex PVC control cable, which provides four numbered conductors and a green/yellow earth conductor.

Fused terminal block

Connections inside the boiler were bought out to a fused terminal block. Live, neutral and earth had to be combined with the existing supply that comes from a plug and the replacement thermostat live output and input are connected on their own. The same was done to the room thermostat, with the existing cable disconnected and replaced with the control cable leading to the interface box.

Final check on control panel

A final set of checks were done, including checking for any dead shorts between the mains connections, and the thermostat output connections. Plugging the mains connection in resulted in the boiler powering up and the interface power indicator illuminating. Toggling the switch within Home Assistant resulted in the heat indicator lighting and the boiler starting up.

To Finish

In this article, we’ve taken a look at the process of building a custom relay interface box to connect to a traditional combi boiler. We’ve also taken a look at how easy it is to build custom peripherals that can integrate with Home Assistant using the ESP8266 or ESP32 series of microcontrollers.

Engineer of mechanical and electronic things by day, and a designer of rather amusing, rather terrible electric "vehicles" by night.
DesignSpark Electrical Logolinkedin