Nicd

Nicd

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.

Most Liked

Nicd

Nicd

My Raspberry Pi that I used to host this app on just ate another memory card. So I decided to adapt it to an elixir-desktop app that I could run directly on the phone. Just ran it the first time: https://twitter.com/AmNicd/status/1563253296101756929

Thanks to @dominicletz for the awesome library. :heart: Now I need to clean it up and commit to git.

Nicd

Nicd

Some time ago, the Thermia Online API was changed and this broke GeoTherminator. The login API was changed from an easy one to a devil’s Azure B2C API. Since I had to fix the app anyway, I thought I might as well learn Gleam while I’m at it.

So GeoTherminator is now running as a mixed Gleam and Elixir application! I just got the first working build running on my phone. I guess elixir-desktop could be renamed beam-desktop now, @dominicletz. :wink:

You can still find the sources at Mikko Ahlroth / GeoTherminator · GitLab, but be warned, the Gleam code is quite undocumented and probably unidiomatic, as I’m a total newbie there. On the Elixir side, all I had to do was replace some structs with records and type up their defrecords to match the Gleam data types.

I plan to continue gleamifying the rest of the core code. Then I might take a stab at seeing how far into the Phoenix web stuff I could reach into with Gleam, but I can’t promise too much because I already have other things in the pipeline (and a long Steam backlog!).

If you have any questions, I’d be happy to hear them!

Nicd

Nicd

I’ve finally refactored the code a bit to ask for the user credentials instead of them being built into the APK. It also has CubDB for storing credentials and what view to restore the app to when it restarts (very dirty implementation).

Here it is deployed in the target environment:

Where Next?

Popular in Discussions Top

thojanssens1
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.: redirect "/", UserController, ...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
Ankhers
Just a little information upfront. Generally speaking, if I feel like I need to either break a pipe chain or use an anonymous function in...
New
rower687
Hi all, I’ve been reading a lot about the “let it crash” term and how supervising processes and the whole messaging passing make an elixi...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
PragTob
Hey everyone, this has been on my mind for some time and I’d love your input on it! TLDR: I feel like maps are superioer for storing and...
New
eteeselink
Hi all, In the last days, two things happened: A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
axelson
Decided against including more info in the title, but the gist is that Plataformatec sponsored projects will continue with the assets bei...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29603 241
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement