Giter Site home page Giter Site logo

tado_aa's Introduction

tado_aa (Tado Auto-Assist for Geofencing and Open Window Detection + Temperature limit)

A python script that automatically adjusts the temperature in your home upon leaving or arriving based on your settings from the tado app. It also automatically switches off the heating (activating Open Window Mode) in the room where the tado TRV detects an open window. In addition, it offers the possibility to configure the minimum and maximum temperature allowed.

Prerequisites

  • Python 3
  • PyTado: This script relies on PyTado. Install it using: pip3 install python-tado

This script was made possible because of PyTado's author, Chris Jewell ([email protected]), and the person who modified it, Wolfgang Malgadey ([email protected]).

Installation

To install and start the Tado Auto-Assist Service, follow these steps:

  1. Clone the repository using git (to check if it's installed run sudo apt install git, in case it isn't it will ask if you want to install it, press y to confirm):

    • git clone https://github.com/adrianslabu/tado_aa
  2. Navigate to the cloned directory:

    • cd tado_aa
  3. Edit tado_aa.py using a text editor, in this exemple I will use nano (to check if it's installed run sudo apt install nano, in case it isn't it will ask if you want to install it, press y to confirm.):

    • nano tado_aa.py
    • use arrows to navigate to the desired line and change username and password with your Tado username and password
    • press Ctrl + x simultaneously, don't change the file name, now just press enter to save it
  4. Run the installation script (in case of error run sudo chmod +x install.sh and retry):

    • ./install.sh

This will set up the service to run automatically and start it immediately.

If you want to thank me

Paypal / Buymeacoffee

tado_aa's People

Contributors

adrianslabu avatar laikash avatar s1lviu avatar sbomsdorf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tado_aa's Issues

Hot Water zone won't have a Celsius setting

I've found I need to turn off the Temp Limit feature. I was seeing errors in the logs, which were resulting in the script then failing to detect changes to home / away status as it should. The error was presenting as "I cannot get the location of one of the devices because the Geofencing is off or the user signed out from tado app", but that was only because the actual error message contained the string "NoneType".

Adding some more debug lines, it became clear that the problem line was in fact this one (line 162)

setTemp = t.get_state(zoneID)['setting']['temperature']['celsius']

So I did a printm on the repr of t.get_state(zoneID) to find out what depth of that array was failing:

{'tadoMode': 'AWAY', 'geolocationOverride': False, 'geolocationOverrideDisableTime': None, 'preparation': None, 'setting': {'type': 'HOT_WATER', 'power': 'ON', 'temperature': None}, 'overlayType': 'MANUAL', 'overlay': {'type': 'MANUAL', 'setting': {'type': 'HOT_WATER', 'power': 'ON', 'temperature': None}, 'termination': {'type': 'TIMER', 'typeSkillBasedApp': 'NEXT_TIME_BLOCK', 'durationInSeconds': 1800, 'expiry': '2024-03-15T22:00:00Z', 'remainingTimeInSeconds': 15188, 'projectedExpiry': '2024-03-15T22:00:00Z'}}, 'openWindow': None, 'nextScheduleChange': None, 'nextTimeBlock': {'start': '2024-03-15T22:00:00.000Z'}, 'link': {'state': 'ONLINE'}, 'activityDataPoints': {}, 'sensorDataPoints': {}, 'terminationCondition': {'type': 'TIMER', 'durationInSeconds': 3600}}

It's checking the hot water, and in my case, the "setting" value contains "None" as its temperature, rather than being a further array with a "celsius" entry.

I'm not familiar enough (read: "at all") with the Tado API to know what change to propose to fix this, where that fix will be as robust as possible. Maybe it's sufficient to check that setting type is not "HOT_WATER".

Thanks

Not working anymore?

The script seems to connect and authenticate successfully.
Return code 200

But it seems not to do the automations anymore. Anybody else experiencing this or is this only with my and my friends account?

Headers: {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Referer': 'https://app.tado.com/', 'Content-Length': '2'} Response: StatusCode: 200 Data: {<MASKED>, 'token_type': 'bearer', <MASKED>, 'expires_in': 599, 'scope': 'home.user', 'jti': '01526531-8f9d-4d5e-8ccf-f15b17608c4a'} PyTado.http.http :: DEBUG :: Request: Method:POST URL: https://auth.tado.com/oauth/token<MASKED> Headers: {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Referer': 'https://app.tado.com/', 'Content-Length': '2'} Response: StatusCode: 200 Data: {<MASKED>, 'token_type': 'bearer', <MASKED>, 'expires_in': 599, 'scope': 'home.user', 'jti': 'fc32f452-9557-4be7-955c-3dc44cbba8e8'} PyTado.http.http :: DEBUG :: Request: Method:POST URL: https://auth.tado.com/oauth/token<MASKED> Headers: {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Referer': 'https://app.tado.com/', 'Content-Length': '2'} Response: StatusCode: 200 Data: {<MASKED>, 'token_type': 'bearer', <MASKED>, 'expires_in': 599, 'scope': 'home.user', 'jti': '01526531-8f9d-4d5e-8ccf-f15b17608c4a'} PyTado.http.http :: DEBUG :: Request: Method:POST URL: https://auth.tado.com/oauth/token<MASKED> Headers: {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Referer': 'https://app.tado.com/', 'Content-Length': '2'} Response: StatusCode: 200 Data: {<MASKED>, 'token_type': 'bearer', <MASKED>, 'expires_in': 599, 'scope': 'home.user', 'jti': 'fc32f452-9557-4be7-955c-3dc44cbba8e8'} PyTado.http.http :: DEBUG :: Request: Method:POST URL: https://auth.tado.com/oauth/token<MASKED>

Log rotation and relative paths

Many thanks for this code. I tried turning on log rotation. I'd discovered I needed to put an absolute path for the logFile variable, or I got access denied errors. When the log file filled up and the script tried to rotate the log file into a timestamped archive, I also got permission denied. The directory holding the logs, the directory holding the script itself, and the parent directory to both are all writeable by the user account that runs the script. So I'm guessing it's trying to create the rotated log file somewhere else entirely.

Invalid refresh token

From some days I get this error:

PyTado.http.http :: DEBUG    :: 
Request:
	Method:POST
	URL: https://auth.tado.com/oauth/token<MASKED>
	Headers: {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Referer': 'https://app.tado.com/', 'Content-Length': '2'}
:
	StatusCode: 400
	Data: {'error': 'invalid_grant', 'error_description': 'Invalid refresh token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIzYjk2ZGZl...'}

Open window detection does not turn off the heat

Hi Adrian,
Thanks for the script! ๐Ÿ‡ท๐Ÿ‡ด
It seems that open window detection does not work. The Tado app sends the notification, but the script does not turn off the heat.
Geofencing works ok.
Thank you!

PyTado/ Tado(username, password) is printing debug reports

Hello there,

I'm sorry if this is not the right way of reaching out about this issue.
Recently, anytime I run the script, the terminal windows gets a lot of extra debug reports, such as:

"PyTado.http.http :: DEBUG ::
Request:
Method:POST
URL: https://auth.tado.com/oauth/token
Headers: {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Referer': 'https://app.tado.com/', 'Content-Length': '2'}
Response:
StatusCode: ..."

I've tried figuring out how to have these logs hidden, because PyTado has been reworked a bit in the last few months, but I couldn't figure it out. I just know that it happens when we call the Tado(username, password) funcion, associated with PyTado.interface.

Thanks very much for any help and thank you for providing us with this amazing script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.