adrianslabu / tado_owda Goto Github PK
View Code? Open in Web Editor NEWOpen Window Detection Assist for tado.
License: GNU General Public License v3.0
Open Window Detection Assist for tado.
License: GNU General Public License v3.0
Could you consider to add some logs ?
import logging
logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s',filename="tado.log",level=logging.INFO)
def printm(message):
global lastMessage
if (message != lastMessage):
lastMessage = message
sys.stdout.write(message + "\n")
logging.info (message)
thanks !
Hello,
first I want to thank you that you programmed an open window assistant without geofencing. But I have a problem with the script I can't solve, maybe you can help me. I run the script on a raspberry pi with crontab at reboot. The first messages looks like this in the log file
PyTado.http.http :: DEBUG ::
Request:
Method:POST
URL: https://auth.tado.com/oauth/token
Headers: {'User-Agent': 'python-requests/2.25.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Referer': 'https://app.tado.com/', 'Content-Length': '2'}
Response:
StatusCode: 200
Data: {, 'token_type': 'bearer', , 'expires_in': 599, 'scope': 'home.user', 'jti': 'a5d84305-8150-45a3-8009-b39ac7ed280d'}
So I guess it is running. But after some of this logs I get an error:
Current thread 0xb6f78640 (most recent call first):
File "/usr/lib/python3.9/email/utils.py", line 57 in _has_surrogates
File "/usr/lib/python3.9/email/_policybase.py", line 287 in _sanitize_header
File "/usr/lib/python3.9/email/_policybase.py", line 316 in header_fetch_parse
File "/usr/lib/python3.9/email/message.py", line 471 in get
File "/usr/lib/python3.9/email/message.py", line 578 in get_content_type
File "/usr/lib/python3.9/email/message.py", line 594 in get_content_maintype
File "/usr/lib/python3.9/email/feedparser.py", line 295 in _parsegen
File "/usr/lib/python3.9/email/feedparser.py", line 180 in _call_parse
File "/usr/lib/python3.9/email/feedparser.py", line 176 in feed
File "/usr/lib/python3.9/email/parser.py", line 56 in parse
File "/usr/lib/python3.9/email/parser.py", line 67 in parsestr
File "/usr/lib/python3.9/http/client.py", line 225 in parse_headers
File "/usr/lib/python3.9/http/client.py", line 331 in begin
File "/usr/lib/python3.9/http/client.py", line 1347 in getresponse
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 440 in _make_request
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699 in urlopen
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439 in send
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655 in send
File "/usr/local/lib/python3.9/dist-packages/PyTado/http/http.py", line 132 in request
File "/usr/local/lib/python3.9/dist-packages/PyTado/interface.py", line 577 in get_zone_overlay_default
File "/usr/local/lib/python3.9/dist-packages/PyTado/interface.py", line 155 in get_state
File "/usr/local/lib/python3.9/dist-packages/PyTado/interface.py", line 686 in get_open_window_detected
File "/home/pi/tado_owda.py", line 61 in checkWindowsState
File "/home/pi/tado_owda.py", line 72 in checkWindowsState
File "/home/pi/tado_owda.py", line 72 in checkWindowsState
Thanks for your help.
Greetings
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.