jonasman / TeslaSwift

Swift library to access the Tesla API
MIT License
243 stars 72 forks source link

Latitude and longitude no longer available with getCarData #156

Closed Jim3750 closed 7 months ago

Jim3750 commented 10 months ago

With installation of 2023.36.8, latitude and longitude of the car are no longer available like it was with previous Tesla firmware (via getCaraData command, using TeslaSwift).

Ant clue of where and how to get such info?

Thks

jonasman commented 10 months ago

Can you check the raw json from the response and see if it is there?

Otherwise we need to check the docs in the FleetAPI

Sent from my iPhone

On 13 Nov 2023, at 03:58, Jim3750 @.***> wrote:



With installation of 2023.36.8, latitude and longitude of the car are no longer available like it was with previous Tesla firmware (via getCaraData command, using TeslaSwift).

Ant clue of where and how to get such info?

Thks

— Reply to this email directly, view it on GitHubhttps://github.com/jonasman/TeslaSwift/issues/156, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AANOMXQMTV3I6IFMKCSIIO3YEIDPNAVCNFSM6AAAAAA7JA6P3CVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4TANJQG4ZTQNY. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Jim3750 commented 10 months ago

I do check the raw json. Latitude and longitude are no longer there.

jonasman commented 10 months ago

yeah, according to the docs we need to pass a new parameter on the call, but the docs do not say which param :)

Jim3750 commented 10 months ago

For now, I take lat/long from the phone (my app requires the phone to be in the car). However, I’ll be really interested if you find the solution to this matter…Thks Le 6 déc. 2023 à 13:34, João Nunes @.***> a écrit : yeah, according to the docs we need to pass a new parameter on the call, but the docs do not say which param :)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

ganeasebby commented 7 months ago

according to their documentation here: adding a parameter key endpoints and value location_data will return the current location of the vehicle. And additional data can be requested as well:

String of URL-encoded, semicolon-separated values. Can be many of 'charge_state', 'climate_state', 'closures_state', 'drive_state', 'gui_settings', 'location_data', 'vehicle_config', 'vehicle_state', 'vehicle_data_combo'

i have tried and i did receive the latitude and longitude of the vehicle /api/1/vehicles/{vehicle_tag}/vehicle_data?endpoints=location_data

jonasman commented 7 months ago

cool, seems like they updated the api docs. I will try to implement this new feature soon

jonasman commented 7 months ago

@ganeasebby are you able to combine the various options? for example charge_state;climate_state only returns charge_state

ganeasebby commented 7 months ago

nope, i noticed this as well, i tried to combine location with other things, and i only received the location. I thought it had something to do with location/privacy since they removed latitude/longitude from the initial response, but now that you mentioned it turns out you simply can't combine them... even though the documentation tends to say that you can

jonasman commented 7 months ago

Tag 10.0.0 includes this feature now there is a new object for cached data but im not sure what data it is