I've written a program to control battery charging based on solar output. I'm using teslapy. Overall it's working well - but the code is bombing unpredictably based on various specific errors. Sometimes it's an Error 408. Sometimes it's a timeout. I think another time I got a "vehicle unavailable" or something like that.
Is teslapy commonly used by folks here who are using the Tesla API?
I'm running 2.20 - which I believe is the current version.
This is an example of one of the errors I got
Any ideas? I'm a real Python hack and don't have any experience with this auth/token stuff.
Thanks!
Jim
Traceback (most recent call last):
File "TeslaCharger.py", line 62, in <module>
vehicles[0].get_vehicle_data()
File "/home/pi/.local/lib/python2.7/site-packages/teslapy/__init__.py", line 446, in get_vehicle_data
self.update(self.api('VEHICLE_DATA')['response'])
File "/home/pi/.local/lib/python2.7/site-packages/teslapy/__init__.py", line 404, in api
return self.tesla.api(name, {'vehicle_id': self['id_s']}, **kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/teslapy/__init__.py", line 288, in api
**{arg_name: kwargs})
File "/home/pi/.local/lib/python2.7/site-packages/teslapy/__init__.py", line 121, in request
response.raise_for_status() # Raise HTTPError, if one occurred
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 408 Client Error: vehicle unavailable: {:error=>"vehicle unavailable:"} for url: https://owner-api.teslamotors.com/api/1/vehicles/<stuff deleted>
Is teslapy commonly used by folks here who are using the Tesla API?
I'm running 2.20 - which I believe is the current version.
This is an example of one of the errors I got
Any ideas? I'm a real Python hack and don't have any experience with this auth/token stuff.
Thanks!
Jim
Traceback (most recent call last):
File "TeslaCharger.py", line 62, in <module>
vehicles[0].get_vehicle_data()
File "/home/pi/.local/lib/python2.7/site-packages/teslapy/__init__.py", line 446, in get_vehicle_data
self.update(self.api('VEHICLE_DATA')['response'])
File "/home/pi/.local/lib/python2.7/site-packages/teslapy/__init__.py", line 404, in api
return self.tesla.api(name, {'vehicle_id': self['id_s']}, **kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/teslapy/__init__.py", line 288, in api
**{arg_name: kwargs})
File "/home/pi/.local/lib/python2.7/site-packages/teslapy/__init__.py", line 121, in request
response.raise_for_status() # Raise HTTPError, if one occurred
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 408 Client Error: vehicle unavailable: {:error=>"vehicle unavailable:"} for url: https://owner-api.teslamotors.com/api/1/vehicles/<stuff deleted>