-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'drive_state' Data Sometimes Not Provided Following 'get_vehicle_data'? #116
Comments
This happens when the vehicle is asleep, because the owner API returns cached data when you make this call. If you call sync_wake_up() before get_vehicle_data(), then this should not happen. |
Thank you Tim! Have you seen this happen even when a sync_wake_up() is done? I'll see how things do today. But I seemed to have an occurrence of this yesterday when the car had been woken up. Thank you again. Jim |
Additional info: My code crashed this morning....after running for 18+ hours. The overall context: This program adjusts car charging based on solar panel output and home consumption. The design case is for it to run 24x7....and if car is below certain charge at night charge at night just to a basic minimum we need. My point: It's pinging the car periodically for status. During daylight it's pinging it about every 10 minutes. It had been running quite a long time - with many successful car polls - when this had occurred. Any ideas? Thanks so much! |
This exception is common if you access the TeslaPy object outside of a context handler. Here is an example without context handler: https://github.com/tdorssers/TeslaPy#alternative |
Thanks! |
Just to add on to this a bit... I have also observed some inconsistent behavior with the return of I really do not think this is an issue with the library - more of an API nuance. Is there any way for us to reliably establish the case in which a |
It appears that sometimes the 'drive_state' dataset is not provided with a get_vehicle_data call.
Could that be possible.....or maybe there's an issue on my end? My code will run for quite a while - checking some fields in that drive_state section. Then I'll get the following and aborts:
Traceback (most recent call last):
File "/home/pi/Desktop/Tesla/Suncatcherv5.3.py", line 292, in
at_home, tpi,odometer_short = tesla_plugged_in()
File "/home/pi/Desktop/Tesla/Suncatcherv5.3.py", line 16, in tesla_plugged_in
lat_raw = cardata['drive_state']['latitude']
File "/home/pi/.local/lib/python3.9/site-packages/teslapy/init.py", line 610, in missing
The errors/exceptions are pretty lengthy.....but this is the beginning. I've created a test program to only get the data and print it out. Sometimes that section is there....and sometimes it's not.
Thoughts?
Thanks!
The text was updated successfully, but these errors were encountered: