Control my geothermal heat pump

Posted by Marcus Folkesson on Thursday, December 19, 2024

Control my geothermal heat pump

The electicity price in Sweden varies a lot during the day. It's usually cheapest during the night and most expensive during the day, but not always.

One day a week ago, it was not much wind in Germany and therefore we exported electricity there which resulted in very high prices here in Sweden. 1 kWh cost over 10 SEK (almost 1 USD per kWh) for a few hours, this excluding transmission fees and taxes. The normal price is around 1 SEK per kWh at most.

/media/heatpump-1.jpg

During the winter, most of the power consumption goes to heat up the house. I have a 10 years old Thermia Diplomat G3 gethermal heat pump. It serves its purpose very well, but it is not connected to the internet and I can't control it in a smart way. I can only set a temperature and the heat pump will try to keep that temperature. Therefor I have been thinking about how to control it in a smarter way.

/media/heatpump-2.png

Due to my general time constraints, I decided to find a good balance between the time invested and the result. I found the ThermIQ [1] which is a board you connect to the EXT connector on the heat pump. It will then connect the WiFi and send and receive data via MQTT.

/media/heatpump-3.jpg

It would of course be more fun to build something like this myself, but I have to prioritize my time and this was a good solution for me.

Wifi

Talking aout WiFi..

The heat pump is located in the laundry which is in a separate building and the wifi signal is not strong enough to reach it. I have a Ubiquiti Unifi network with several Unifi APs. I used to be satisfied with those, but after some firmware update they just sucks. The mesh network does not work anymore, they have started to use signed firmwares for the newer models and the overall feeling is not that positive anymore, so I decided to flash them with OpenWRT.

/media/heatpump-4.png

The board has an exposed UART (cred to Ubiquiti) after you have loosen a few screws.

/media/heatpump-5.png

I connected the UART to my computer and booted the AP.

/media/heatpump-6.png

The guide [2] to flash it with OpenWRT was very good and I had no problems with it at all.

/media/heatpump-7.png

Once flashed, I connected the AP to my network and configured it to extend my WiFi network. Finally good WiFi signal in the laundry.

/media/heatpump-8.png

ThermIQ

The first time the ThermIQ is powered up, it will create a WiFi network you connect to and configure it to connect to your WiFi network. You can then configure it to connect to your MQTT broker and you are done.

/media/heatpump-9.jpg

Open up the heat pump and install the ThermIQ board to the EXT connector. It will immediatly connect to the heat pump and start to send data to the MQTT broker.

/media/heatpump-10.jpg

It has a long list of controllable settings that are exposed via MQTT:

/media/heatpump-11.png /media/heatpump-12.png

Some of them are read-only, but most of them are read-write.

Logging and control

My friend who is responsible for all kind of logging in this house has written a small script that logs the data from the heat pump to InfluxDB and Grafana. I can now see the temperature in the house, the temperature of the heat pumpand the current state of the heat pump.

/media/heatpump-13.png

I use Node-RED to control the heat pump. So now I will create a simple flow that will set the temperature of the heat pump to a lower value when the electricity price is high and a higher value when the electricity price is low. I will also that the heat pump should turn off when the electricity price is very high.

Tibber has a very good API that I can use to get the current electricity price.

/media/heatpump-14.png

The result

I have now a heat pump that I can control in a smart way. I can see the current state of the heat pump and I can control it via Node-RED. I can also see the current electricity price and set the temperature of the heat pump based on that.

The final control flow is not yet finished, but It least I have the data and the control in place. Now it is only a matter of time before I have a working solution - as it always is.