GeoTherminator, remote UI for Thermia geothermal heat pumps

We have geothermal heating at home, using a Thermia Calibra 7 pump. The pump has an online feature, but the UI is not really optimal for seeing the status of several sensors at a glance. So at my company’s hacking weekend this year, I decided to write such a UI. It’s very rough around the edges (of which there are many) and very minimal, but I had such fun making it that I wanted to share it.

The code is at Mikko Ahlroth / GeoTherminator · GitLab. It uses Phoenix LiveView to basically render a big SVG (that I drew in diagrams.net) and live update it with the new data. It also has two friendly buttons for changing the target room temperature (which are slow as molasses due to the online service being slow to access the pump). The UI is very “engineer”, I’m no designer. :003: Here’s an example:

I have it running on a Raspberry Pi at home, with an old phone serving as the display:

(Not final placement, just some prototyping.)

The Thermia online service has no public APIs that I know of, so I reverse engineered the HTTP calls sent by the browser. Sadly that also means the app requires a username/password pair to grab the authentication token. I could refactor it to only ask for the username/password on startup via the UI and not store it anywhere, but that’s something for the future as I don’t mind it myself.

In the future I might add some informative graphs, but that would require getting a bigger display. If I can score a small HDMI display somewhere, I can run it directly off the Raspberry without having a phone in the middle.

Disclaimer

Your pump and home are at risk! Do not trust anyone with your account username and password. If you do not understand all the code contained in this software, do not use it. If you do not understand how to compile and deploy Elixir projects, do not use this. Honestly, just use the online service. That way you can’t break your pump and void your warranty.

8 Likes

Oh, an interesting thing I bumped into while writing it. The Mojito HTTP client would add a transfer-encoding: chunked header to the request behind the scenes. This made the Thermia API barf a 502 error for everything except the login endpoint. Really took me a long time to find out as I couldn’t see that header by inspecting my request, I had to install mitmproxy to debug what was going over the wire (now thinking back, I could have probably IEx.Pry’d it somehow?).

In the end I switched to Finch which didn’t send that header and everything started working again. :man_shrugging:

1 Like

This is very cool Mikko! Tho I am not sure what is cooler, that you did this in Elixir or that you have geothermal heating :003: Bravo on both counts :023:

1 Like

Geothermal heating is more and more popular here because it uses a lot less electricity than resistive electric heating and you’re not tied to the district heating network.

It’s good to note that it’s not the kind of geothermal where heat just bubbles out of the ground and comes from the Earth’s core like in Iceland. Here you would have to go kilometers deep to get that. Our thermal well is 140 meters deep and it’s instead the sun’s heat that is absorbed into the ground during the summer that is then used with the pump during winter. So it’s essentially indirect solar energy. I guess sometimes it’s called ground heating?

1 Like

nice one!

you could even try to run everything on the android using elixir-desktop · GitHub

2 Likes

Agree on that, really cool.
Reminds me of the biggest heat pump fan in youtube

1 Like