Tesla Integration to Query Status and Send Commands to Your Car

i added extra codce to do a wake command first.. have you tried that

Yes I have. Here is my rule:

I am just saying, if I set it to 67, it will actually set it to 66. Same goes with 76, it will actually set to 75 in the Tesla app.

i dont use mine that way i use it through a dashboard/. try using 67.0 maybe a rounding error.




also i meant i added the wake command directly in the settemp command in the code.

it could be a rouding error in how your version of the code converts to celsius

I just tried 66.0 and it still changes to 64 on the Tesla app itself:
image

Mine is also set to Fahrenheit:

it is definately rounding errors in the driver..

Setting to F has nothing to do with it.. The api only accepts temps in C so there are obviously rounding errors in the conversion as I mentioned.

I changed from number to double in the code to preserve the digits and now it is working correctly. You will need to get my version of both the driver "teslaconnect" and the device from here

2 Likes

Also, very interesting that the api seems to allow setting a different temp for driver and passenger.

I have not seen anywhere in the screens in the car that allows that..Or in the app for that matter?

Has anyone?

In my model 3 there is dual climate for driver and passenger. If I tap on the temp along the bottom of the screen a slider pops up. Just to the right of the slider there is a sync button. If that is toggled it adds two temp controls along the bottom status bar, allowing for dual climate control. Interesting it can be set with Hubitat, because I don't think you can control them separately from the app

1 Like

I have not seen the ability to set dual temperatures on the app, just in the car when the sync button is not selected.

Thank you for the updated driver and app.

Update: I just updated both these and it works flawlessly. Thanks again!

1 Like

Trying to get the token sorted, I've gone through all the steps for the python script above but get this back as a response - I'm on Windows10 for reference.

Traceback (most recent call last):
File "C:\tesla-oauth2-main\tesla.py", line 268, in
login(args)
File "C:\tesla-oauth2-main\tesla.py", line 225, in login
code = parse_qs(resp.headers["location"])["https://auth.tesla.com/void/callback?code"]
File "C:\Python310\lib\site-packages\requests\structures.py", line 54, in getitem
return self._store[key.lower()][1]
KeyError: 'location'

I try to repeat the steps again and now get this error (which I was getting before)
Traceback (most recent call last):
File "C:\tesla-oauth2-main\tesla.py", line 268, in
login(args)
File "C:\tesla-oauth2-main\tesla.py", line 127, in login
raise ValueError(f"Didn't post auth form in {MAX_ATTEMPTS} attempts.")
ValueError: Didn't post auth form in 7 attempts.

Edit - also tried doing it in a WSL fresh install and get the same message

Not sure where to go next?

Ya its no.longer working. I've been just copying my token into the device panel from teslafi periodically.

I use an android app called Tesla Tokens. It is free (I think teslafi is paid?) and seems to work well. Works for 45 days or so then I have to manually set it again. Been using it for a few months now (since I have had my car) and everything seems to work pretty well

Teslafi is free as well

1 Like

I'm pretty sure it's a paid service. There's a 2 week free trial, or 4 weeks if you use someone's referral code (*).

(they did just add an iOS & Android app that will generate an API refresh token for you, and have a Chrome extension that will get one for you)


(*) Personally, I think TeslaFi is really great and use it on both my cars. I describe it here: https://teslamotorsclub.com/tmc/threads/best-tesla-apps.210626/#post-5088042
The map at that link is the lifetime travels of The BlueS, which sadly was in an accident last week.

FWIW, my username is a TeslaFi referral code.

sorry about the car.. you could be right .. i dont remember paying but that must mean it is coming due soon.

Just managed to set it up using TeslaFi.

The other one looks like TeslaPy but not had any luck yet with the code but I'm not a linux person so probably my error not theirs. Don't know if anyones tried it?

Anyone consider adapting the refresh token logic from Pulling data out Tesla Powerwall?

Thanks for this awesome app. Works great doing all of my Tesla automation for Hubitat. I’m wondering if there’s a way to completely disable logging. Turning off debug only eliminates some of the debug logs. Thanks!

With debugging off

dev:6762022-02-24 08:17:34.906 debugprocessData: [state:asleep, motion:inactive, speed:0, vin:5YJYGDEE1MF#####, thermostatMode:off]
app:6262022-02-24 08:17:34.354 debugauthorizedHttpRequest GET /api/1/vehicles/14931015######## attempt 0
dev:6762022-02-24 08:17:34.346 debugExecuting 'refresh'

With debugging on


dev:6762022-02-24 08:17:07.300 debugRefresh time currently set to: 1-Hour
dev:6762022-02-24 08:17:07.297 debugExecuting 'initialize'
dev:6762022-02-24 08:16:43.460 debugprocessData: [state:asleep, motion:inactive, speed:0, vin:5YJYGDEE1MF######, thermostatMode:off]
app:6262022-02-24 08:16:42.770 debugauthorizedHttpRequest GET /api/1/vehicles/14931015######## attempt 0
dev:6762022-02-24 08:16:42.763 debugExecuting 'refresh'

Has this app/driver been updated to adjust charge rate? Would love to automate charging my Tesla on excess solar generation after powerwalls are fully charged. I’m already using Tesla Powerwall Manager https://darwinsden.com/powerwall/ so I can get SOC data from there.

It is possible to set charge limit, but not charge rate. Though if I remember correctly, being able to adjust the charge rate via the app is a fairly recent feature. I'm sure this driver is older than that, but I'm not sure if Tesla even supports adjusting charge rate in their API. Though, I assume they would, since the phone app offers that functionality now.

1 Like