Fully automate an electric radiator in Home assistant

Nico Writing by Nico
  7 min of reading

This page has been visited ... times

Fully automate an electric radiator in Home assistant

At the beginning I wanted to write a very simple article concerning the creation of an entity under home assistant which allowed to reverse an on/off switch command, particularly practical in the automation of electric radiators of a house. Then I I said to myself why not write a more complete article on the integration and complete automation of this type of radiator. The cost of such an installation will come back to you between 20 and 30€ per radiator depending on the modules used.

That’s why I’m going to detail the how to do it for:

  • install electric radiators in zigbee
  • reverse the on/off commands
  • integrate in lovelace a map of a generic thermostat to control the whole.

Prerequisites:

  • Home assistant installed (preferably HAOS)
  • an electric radiator with pilot wire
  • a zbmini module
  • a 1N4007 diode
  • 2.5mm electric wire for the diode
  • an Orvibo temperature controller

Installing the Zbmini module

The SONOFF ZBMINI ZIGBEE switch micromodule offers the possibility of controlling a device/lighting in your home.

ZIGBEE CONNECTED SWITCH MICROMODULE - ZBMINI

By Sonoff

The SONOFF ZBMINI ZIGBEE switch micromodule offers the possibility of controlling a device/lighting in your home.

The rectifier diode is suitable for obtaining unidirectional current from alternating current. This diode may therefore be useful to you in the management of heating by pilot wire.

RECTIFIER DIODE 1N4007 (1A)

By

The rectifier diode is suitable for obtaining unidirectional current from alternating current. This diode may therefore be useful to you in the management of heating by pilot wire.

Connect the AC 230V wires to the input terminals (L-IN for phase and N for neutral), and connect the pilot wire diode to the L-OUT output. Two directions are possible depending on the order you want to obtain.

installation diagram of the zbmini module with diode to control the electric heater
Electrical signalPilot wire order sent to heating
No signal / No powerComfort
The radiator thermostat setpoint is followed
Negative half-waveFreeze (White module side)
The temperature remains above a certain threshold to prevent the water from freezing in the pipes
Positive half-waveStop (Red on the module side)
The heating switches off completely

Personally I wanted to use the Comfort/Stop command so I used the connection of the first diagram.

Once the installation is done, all you have to do is integrate it into home Assistant. (I integrated it in Zigbee2mqtt), to do this you just have to activate the inclusion mode in Z2M and then mount the heatsink circuit breaker in order to turn it on. During the first use, the ZBmini module automatically enters pairing mode.

The ZBmini module returns a simple on/off command in data

zbmini integration in zigbee2mqtt

Reverse on/off command

Why reverse the on/off command in Home assistant to automate an electric heater.

Quite simply because in the event of a power failure, the pilot wire sends the comfort command to the radiator. Which means the heater will be ON when the zbmini is OFF. As I wanted to include the generic thermostat command in Lovelace and for consistency I had to reverse the ZBmini command. more precisely I wanted to make the generic thermostat believe that by switching on the off command of the ZBmini it was switching on the radiator.

to reverse the command I first created a file switch.yaml, in this file I would put all the reversed commands of each radiator of the building.

start by putting this line in the configuration.yaml file and reload the configuration.

switch: !include switch.yaml

Then create a switch.yaml file at the root of the ha files. And create a template like this:

- platform: template
  switches:
    salon_inverted:
      friendly_name: Radiateur salon inversé
      value_template: "{{ is_state('switch.radiateur_salon', 'off') }}"
      turn_on:
        service: switch.turn_off
        data:
          entity_id: switch.radiateur_salon
      turn_off:
        service: switch.turn_on
        data:
          entity_id: switch.radiateur_salon

this template will create a switch.salon_inverted entity named Inverted Salon Radiator. Modify according to your entities, the name of the zbmini entity, in my case: switch.radiateur_salon.

Creating the generic thermostat board

To be able to use the generic thermostat card, you need a thermostat that is in the same room as your radiator. For this tutorial I used an Orvibo battery-powered thermostat that I integrated into Zigbee2mqtt.

The ST30 sensor measures the temperature and humidity of an area of your home and informs the user via its screen and via a home automation gateway.

ZIGBEE TEMPERATURE AND HUMIDITY SENSOR

By ORVIBO

The ST30 sensor measures the temperature and humidity of an area of your home and informs the user via its screen and via a home automation gateway.

Below is a capture of the exposed commands of the Orvibo thermostat in Z2M:

exposure commands Orvibo ST30 in zigbee2mqtt

Note the name of the temperature entities for the rest of the tutorial, for me: sensor.thermostat_salon_cuisine_temperature.

for this chapter I was entirely inspired by the article written by Zigomato

start by putting in ha’s configuration.yaml file this line:

climate: !include_dir_merge_list climate/

Then reload the configuration and at the root of the files of home assistant creates:

  • a climate file
  • in the climate folder, create a generic_thermostat.yaml file

and paste the code below

- platform: generic_thermostat
  # Name of our thermostat
  name: Kitchen and Living Room Heater
  # inverted command heating entity
  heater: switch.salon_inverted
  # temperature sensor entity
  target_sensor: sensor.thermostat_salon_kitchen_temperature
  # the minimum adjustable temperature of the thermostat
  min_temp: 16
  # the maximum adjustable temperature of the thermostat
  max_temp: 21
  # operating mode of the "heater" system
  ac_mode: false
  # the target temperature
  target_temp: 18
  # this is the low temperature tolerance for the heater activation
  cold_tolerance: 1
  # temperature tolerance before the heater is activated
  hot_tolerance: 0.3
  # this is the mode in which the thermostat first starts
  initial_hvac_mode: "off"
  # temperature in case of absent mode
  away_temp: 12
  # This is the precision for the temperature setting
  accuracy: 0.5
  # the minimum time of an operating cycle
  min_cycle_duration:
    second: 5
  # maintains heating for at least 3 minutes if the thermostat does not receive a command
  keep_alive:
    minutes: 3

Customize it according to your needs, it is commented to make your task easier. Here you have a lot of modifying the files in ha I ** suggest a restart of the whole **.

Last step create a thermostat map in Lovelace. Nothing could be simpler, go to Lovelace and select the thermostat card, and select the entity created in my case “Kitchen and Living Room Heating”

Setting up generic thermostat in home assistant

Conclusion

Here is a ** complete tutorial ** on the integration of an electric heater in home assistant. It will allow you to control quite easily the Stop and Comfort order of the radiator, to correctly trace the information thanks to the inverted command and to control the whole with a generic_thermostat card in Lovelace.

The automation of heating in a house is very important, it will allow you to make significant energy savings.

Nico

Nico

Founding member of the Haade site, a home automation enthusiast with all the tricks that go well.

Comments