Smart Control for an Old-Style Heating System

The less Python coding I do, the more efficient and reliable solution I can produce ๐Ÿ˜€ I converted my Raspberry Pi to a dedicated Home Assistant server and this helped me solving a real problem without writing a single line of Python code.

The problem: my family house has rooms facing both to East and South served by the same heating pump. The East-facing room is better insulated than the South-facing one and also has a larger radiator, thus on cold and cloudy days the South-facing room cools down much faster than the other, while on sunny days it gets warmer much faster.  Therefore a single room thermostat cannot make justice: one of the rooms often remains underheated, cold. I was looking for a solution that turns on the heating pump if any of the rooms gets too cold, but prevents the rooms to become overheated on some other cases.

Obviously there are off-the-shelf smart home systems that provide solution to this problem, but our house was built decades before the smart home boom. Furthermore being cost conscious I wanted to repurpose the gadgets purchased for my previous challenges and tried to minimize the need for any subscription fee for cloud services. 

The DIY smart heating system described below is actually a follow-up of my previous challenges and perhaps also the first step of a long journey towards transforming our 20th century built house to a 21st century smart home.

Home Assistant based smart heating of our 20c house

In the 20th century original design of our house the room thermostat which was placed in one of the rooms kept switching on/off the heating circulation pump in the basement. There is a direct wired connectivity between the room thermostat and the heating pump.

My solution completely ignored the room thermostat and its wired connectivity to the pump. Instead I daisy-chained the pump to a smart plug integrated into the Home Assistant server via wifi connectivity. There are temperature-humidity sensors in each room and the Home Assistant server receives their temperature report over Zigbee wireless connection.

The 'brain' of the system is my Home Assistant script that plays the role of the room thermostat, but with some twist: the temperature of either room can trigger the switch on/off. The heating script can be controlled remotely so that I can select between my standard and energy saver programs and both the temperature and the pump status can be checked remotely.

As my internet provider does not allow me to access my home-based Raspberry Pi directly from the Internet, I am using a cloud service that operates a so-called MQTT Broker. This is to maintains the connection between the Home Assistant server and my mobile. The connection is based on the transfer of very small chunks of commands and data.

Let's dive a bit deeper into the technical details.
  • The freely available Home Assistant platform was installed to the Raspberry Pi as a dedicated server because this provides the highest level of availability and also because this configuration of Home Assistant allows access to some useful add-ons.
  • One of these add-ons made it possible to integrate the Tuya Smart Life compatible smart plug without actually accessing the Tuya cloud, ie. keeping everything local.
  • The room temperature is reported to the Home Assistant server by Sonoff SNZB-02 Zigbee sensors.
  • The heating programs are actually Home Assistant automation scripts that can be created in a visual interface without writing a single line of program code. So far I created only two scripts for my smart heating, one for each of my heating programs.
  • Additional automations were created to send/receive MQTT messages to the HiveMQ Cloud which is an MQTT broker service with a generious freemium price plan. The free cluster allows 10GB data transfer per month that is more than enough for such DIY projects.
  • There are plenty of mobile MQTT client apps both for Android and iOS. I found SNR Lab's IoT MQTT Panel the most handy, not only because its free version provides all the features I need in an excellent UI, but also because it can easily handle HiveMQ's SSL certificate.
For an experienced Home Assistant tinkerer the setup of the above automation takes just a few minutes. For me this was the first major challenge in this platform that paved the way for further DIY automations, eg. the replacement of my outdated burgler alarm with a system of remote controlled motion sensors. While there are a plenty of paid-for professional remote controlled heating automation systems on the market, mine is a low budget alternative that needs only a minor initial investment.