This post has two sections, one about gas prices and energy savings, the other about Android automation and the Netatmo API.
1. What a smart thermostat is like and how much money I saved
Last year, with gas prices going up, I decided to get smart radiator valves. I’d thought the saving from these would be by only heating rooms when I’m in them. I was lazy about going round and adjusting the manual radiator valves several times a day!
Having had them for over a year, I now think the saving comes from the thermostat being modulating. This means it adjusts the boiler strength continuously, so it works more efficiently (the old thermostat could only turn the boiler on or off).
My new heating also feels really good. The rooms have a more balanced and even temperature. I tried having the temperature rocket down to below 10°C in unused rooms at night, but it was less effective in both energy use and pleasure than keeping it at about 15°C as a minimum.
I’ve got the Netatmo thermostat. It’s great. I particularly like that it has some kind of eink-style powerless-when-not-changing LEDs, that show the current temperature all the time. Overall the hardware, fitting it myself, and the app are all quite good. The software is a bit ropey – no web application (still), and a major missing feature (see next section).
It saved me money! It’ll take 2.5 years to pay back the £480 total cost of the radiator thermostats. That’s if gas prices are as high as last winter, and not charging myself interest. Not too shabby. Have a look at the rough spreadsheet if you’re interested in details.
2. How to automate it to turn off when you go out
Unfortunately, one downside hit at the start of this year. Netatmo suspended their IFTTT integration. This means there is no official way to make the heating turn off when you go out, and turn on when you get back home. This is quite important for saving energy!
I’ve hacked together my own method, using my new Fairphone. It is very bespoke, and involves programming. However, in these days of AI coding assitants, maybe more people than ever can get this sort of thing working.
Netatmo’s API is fantastic, and can still set my thermostat to away / at home modes. So I did the following steps – you’ll need an Android phone:
- Wrote a Python script netatmo-fai.py which can, from the command line, set the mode on the thermostat. There are instructions in the script – you need to register an app as a developer at Netatmo, and make an initial token on their website.
- Installed the incredible Termux which is a Linux distribution that runs entirely inside an Android app, without root. Copied the script over (you can use git to do that) and got it working inside Android.
- Installed the power-user Tasker app and crucially Termux:Tasker which connects it to Termux. Tasker is a bit like iOS’s Shortcuts feature, only both more powerful and harder to configure.
- Set up a profile based on the “Wifi Connected” status. I called it “Home – Wifi”, and set it to run when connected to the SSID (name) of my home Wi-Fi network. I found using Wi-Fi events for this is very reliable, and doesn’t need a foreground notification window (see below).
- Create a “Tasker Function” task which runs the Python script with appropriate parameters to turn on the heating. Set the profile to execute that function.
- Create the opposite task which turns off the heating. Long press the profile and add an “Exit Task” to run it.
Now you can test it – by turning Wi-Fi on and off! Be aware that if your router breaks, your heating will turn off… If that isn’t suitable for your phone / Wi-Fi setup, it works well with a Location profile, you just can’t turn off the permanent notification.
Some secondary tips:
- Wrap the Python script in a shell script so you can log its output to a file. It’s hard to debug otherwise.
- Install Termux:API and then add error handling to the shell script so it triggers an Android notification when the Python script fails.
- “Wifi Connected” seems to work fine without the permanent Tasker notification. I turned off the Monitor notification for Tasker in the normal Android settings.
If you’re trying to get this to work, and have questions I might be able to answer, please leave a comment below!
Hope you have a warm and fulfilling winter.