Brink HRV OpenTherm Control via Home-Assistant

Introduction

Extending on my previous exploration of my Brink WTW/HRV I've built a small control system so that I can control the ventilation speed and monitor some of its sensors.

Arduino

Hardware

For the hardware I'm using the OpenTherm gateway shield from my previous post on this topic (available here: Tindie) with an Arduino Wemos D1 mini.

The shield in question already comes with excellent documentation so I'll just detail by pin hook up and a minor issue I've found.

Pin hookup ( I don't actually need the pins corresponding to the MASTER IN/OUT):

Wemos D1mini <-> OpenTherm shield
D2 <-> 2
D3 <-> 3
D4 <-> 4
D5 <-> 5
3v3 <-> 3v3
GND <-> 24V terminal - (ie, shield GND)

The only issue is that the Wemos fails to reboot while its ground is connected to the 24V terminal ground (and thus the Brink HRV voltage levels). This might be an isolation problem somewhere or an issue with the voltage levels of the Brink. Just decoupling the GND while rebooting fixes this, easy enough to do with a little hardware switch.

Software

The software uses 3 components, the sketch on the Arduino, the MQTT message broker and Home-Assistant. I won't get into the MQTT message broker (I use Mosquitto) or setting up Home-Assistant.

The Arduino sketch uses an OpenTherm library, MQTT and a WiFi library. The OpenTherm library in question is (https://github.com/ihormelnyk/opentherm_library)[https://github.com/ihormelnyk/opentherm_library], but with some changes to support HVAC/HRV systems (as per my fork and pr). This library works completely fine with the OpenTherm board despite not being developed for it.

I use various mqtt channels to publish the states of the sensors and the fan speed. The Arduino then also checks the command channel to see if the fan speeds needs to be changed. Roughly the pseudo code control loop is:

while True:
    get_and_publish_diagnostic_info()
    get_and_publish_temperature_data()

    current_speed = get_current_fan_speed()

    new_desired_speed = get_command_info()
    if new_desired_speed != current_speed:
        set_fanspeed()

Snafu

I initially tried to compile/flash my Wemos D1 using the VSCode Arduino integration, but something there is wrong with the pin control. It lights up the Rx led on the OpenTherm board and I cannot communicate with the HRV. Using the Arduino IDE it all goes well so its likely a compiler/flash config issue somewhere but I haven't looked up what the issue is. My VSCode arduino config (that doesn't work, maybe because I should have D1 Mini selected):

{
    "board": "esp8266:esp8266:d1",
    "configuration": "xtal=80,vt=flash,exception=legacy,ssl=all,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600",
    "programmer": "arduino:avrisp",
}

The Arduino config: LOLIN(WEMOS) D1 R2 & mini) with AVRISP mkII as the programmer.

Home Assistant integration

The main part of the Home Assistant integration is just having a bunch of MQTT sensors. These all look like variations on (WTW is the Dutch acronym for HRV):

 - platform: mqtt
    name: "WTW Exhaust Temperature"
    state_topic: "home/wtw/exhaust/in/temp"
    unit_of_measurement: "C"

For the fan speed control I use an input number slider:

input_number:
  wtw_speed:
    name: WTW Set Speed
    initial: 10
    min: 0
    max: 100
    step: 2
    icon: mdi:fan

In the Home Assistant GUI this then comes together as: alt text

Conclusion

Seeing as the speed control system has been running for about a year since my previous post about this system and has been very stable, I've been quite happy with this project. My main gripe is that I currently don't quite understand the bypass system and can't control it. Logging the data will hopefully give me some insights and then I can come back to this later.