Skip to content

Instantly share code, notes, and snippets.

@planecore
Created February 11, 2022 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save planecore/45c61caefc29cedc8c7a6a57f46104f3 to your computer and use it in GitHub Desktop.
Save planecore/45c61caefc29cedc8c7a6a57f46104f3 to your computer and use it in GitHub Desktop.
Enable Sentry Mode
from decouple import config
import teslapy
with teslapy.Tesla(config('EMAIL')) as tesla:
if not tesla.authorized:
tesla.refresh_token(refresh_token=config('TOKEN'))
tessie = tesla.vehicle_list()[0]
tessie.sync_wake_up()
tessie.command('SET_SENTRY_MODE', on='true')
tesla.close()
certifi==2021.10.8
charset-normalizer==2.0.11
idna==3.3
oauthlib==3.2.0
python-decouple==3.6
requests==2.27.1
requests-oauthlib==1.3.1
TeslaPy==2.4.0
urllib3==1.26.8
websocket-client==1.2.3
@planecore
Copy link
Author

Enter your Tesla account email and refresh token in an .env file with the following format:

EMAIL=
TOKEN=

You can generate a refresh token with apps like Auth App for Tesla (iOS) and Tesla Tokens (Android).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment