Expected Reading Time: 9 minutes

In times like these, when heating costs are skyrocketing, it is even more worthwhile to regulate your energy consumption. Not everyone lives in a perfectly insulated house and therefore needs to turn up the heating less often and less. Tado makes it possible with its smart radiator thermostats to regulate the temperature to the degree. If you also use the Tado Auto-Assist, you can save a lot of energy. It should be said in advance that this post is not paid advertising.

I have been using three Tado radiator thermostats for a little over a year now and am very satisfied. Especially in winter, I'm looking forward to coming home and not standing in a freezer while taking a shower. However, the whole thing always had a catch. Automated and "smart" ran the whole thing only with a Tado Auto-Assist subscription for € 24.99 a year or € 2.99 a year. Who still has an old Tado Bridge with V2, the subscription is free. All those who, like me, bought a starter package with a V3 Bridge afterwards, look down the tube.

With a price of €170 for the bridge and three thermostats, that's not exactly pleasing, since the purchase is already not that cheap and you have to save at least €26 per year in heating costs through the subscription and the Auto-Assist to get any benefit at all. There are definitely cheaper alternatives, but Tado appealed to me the most visually and the geofencing functionality makes a big difference. The same goes for the window-open detection, which works without additional sensors on the windows. Accordingly, it would be nice to be able to use the whole thing for free, right?

What does geofencing mean?

Tado itself describes it as follows:

When Geofencing for a block of time in your Smart Schedule activates the settings of this block will only be active if your home is in the Home mode is.

When Geofencing disabled is the time block regardless of the location of the home members and regardless of whether tado° is in the Home or Away mode is active.

Tado support page - What does the geofencing switch do for a time block in the smart schedule?

Depending on the location of all Tado users in a household, the heating is switched on or off, for example. The criteria for this and how warm it should be, for example, can be configured individually.

The problem

Now we are back to the initial problem. But this only works with the Auto-Assist subscription. Or maybe not? Through the API of Tado it is possible to read the status of your home. If you do not have a subscription, the Tado app sends notifications to alert you about the status.

For example, no one is at home and a notification is sent from the Tado app with the question and possibility to switch from HOME mode to AWAY mode and thus possibly turn off all heaters. However, since this does not happen automatically and you are not constantly looking at your phone, it is quite possible that you miss out on these savings. This is annoying for the environment and the wallet.

The same scheme as described for geofencing applies to window open detection. Notifications are sent, but this is far from full automation.

Requirements in the Tado App

In order to be able to use the Tado Auto-Assist at all, you have to activate some settings. These can be seen in the pictures. On the one hand, you have to activate the window open detection for all desired rooms and on the other hand, the location-based control on the devices of each Tado user. For example, if only one user has activated this function, only his location will be taken into account.

Tado App Settings Window Open Detection
Tado App Settings Location-based control

YouTube video implementation

Solution for a free Tado Auto-Assist

The Tado community naturally also includes developers who have not let themselves be deprived of the opportunity to use the API for their own purposes and to prevent a subscription obligation.

How is the whole thing implemented?

With the help of a Python module called pyTado programmed from Chris Jewell the foundation stone has been laid. And that already in 2016 or until the last update in 2019. He describes the module as follows:

PyTado is a Python module that implements an interface to the Tado web API. It allows the user to interact with their Tado heating system to monitor or control their heating system, which goes beyond what Tado itself currently offers.

With this, all data can now be read from the Tado API. This means that we have complete information about everything related to our system. But now the whole thing had to be implemented in such a way that the functionalities used by the Auto-Assist are integrated.

For this implementation, the GitHub user adrianslabu (Adrian Slabu) is responsible. In his GitHub repository he used the pyTado module to replicate the functions of the Auto-Assist. And it really works flawlessly. I don't want to go into more detail about the technical implementation, as that would go beyond the scope. For that you can have a look at the source code in his repository.

On which platforms can I run the solution?

Basically, with the Python script, it is possible to run it anywhere Python can be installed. For someone like me, who likes to have everything in Docker as a container, this was not a solution and too much effort to run it on my server with Python.

Accordingly, I looked to see if and how the whole thing can be made available as a Docker image. Based on the python:alpine image, the script is added. In addition, we need of course the mentioned pyTado module. So that we can variably set username and password for our Tado account, two more environment variables are set, which are picked up again in the slightly customized script. Finally, the script is only started via CMD command in the Dockerfile.

This Docker Image solution makes it possible to run the script on almost any device. Especially single board computers (SBC) like a RaspberryPi or ODROID or any other low power device are perfect to keep the script running continuously.

Currently the Docker image for linux/amd64, linux/arm/v7 and linux/arm64 available. If there is a need for another platform, please post in the comments. You can find the Docker image in the Docker Hub registry. I take care to keep the image up to date and to react quickly in case of changes.

Docker implementation

Link to Docker Hub repository: saschabrockel/tado_aa

To start the container now you can either use the command docker run or use a compose file. The container logs the data just like the original script and you can check what exactly happened or happened. By the way, you don't get notifications on your smartphone anymore, because the script already reacts automatically to changes and a reminder is not necessary anymore.

Docker Run Script:

docker run --name tado_aa --restart always -e USERNAME=YOURUSERNAME -e PASSWORD=YOURPASSWORD saschabrockel/tado_aa:latest

Docker Compose:

version: "3"
services:
  tado_aa:
    restart: always
    container_name: tado_aa
    image: saschabrockel/tado_aa:latest
    environment:
      - USERNAME=YOURUSERNAME
      - PASSWORD=YOURPASSWORD

Of course, you can also use the Compose file in Portainer as its own stack. If everything works, you should see logs that look like this:

19-08-2022 00:29:41 # Galaxy-S21 is at home, activating HOME mode.
19-08-2022 00:29:41 # Done!
19-08-2022 00:29:41 # Waiting for a change in devices location or for an open window...
19-08-2022 05:00:54 # Your home is in HOME mode, the device Galaxy-S21 is at home.
19-08-2022 05:00:54 # Waiting for a change in devices location or for an open window...
20-08-2022 07:29:41 # Your home is in HOME Mode, the device Galaxy-S21 is at home.
20-08-2022 07:29:41 # Waiting for a change in devices location or for an open window...
21-08-2022 15:13:21 # Are no devices at home, activating AWAY mode.
21-08-2022 15:13:21 # Done!
21-08-2022 15:13:21 # Waiting for a change in devices location or for an open window...
21-08-2022 21:22:28 # Galaxy-S21 is at home, activating HOME mode.
21-08-2022 21:22:28 # Done!
21-08-2022 21:22:28 # Waiting for a change in devices location or for an open window...
22-08-2022 01:26:35 # Bathroom: open window detected, activating the OpenWindow mode.
22-08-2022 01:26:35 # Done!
22-08-2022 01:26:35 # Waiting for a change in devices location or for an open window...

Conclusion

It is now very easy for the end user to use Tado Auto-Assist free of charge. This applies to both geofencing and window open detection. The only requirements are a device that runs around the clock and supports Docker. Even a Synology NAS can be used for this purpose.

I hope this free alternative to the expensive subscription will help you reduce your heating costs in the coming winters. If you have any questions or comments, feel free to post a comment.

Sascha Brockel

Interested, but lack time or knowledge?

No problem. Contact me and we will discuss your requirements. No matter if business or private.


34 Comments

Joachim · 7. October 2022 at 08:28

Hello Sascha,
great. With your Docker image, this is now running on my Synology DS 920plus.
However, I have a question. Do you know where I can set the time for Docker. In my log it says 08:13:56 for time and in the log column it says 07.10.2022 06:13:56 # DONE!

So thank you for this great post.

Greetings and have a nice day

Joachim

    Sascha Brockel · 7. October 2022 at 15:29

    You have to add the following to the "environment:": TZ=Europe/Berlin
    So then like this:
    [email protected]
    PASSWORD=password
    TZ=Europe/Berlin

    TZ here stands for Timezone and I'm assuming you're from Germany 🙂

Benjamin · 21. October 2022 at 11:56

How can I use the whole thing with a Synology NAS? And how does the automation work?

    Benjamin · 21. October 2022 at 12:34

    Okay, I really could have saved myself the trouble of asking that. This is really foolproof. I simply installed Docker on the NAS in the Synology package center and searched there under Image for tado_aa. Once your Docker image is added just fill in USERNAME and PASSWORD (also added TZ as in the answer above). Once the process is started the automation runs all by itself and the geofancing and window open setting is executed. Thanks that thanks to you this bad habit of Tado for the service to ask extra money has an end!

      Sascha · 21. November 2022 at 16:21

      Since yesterday, the page auth.tado.com needed for login seems to be unreachable. Is there another way to connect?

        Sascha Brockel · 21. November 2022 at 16:42

        Hey,

        I have just updated the Docker image. Maybe that helps. Everything works fine for me. Once times docker compose -f docker-compose-tado.yml pull. So just as an example. Stop container, pop new image and start container again. Feel free to give feedback.

Benjamin · 21. October 2022 at 12:35

This is really foolproof. Just installed Docker on the NAS in the Synology package center and searched for tado_aa under Image. Once your Docker image is added just fill in USERNAME and PASSWORD (also added TZ as in the answer above). Once the process is started the automation runs all by itself and the geofancing and window open setting is executed. Thanks that thanks to you this bad habit of Tado for the service to ask extra money has an end!

Marc Hagemann · 29. October 2022 at 14:26

Is there a tutorial somewhere (foolproof) to get this working on a Raspberry Pi 2b. I still have one unused. But I am not an expert Linux

    Sascha Brockel · 29. October 2022 at 17:29

    Of course, the RPI2b is already a bone. But as long as it can run Docker or a Python script, that's possible. This is already a special case somewhere. Unfortunately, it can only be done perfectly foolproof for a very specific example. Say you may have to flash an image on which you can also install Docker and if that is done, then this tutorial is enough. I always think something like a Docker installation from me would be superfluous, since there are umpteen other sources that explain it, but it would probably sometimes be better to write another article about it and link it here. I'll take a look when I get a chance.

      Marc Hagemann · 3. November 2022 at 07:46

      Now everything worked with a Raspberry Pi 2b. Installed Docker incl. Portainer and created the stack according to your instructions. Contrary to the instructions in your Youtube video, I had to configure username and password not in the advanced settings, but as in your example above, directly in the main stack. Otherwise I always got the message that the credentials were wrong.

Danny · 9. November 2022 at 17:23

Hello Sascha,

I get the following error on the Raspberry after I execute the first command
docker run -name tado_aa -restart always -e USERNAME=YOURUSERNAME -e PASSWORD=YOURPASSWORD saschabrockel/tado_aa:latest

Error:
Traceback (most recent call last):
File "/app/tado_aa.py", line 10, in
import logging
File "/usr/local/lib/python3.10/logging/__init__.py", line 57, in
_startTime = time.time()
PermissionError: [Errno 1] Operation not permitted

Can you help there?
Thank you

Thomas Krajcsy · 17. November 2022 at 12:53

Hi Sascha, thanks in advance for the ingenious Docker solution.
I have a tado app question: how to turn on Auto-Assist in de app without signing up for a plan (paid) ... does tado really want to collect 2,99€ per month from each family member? Once I turned on Auto-Assist by taking 1 week free plan ... and then cancelled in time.
Thank you,
Thomas

    Sascha Brockel · 18. November 2022 at 07:12

    Hello Thomas, this may be a little misleadingly worded. Namely, it is the case that the Auto-Assist in the app still remains set to "Inactive". But that doesn't matter, since the Docker container is effectively the Auto-Assist. Just self-hosted. So you can safely leave everything on Inactive there. Many greetings.

      Sascha Brockel · 19. November 2022 at 17:12

      I have to correct myself. Tado seems to have changed something. For me, it no longer works as it should. But I did not notice, because I was not there. Anyway, I get notifications. In the logs of the Docker container everything still looks good. But there was also an update of the script. I will bring it to Docker as soon as possible as well. Then you have to stop or completely shut down the container once and then start or pull it again to get the latest version.

Thomas · 17. November 2022 at 15:52

Hello Sascha, first of all THANK YOU for the ingenious Docker solution and the really understandable instructions for installation. I have a tado installation running at home, but with a V2 run. My brother in law has now also bought tado, but with V3 ... therefore your solution 😉
Unfortunately, I now have the following problem: How can you enablen the Auto-Assist on the iPhone in the tado APP, without having to opt for a paid plan? My brother-in-law has done this, with this 7-day trial version, which he canceled in time again, so we could try the "self-hosting" only after 7 days - that works so far, but are now facing the problem that his wife can not activate Auto-Assist in the same household. Does this mean that tado requires each household resident this 2.99€, ie for a 4 person household 12€ / month?! Or is there something wrong? Is there a way to activate Auto-Assist without a plan? Does every household resident have to buy a plan and then cancel it right away in order for the APP to activate Auto-Assist? We have now tested the situation so that the cell phone controls the scene without Auto-Assist. SMSs continue to come?! -> If you turn off or log off the phone without AA, everything works as you described.
Do you have an idea?
THANKS in advance!
Thomas

    Sascha Brockel · 21. November 2022 at 16:50

    I also noticed that Tado has adjusted something there. You can probably skip that part now. The logs for me say that it still works. I had it but actually also that the notifications still came to the phone. I just updated the Docker image though. Maybe that will change something. So the auto-assist may safely stay on inactive. So no worries. Nothing with paying. I think you meant with SMS the notifications. That with the trial version was in any case unfortunately not correct. But this is all new now. Update the Docker image to the latest version. You can do that for example with docker compose -f docker-compose-tado.yml pull docker. Here, docker-compose-tado.yml stands for the name of your compose file. See how it behaves after the update. Feel free to comment again.

    Many greetings

Torben · 3. December 2022 at 19:01

Hello Sascha,

first of all, thank you for the detailed instructions. Unfortunately, I can not get it to run. I have to admit that I am a complete newbie in this field. I have a Raspberry Pi Zero 2W on which I installed Docker & Portainer, but I can't create a stack there. I always get the meaningless error "portainer failed to deploy stack" without any details.

When I run the run script the container is shown in portainer, but nothing is controlled at Tado and I don't get any info in the container log.
When running the command, I also get the following warning:
WARNING: The requested image's platform (linux/arm/v7) does not match the detected host platform (linux/arm/v6) and no specific platform was requested

Could it be because the pi only runs arm/v6?

Thank you very much for your help,

Torben

    Sascha Brockel · 4. December 2022 at 00:25

    Hello Torben, you have recognized that correctly. But I took care of it directly. I thought there are hardly any devices left in use that use arm/v6. Try it again now. The image with the latest tag now also contains the image for the platform arm/v6, i.e. for you. In Portainer just delete container and image again and then start compose again. Many greetings

      Torben · 4. December 2022 at 13:39

      Hello Sascha,

      wonderful, thank you for your quick help! It works

      Just to understand, I only got it to run with the Docker Run script. I still could not create a stack. I get the hint about arm/v6 also with the portainer installation. I think it is because of this? I have installed an older Portainer version as a test. I still get the arm/v6 message, but at least the error message during stack deploy contains more information (problem with version "3")? What is the advantage of creating a stack? It works the same way via the run script?

      Thanks for your quick help :)!

      Greeting,
      Torben

        Sascha Brockel · 5. December 2022 at 12:11

        Ah okay, then Portainer is probably no longer designed for the old architecture. But that doesn't matter either. The stack and Portainer would just be the advantage that you can manage everything directly from a user interface and don't have to log into the server and mess around with command lines. So everything fits as you made it. Many greetings

        Victor · 20. December 2022 at 12:37

        Hello,
        Thank you for the script. It is working very nice in Synology NAS using docker. Only two questions..

        1) I have detected in the logs... it creates an entry when a window open is detected and active "OpenWindow mode"... but when the window is close and the valve is again active... in the logs is not reflected in any way... this is normal? It is possible to modify it to add log entries when the valve is again active?

        2) It is possible to modify the time of checks, for example to determine the amount of seconds to check if a window is open or not and the same for geofecing?

        Thank you

          Sascha Brockel · 22. December 2022 at 02:37

          Hey there. Yes, it is true that there are no logs about it when OpenWindows Mode is disabled. The way I see it, the whole thing can't be logged that easily. You would have to tell me if after an open window is detected, "Done!" is logged directly or later when you close the window. Otherwise "Done!" would be the indicator, but I think it only says that something was done after the API call.

          As for the check interval, I can help though. The interval is set to 10 seconds by default. I guess that should be enough for you. I can also make the value settable through the Docker variables, but I think a value lower than 10 seconds has no advantages.

Kry · 28. December 2022 at 14:53

Hi, is it possible to leave only the open window detection active and deactivate the geofencing?

    Sascha Brockel · 28. December 2022 at 15:26

    Hey, currently it is not possible. But I'm pretty sure it is possible to adjust the script with a condition to make it work.

Strahil Nikolov · 30. December 2022 at 22:06

Hey Sasha,

I recently got V3 and the docker image sounds great.
Have you tried running it in Kubernets or Openshift ?

I doubt there will be any problems, but it's worth asking.

    Sascha Brockel · 30. December 2022 at 23:44

    Sorry, I have never tried anything other than Docker with this image.

Strahil Nikolov · 30. December 2022 at 23:32

I tried to run the container in Openshift and it seems to be running, but it can't write to the log .
Usually all logs should go to Docker/Podman/K8S/Openshift. Maybe you should disable the log file by default ?

Also, you might consider changing the path to pwd or /var/log as it doesn't make sense to log to /l.log

    Sascha Brockel · 30. December 2022 at 23:43

    Hi, I never worked with OpenShift. I agree with you about the log path. I just made the script available for Docker and didn't adjust much else. That is also the reason for the path. My intention was just to get it running as an image as well and no enhancements.

      Strahil Nikolov · 1. January 2023 at 01:34

      Based on the current situation, I guess that the only features we miss are 'Preheat Before Arrival' and 'Energy IQ', right ?

        Sascha Brockel · 1. January 2023 at 23:35

        I guess you are right. You can still influence Preheat Before Arrival by changing the radius of the location-based control/geofencing of your home area.

Strahil Nikolov · 2. January 2023 at 00:43

Hi Sasha,

I have created a little repo that is suitable for S2I deployment of the script at https://github.com/hunter86bg/tado_aa
Of course, even an UBI9 pod should do the job.The benefit is that if the base builder image changes (and it eventually will be updated) - the build process can be triggered to update the pod.

In my case I'm also using a web hook to notify OKD to trigger a new build , which will automate the whole processes when a patch is created.

If I have some time, I will try to create some DockerFiles for Alpine and UBI9.

Strahil Nikolov · 16. January 2023 at 06:28

Updated the tado script a little bit more (it responds to http request for healtchecking) and I even managed to setup Google Cloud Build & Cloud Run.
Theoretically the Cloud Run free tier should be enough to host the solution without incurring charges. I will provide more details if everything goes as expected.

    Tom · 21. January 2023 at 16:08

    The tado script works perfect. And it is very interesting to to see the further development of running the script with cloud run.

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

en_US