Comments (7)
It seems that some of the new endpoints require a different base URL, but there is still not much documentation about this. Take a look at timdorr/tesla-api#444 and timdorr/tesla-api#445 for some details.
from teslapy.
As suggested here: timdorr/tesla-api#445 (comment), I have removed JWT usage for Owner API access and I use the OAuth2 SSO token for everything in f42b423. This commit also adds the option to use an absolute URL as an argument to request()
, which makes this possible:
from teslapy import Tesla
with Tesla('[email protected]') as tesla:
vehicles = tesla.vehicle_list()
url = 'https://akamai-apigateway-vfx.tesla.com/safety-rating/daily-metrics'
print(tesla.get(url, params={'vin': vehicles[0]['vin'],
'deviceLanguage': 'en',
'deviceCountry': 'US'}))
Can you pull the latest commit and give this a try?
from teslapy.
FYI, you need to add timezone
to the params, otherwise you get a validation error.
...
print(tesla.get(url, params={'vin': vehicles[0]['vin'],
'deviceLanguage': 'en',
'deviceCountry': 'US',
'timezone': 'UTC'}))
from teslapy.
Thanks, I have added this example to the readme!
from teslapy.
yw! Now the only thing I'm struggling to figure out is what the numbers mean in the dailyAggregation.metrics
. Seems like the Deciles are a float between 0 and 1, and they are opposite of what I understand decile rankings to be, and I guess it appears to be a ranking against all other drivers? The Median... the median of what? Same for Average -- average of what? Are these numbers aggregated by an unknown number of measurements taken during that daily period? I dunno if I did it right, but I made some graphs out of the data -- but if anyone has a better sense of the data, maybe that can be shared!? :)
from teslapy.
I'm getting a 400 on this request, but maybe it's because I'm not in the US and my car isn't measuring safety score?
with Tesla('[email protected]') as tesla:
vehicles = tesla.vehicle_list()
url = 'https://akamai-apigateway-vfx.tesla.com/safety-rating/daily-metrics'
print(tesla.get(url, params={'vin': vehicles[0]['vin'], 'deviceLanguage': 'en',
'deviceCountry': 'US', 'timezone': 'UTC'}))
from teslapy.
Yes, as far as I know it's US only.
from teslapy.
Related Issues (20)
- 429 on every sync_wake_up() call HOT 3
- last_seen() raises "Timestamp is in the future" error HOT 3
- No longer able to set Powerwall to self_consumption mode HOT 6
- Percentage Charged not updating on get_battery_data()
- Preconditioning Battery
- Authorization broken -> Always getting "Access Denied" HOT 1
- Solar panel power only updates sporadically HOT 2
- Fails to work when run in a daemon process. HOT 2
- 410 error on get_battery_data HOT 15
- 400 Client Error: time_of_use_settings
- latitude and longitude are not in drive_state HOT 3
- Selenium blocked by Tesla HOT 2
- Move to Fleet API and Tesla Vehicle Command SDK HOT 5
- I get an InvalidSchema("No connection adapters were found for 'https://owner-api.teslamotors.com/api/1/vehicles/) Exception when using vehicle.get_vehicle_data() HOT 1
- Powerwall function get_battery_data not working HOT 1
- Not able to login HOT 6
- It seems get_charge_history() API URI is no longer working? Returns 400 HOT 2
- Seems like the teslapy is no longer working with the new Tesla APIs HOT 58
- drive_state does not have latitude and longitude
- shift_state and speed stay None even during driving
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teslapy.