I meant to post that I was
able (not about) to get tokens now.
On your questions, it seems like get_vehicle_summary is accessing the vehicles endpoint on Tesla's API:
In __init__.py:
Code:
def get_vehicle_summary(self):
""" Determine the state of the vehicle's various sub-systems """
self.update(self.api('VEHICLE_SUMMARY')['response'])
return self
In endpoints.json:
Code:
"VEHICLE_SUMMARY": {
"TYPE": "GET",
"URI": "api/1/vehicles/{vehicle_id}",
"AUTH": true
}
And as far as I know, that endpoint doesn't reach out to the vehicle for information - I believe it's pulled from Tesla's own database.
Not sure about your second question.
@luckyj - Thanks for the reply.
The comment on the tdorssers github post for his python implementation says his get_vehicle_summary call 'gets the state of the vehicle (online, asleep, offline)'.
That's where I was interested in how I might incorporate this into my logger to better recognize when the vehicle is asleep such that I'd elect not to poll it to do a better job letting the car sleep to minimize vampire drain. That's where I was wondering if anyone has used this an could provide a little more detail on the nature of the response, whether this is a single state value or multiple values for online vs offline, awake versus asleep, etc.
I was able to work out the basic get request format as simply: /api/1/vehicles/{id}
The response is:
{
'id': 1234567890123456,
'vehicle_id': 123456789,
'vin': '5YJSA1E26GFnnnnn',
'display_name': 'VehicleName',
'option_codes':'AD15,MDL3,PBSB,RENA,BT37,ID3W,RF3G,S3PB,DRLH,DV2W,W39B,APF0,COUS,BC3B,CH07,PC30,FC3P,FG31,GLFR,
HL31,HM31,IL31,LTPB,MR31,FM3B,RS3H,SA3P,STCP,SC04,SU3C,T3CA,TW00,TM00,UT3P,WR00,AU3P,APH3,AF00,ZCST,
MI00,CDM0',
'color': None,
'access_type': 'OWNER',
'tokens': ['0123456789abcdef', 'abcdef9876543210'],
'state': 'online',
'in_service': False,
'id_s': '12345678901234567',
'calendar_enabled': True,
'api_version': 14,
'backseat_token': None,
'backseat_token_updated_at': None
}
It appears what he is referring to as providing the (online, asleep, offline) looks like it must be just the 'state' value shown in the response above. The little I've tested it I've not observed anything other than 'state': 'online' in the response, but I may shut my logger down for a couple hours this weekend and then poll my car with this to see if I can capture a 'sleep' reply.