Where should I start…, Oke my problem…
Since the beginning of my HA “Era” I’ve been looking for a smart thermostat. Let’s face it, nobody wants to get up to turn the thermostat to get your house heated. This needs to be done by our automation software. At this moment I got that standard thermostat which I need to turn left or right to make it warm or cold.
So…. I started my search for a smart thermostat, but everything had a dead end. First, I found the Nest. However, after some reading I found out its not running anymore on HA. Furthermore, I had found some other smart thermostats but had a dead end as well. So I thought to myself, why not look into the technical specification of my central heating unit (CHU) and see if I can fabricate something myself.
That’s what I did and I got it working. I got a very simple ESP code running, together with a relay that is using the preprogrammed program for use of an “On/Off” thermostat on my CHU. The relay here is functioning as this “On/Off” thermostat. Up to now it’s functioning perfectly. It still needs some improvements, which I want to update throughout time. And if somebody got other ideas, please feel free to contribute and I will see if I can implement it.
Prerequisites for this project
- On/Off terminals on your CHU (pre-programmed)
- If you got the above terminals, then your next prerequisite is that you can read electrical schematics and know how to connect those.
- Some knowhow of electrics.
- Reading skills to follow this project.
- The fun factor, to enjoy this automation project.
Improvements that I want to implement throughout time:
- Deriving power from the Central heating. I have 24V on the terminals, but its delivering to much current. I ordered a converter now and will see if that works. The issue I got now is that it delivers to much current. For now i use a power adapter
- Improving my heating with more automations
WARNING: Before starting this project, know how your home electrics work. You need to have some knowhow with electrics and high voltage (220V) as this project is going to use the live wire and ground of your home. If you are in doubt about your central heating or electrical wires, please contact your local expert.
Part list
QTY | Description | Costs |
---|---|---|
1x | Adapter | €3,1 |
1x | ESP8266 Node MCu V3 | €2,56 |
1x | 5v Relay-Module | €0,56 |
Total | €6,22 |
These are the main parts you need, thereby you need the standard parts such as breadboard wires or crocodile wires for testing. Power wires (Blue, Brown) and a power supply for testing.
I got a small led light on the ESP to see if it has any errors (Status LED). You could choose to leave this away.
Step 1
Install the ESP home Integration trough Hasss.IO in your HA
Step 2:
Upload the below ESP code trough ESP Home and upload it to your ESP chip.
esphome:
name: smartthermostat
platform: ESP8266
board: nodemcu
wifi:
ssid: !secret wifissid
password: !secret wifipassword
# Enable logging
logger:
# Enable Home Assistant API
api:
status_led:
pin: D6
sensor:
- platform: wifi_signal
name: "WiFi Signal smartthermostat"
update_interval: 60s
- platform: uptime
name: Uptime Smartthermostat
binary_sensor:
- platform: status
name: "ESP Smartthermostat Status"
ota:
switch:
- platform: gpio
pin: D2
name: smartthermostatrelay
Step 3:
Now for the real work wire the parts according the below photographs. You can do some testing before hooking it up to your central heating. Take a light bulb and hook this up to your relay (including 220V) it works if its switching on and off.
D2 goes to your relay’s signal. And the + and - goes to a 3V and ground connection.
Step 4:
Integrate the ESP chip trough integrations, following the below guide
Now into your integrations you should see some sensors popping up. If not redo this step and see if you missed something (typo’s or something)
Step 5:
Before connecting anything to your central heating, take the power plug out. Read the electrical voltage with a multimeter to double check if there’s no hidden UPS plugged in. Then find the correct terminal pins and connect the wires coming from your relay. I got a remeha 28C . For me they were on terminal 3 & 4. My normal thermostat is connected on terminal 1 & 2 but these are a Modbus connection.
Reconnect your power supply to your central heating and test the switch on your HA frontend. Now your Central heating should go on/off. If its not working, please check if you connected everything correctly. If everything else failed you probably don’t the preprogrammed On/Off terminals.
Step 6:
Get the generic thermostat working with HA. Use your switch from the ESP home
Example code:
climate:
- platform: generic_thermostat
name: Woonkamer
heater: switch.smartthermostatrelay_2
target_sensor: sensor.temperature_158d00033b796b
min_temp: 15
max_temp: 24
target_temp: 16
cold_tolerance: 0.5
hot_tolerance: 0.5
min_cycle_duration:
minutes: 5
initial_hvac_mode: "off"
away_temp: 16
precision: 1.0
Step 7:
Add your thermostat to your Lovelace view. And enjoy your cheap dumb smart thermostat. I will upload my config later as i am re-doing my complete lovelace view.
If there are any questions please feel free to ask. I will try to help you as much as i can. If i’m missing any information. Also please comment so i can try to keep it updated.
Good morning, and in case I don’t see ya: Good afternoon, good evening, and good night!