DIY Wi-Fi thermostat from scratch with ESPHome and Home Assistant
olegtarasov.me
olegtarasov.me
This references a couple of OpenTherm project, so let's add the usual disclaimer:
The OpenTherm protocol is not open.
You can only find the spec for v2, they are now drafting v5. Yearly membership is about 3K if I remember correctly (without testing software, just for the spec).
There seems to be big difference in what you can do after v2, and it includes power delivery, maybe more fine grained control on heating curves and such (unclear, I don't have the spec)
Not all boilers support opentherm (but most should), and those who do don't support all features (but the most basic should always be present).
Otherwise, I completely agree that charging 3K for the spec is a stupid money grab. When the time comes to build a new house and choose a new boiler, my choice will be influenced by what protocols are available and whether I can control the boiler with my own thermostat.
Even for non home automation. Simple web API to turn gpio's on or off, coupled with some relays makes for a great easy yaml configurable industrial automation system
If you want to hear about the future of ESPHome, make sure to tune into the State of the Open Home next week: https://www.youtube.com/live/oa__fLArsFk
FWIW I still use Hive for boiler control but HA overrides that locally for fine control.
You’ve got quite a complicated system there. Some of the key design parameters are about getting balanced flow (proportional) rather than bang bang controllers so that you optimise the delta flow return and operate the heat source at lowest realistic flow return values for efficiency.
Is this them? https://www.heatgeek.com/
Originally there might have been an operator doing the adjustment daily, later mechanical automation, later electronic control.
https://web.archive.org/web/20240415040111/https://s3.filebi...
I've looked at doing something similar for my home system but the LOE + upkeep make me think the reward to work ratio isn't right.
That said I also know that I probably can't find anyone to help build the proper system at my house -- so its a situation where if I want it right I need to do it myself :'(
A lot of my stuff is set and forget. Home Assistant doesn’t need to be updated or monitored. As long as nothing talks to the internet, all I need is backups of the config and spare SD cards.
Doing this project from start to finish took me 2 or 3 months on and off, mostly during the weekends.
Doing it right yourself is the exact solution I arrived at myself :) I was shocked to discover how low the average technical level of local contractors is. I was super lucky to find a highly professional guy to overhaul the pipework, but anything more complicated I had to study on my own. Luckily, there is a ton of youtube videos, so the only thing you actually need is time.
It seems like this kind of think should be very doable in the industry but capability seems to be the big challenge.
Instead, I found something closer to what I’d do. The boiler has its own thermostat and control system. If home assistant goes down, everything is still in a safe state.
I have home assistant hooked up to a rather dumb “smart” thermostat. It’s just smart enough to be remotely controlled. I’d far rather use that than have a raspberry pi flipping relays.
1. My device interfaces with the boiler through optocouplers, so I don’t touch boiler circuits with my crappy engineering skills.
2. The boiler itself, as well as OpenTherm protocol, seem to be able to recover automatically from many failure modes. It doesn’t matter much if some frames are dropped or mangled, since full set of control signals is repeated every couple of seconds.
3. I rewrote critical parts of OpenTherm component for ESPHome to make code more resilient to failure. The whole firmware is designed in a way that incorrect values or broken frames don’t bring anything down catastrophically. I also made sure that boiler has its own maximum temperatures set to sensible values, so that incorrect signals from the thermostat will be discarded.
4. The device is designed to be completely self-contained and doesn’t rely on Home Assistant or Wi-Fi being up.
There are a couple of things that I plan on adding to this setup, like a Shelly relay on boiler power input to be able to do a hard restart remotely.
Ideally, I would also prefer not to McGyver a custom device, but unfortunately, there are no such dumb smart thermostats for my boiler that would allow remote control.