Giter VIP home page Giter VIP logo

Comments (7)

tdorssers avatar tdorssers commented on May 25, 2024

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.

tdorssers avatar tdorssers commented on May 25, 2024

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.

philipsd6 avatar philipsd6 commented on May 25, 2024

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.

tdorssers avatar tdorssers commented on May 25, 2024

Thanks, I have added this example to the readme!

from teslapy.

philipsd6 avatar philipsd6 commented on May 25, 2024

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.

andeplane avatar andeplane commented on May 25, 2024

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.

tdorssers avatar tdorssers commented on May 25, 2024

Yes, as far as I know it's US only.

from teslapy.

Related Issues (20)

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.