Heating Dashboard, Tecomat Scraping in Node.js, WiFi Thermometer on ESP8266, and More

2022-01-23 | 470 words

In our house, we have underfloor heating controlled by a Tecomat box, which opens and closes valves based on the temperature in each room and the set target temperature, allowing hot water to flow into each room separately.

A handyman created a web interface for us:

I bought a tablet for the kitchen, which is always on and displays this interface, but I wanted to create a dashboard that shows the floor plan of the house and the temperature in each room. Tecomat probably has some TecoAPI, since 2018.

Problem #1: API is not allowed

The handyman did not allow us to use TecoAPI, or did not create any user. No problem, we can connect remotely. He is on the other side of the country.

Problem #2: We don’t have a public IP

Until we get fiber optic internet in our village, we use LTE internet, and we don’t have a static IP. No problem, I’ll make an SSH tunnel through RaspberryPI aimed at Tecomat, and use the pitunnel.com service, which is my favorite service (and quite unique, although slow).

Problem #3: UDP

The handyman says he needs UDP, which pitunnel cannot handle. I don’t care, I’m not a network engineer to deal with such things.

Solution

1. Scrap it

Finally, a use for Raspberry! Although I constantly write on this blog about what can be done with Raspberry, I don’t actually use it.

So, with the help of Node.js and the Puppeteer package, I run headless Chromium, which logs into the web interface and reads the temperatures from the HTML after logging in. And even such information as whether the heating is on or not (it compares the CSS background image…)

Then, with the help of a cron Python script, I upload the resulting JSON to the web server (so I can view the temperatures from anywhere, without a public IP and without accessing Raspberry from outside).

2. What about the garage?

We don’t have heating there, so we don’t have a sensor. I closed my DIY shop on February 1, 2022, and I had a few components left - I made a temperature sensor with the help of NodeMCU and a temperature module. NodeMCU is a more powerful Arduino-compatible controller, has WiFi, and has a web server library available.

3. Frontend

I wrote an application in Vue3 on the web server, which periodically downloads JSON with temperatures and displays them in an SVG floor plan of the house, which I painstakingly created. The color of each room changes depending on the temperature in it. The outdoor temperature is also displayed, and if the room is being heated, a thermometer emoji is displayed.

Sources

You can find the source code on GitHub. I borrowed some code from my previous project, weather station, which you can also find on GitHub.