top of page

Smart heating system on a budget

The problem

we recently moved into a new apartment, and amongst many other problems one of them is the home heating system. the most frustrating thing about it is is that if we want to take a shower or wash the dishes, We have to preheat the water an hour before because the water has to run through the system and collect in a hot water collector.

previously I've automated my home heating with a relay, but the system is a little bit more complicated. but it's not just this heating system all of the wiring in this apartment is questionable, the main problem being that everything in this whole apartment is on a single breaker. but let's get back to the heating, the heating and hot water is done by the same boiler but the water flow is directed by a valve.

the valve receives a signal from the programmer which tells it which way to go, and here's where we get to the fun part of the project the programme our is also partially broken.

the input buttons on the programmer work sometimes in order to turn it on you have to press the button up to 30 times, technically you are able to program the programmer to prepare water for you you between certain hours but when I tried to program it the option keeps timing out because it wasn't receiving any inputs so I gave up and we settled for pressing the button to turn it on whenever we wanted hot water.

but that's not the end of the problem the programmer is hidden in a cupboard, the cupboard is blocked by our bins. so every time we want to heat up the water we have to move the bins open the cupboard spam the button as many times as it takes and then put the bins back,

all of those things made this problem Skyrocket to the top of my must automate list.

The solution

To start things off I took a a D1 Mini and a temperature sensor, connected the temperature sensor to the hot water collector and with some code from ESPhome I got the data into home assistant, and then just let the water get up to the maximum temperature.

it topped off at 53C and started dropping from there, and with that I set up another D1 mini in the bathroom with RGB LEDs to tell us when the water is ready to use. when it's off it's below 35 degrees when it's red it's above of and when it crosses 50 degrees the light turns green and we can shower, it's programmed with node-red in home assistant.

With this in place we can move onto the next stage, i'm going to use a Micro Servo Motor to push the buttons on the the programmer with a little 3D printed riser and a zip tie to keep it in place, and it worked better than I expected.

Now I need a way for home assistant to know that the setting is turned on, luckily the programmer has two little LEDs that only come on when the setting is on. because the D1 mini only has one analogue input, I had to use a ADS1115 which connects with I2C and gives me for analogue inputs. and again with a little bit of esphome Magic I got the data into home assistant, then I printed out a box to hold the photo resistors and attached it to the programmer with Blu-Tack, to prevent light leakage it shouldn't really be a problem because it's inside of a dark cupboard but better safe than sorry. the values drift a tiny amount the way I'm optimising for this is is anything below 100 is OFF and anything above 400 is ON

So now everything we need is inside of home assistant and we can set up an automation to turn on the heating, in node red I start off with a switch on my home assistant dashboard for example let's say we are turning the heating on. if the switch is on but the LED isn't it sends a signal to the servo motor to press the button go back to the zero position wait one second and loop until the light is on, and exactly the same to turn it off but we're waiting for the LED to turn off.

it looks a little something like this:

and it's exactly the same for turning on the hot water except the servo goes to a different angle, now with this I can add a lot more automations for example I have it set to turn off the water heater when the water collector is full. but I can even have it turn on the hot water when I leave work so that I can take a shower as soon as I come inside, I could also automate it to for example turn on the heating when I'm on my way home and the temperature outside is lower than 7 degrees.

To finish it off I soldered all the parts together I added connectors and pin headers for anything going off of the main board and 3D printed a case for it, I've had the system running for over a week now and it's been perfect very reliable.

  • SG90 Micro Servo Motor £2.40

  • ADS1115 Converter £5.60

  • D1 Mini NodeMcu £4.99

  • Old phone charger for power FREE

  • DS18B20 Temperature Sensor £3

  • Photoresistor X2 £0.25


  • PCB

  • wires

  • connectors

  • LEDs


D1 mini .yaml

  name: heater
  platform: ESP8266
  board: d1_mini

# Enable logging

# Enable Home Assistant API
    - service: control_servo2
        level: float
        - servo.write:
            id: my_servo2
            level: !lambda 'return level / 100.0;'

  ssid: !secret ssid
  password: !secret password


  - platform: status
    name: "Heater Sensor"


  - address: 0x48
  - platform: ads1115
    multiplexer: 'A0_GND'
    gain: 6.144
    name: "ADS1115 Channel A0 Hot water"
    update_interval: 2 s
  - platform: ads1115
    multiplexer: 'A1_GND'
    gain: 6.144
    name: "ADS1115 Channel A1 heating"
    update_interval: 2 s
  - platform: dallas
    address: 0xFA01202224CBCE28
    name: "bottom Temperature"
  - platform: dallas
    address: 0x50012022DC9D4128
    name: "Top Temperature"

  - id: my_servo2
    output: pwm_output

  - platform: esp8266_pwm
    id: pwm_output
    pin: D6
    frequency: 50 Hz

  - pin: D5
    update_interval: 30s


    name: Servo Control
    initial: 0
    min: -100
    max: 100
    step: 50
    mode: slider
    name: Servo Control2
    initial: 0
    min: -100
    max: 100
    step: 1
    mode: slider


- alias: Write Servo Value to ESP2
    platform: state
    entity_id: input_number.servo_control2
    - service: esphome.heater_control_servo2
        level: "{{ trigger.to_state.state | int }}"

Thank you for sticking around I'm off to work on another project so I'll catch you next time,

Have fun.

if you would prefer a video I've made one:


if you enjoy what I'm doing her please consider supporting me by buying me a coffee

181 views0 comments

Recent Posts

See All
bottom of page