TeslaPy - A Python implementation based on unofficial documentation of the client side interface to the Tesla Motors Owner API

Overview

TeslaPy

A Python implementation based on unofficial documentation of the client side interface to the Tesla Motors Owner API, which provides functionality to monitor and control Tesla products remotely.

Version Downloads

Overview

This module depends on Python requests, requests_oauthlib and websocket-client. The Tesla class extends requests.Session and therefore inherits methods like get() and post() that can be used to perform API calls. All calls to the Owner API are intercepted by the request() method to add the JSON Web Token (JWT) bearer, which is acquired after authentication. Module characteristics:

  • It implements Tesla's new OAuth 2 Single Sign-On service.
  • Acquired tokens are stored in current working directory in cache.json file for persistence by default.
  • The cache stores tokens of each authorized identity (email).
  • Authentication is only needed when a new token is requested (usually once).
  • The token is automatically refreshed when expired without the need to reauthenticate.
  • An email registered in another region (e.g. auth.tesla.cn) is also supported.
  • Streaming API support using a WebSocket.
  • Pluggable cache and authenticator methods.

TeslaPy 2.0.0+ no longer implements headless authentication. The constructor differs and takes these arguments:

Argument Description
email SSO identity
verify (optional) verify SSL certificate
proxy (optional) URL of proxy server
retry (optional) number of connection retries or Retry instance
user_agent (optional) the User-Agent string
authenticator (optional) Function with one argument, the authorization URL, that returns the redirected URL
cache_file (optional) path to cache file used by default loader and dumper
cache_loader (optional) function that returns the cache dict
cache_dumper (optional) function with one argument, the cache dict

To authenticate, the SSO page opens in the system's default web browser. After successful authentication, a Page not found will be displayed and the URL should start with https://auth.tesla.com/void/callback, which is the redirected URL. The class will use stdio to get the full redirected URL from the web browser by default. You need to copy and paste the full URL from the web browser to the console to continue aquirering API tokens. You can use a pluggable authenticator method to automate this for example using selenium.

The convenience method api() uses named endpoints listed in endpoints.json to perform calls, so the module does not require changes if the API is updated. Any error message returned by the API is raised as an HTTPError exception. Additionally, the class implements the following methods:

Call Description
fetch_token() requests a new JWT bearer token using Authorization Code grant with PKCE extension
refresh_token() requests a new JWT bearer token using Refresh Token grant
vehicle_list() returns a list of Vehicle objects
battery_list() returns a list of Battery objects
solar_list() returns a list of SolarPanel objects

The Vehicle class extends dict and stores vehicle data returned by the Owner API, which is a pull API. The streaming API pushes vehicle data on-change after subscription. The stream() method takes an optional argument, a callback function that is called with one argument, a dict holding the changed data. The Vehicle object is always updated with the pushed data. If there are no changes within 10 seconds, the vehicle stops streaming data. The stream() method has two more optional arguments to control restarting. Additionally, the class implements the following methods:

Call Description
api() performs an API call to named endpoint requiring vehicle_id with optional arguments
get_vehicle_summary() gets the state of the vehicle (online, asleep, offline)
sync_wake_up() wakes up and waits for the vehicle to come online
option_code_list() 1 lists known descriptions (read from option_codes.json) of the vehicle option codes
get_vehicle_data() gets a rollup of all the data request endpoints plus vehicle config
get_nearby_charging_sites() lists nearby Tesla-operated charging stations
get_service_scheduling_data() retrieves next service appointment for this vehicle
mobile_enabled() checks if mobile access is enabled in the vehicle
compose_image() 2 composes a vehicle image based on vehicle option codes
dist_units() converts distance or speed units to GUI setting of the vehicle
temp_units() converts temperature units to GUI setting of the vehicle
decode_vin() decodes the vehicle identification number to a dict
remote_start_drive() enables keyless drive (requires password to be set)
command() wrapper around api() for vehicle command response error handling

1 Option codes appear to be deprecated. Vehicles return a generic set of codes related to a Model 3.

2 Pass vehicle option codes to this method or the image may not be accurate.

Only get_vehicle_summary(), option_code_list(), get_service_scheduling_data(), compose_image() and decode_vin() are available when the vehicle is asleep or offline. These methods will not prevent your vehicle from sleeping. Other methods and API calls require the vehicle to be brought online by using sync_wake_up() and can prevent your vehicle from sleeping if called within too short a period.

The Product class extends dict and stores product data of Powerwalls and solar panels returned by the API. Additionally, the class implements the following methods:

Call Description
api() performs an API call to named endpoint requiring battery_id or site_id with optional arguments
get_history_data() Retrieve live status of product
get_calendar_history_data() Retrieve live status of product
command() wrapper around api() for battery command response error handling

The Battery class extends Product and stores Powerwall data returned by the API. Additionally, the class implements the following methods:

Call Description
get_battery_data() Retrieve detailed state and configuration of the battery
set_operation() Set battery operation to self_consumption, backup or autonomous
set_backup_reserve_percent() Set the minimum backup reserve percent for that battery

The SolarPanel class extends Product and stores solar panel data returned by the API. Additionally, the class implements the following methods:

Call Description
get_site_data() Retrieve current site generation data

Usage

Basic usage of the module:

import teslapy
with teslapy.Tesla('[email protected]') as tesla:
	tesla.fetch_token()
	vehicles = tesla.vehicle_list()
	vehicles[0].sync_wake_up()
	vehicles[0].command('ACTUATE_TRUNK', which_trunk='front')
	print(vehicles[0].get_vehicle_data()['vehicle_state']['car_version'])

The Tesla class implements a pluggable authentication method. If you want to implement your own method to handle the SSO page and retrieve the redirected URL after authentication, you can pass a function as an argument to the constructor, that takes the authentication URL as an argument and returns the redirected URL. The authenticator argument is accessible as an attribute as well.

from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait

def custom_auth(url):
    with webdriver.Chrome() as browser:
        browser.get(url)
        WebDriverWait(browser, 300).until(EC.url_contains('void/callback'))
        return browser.current_url

with teslapy.Tesla('[email protected]', authenticator=custom_auth) as tesla:
	tesla.fetch_token()

The Tesla class implements a pluggable cache method. If you don't want to use the default disk caching, you can pass a function to load and return the cache dict, and a function that takes a dict as an argument to dump the cache dict, as arguments to the constructor. The cache_loader and cache_dumper arguments are accessible as attributes as well.

import json
import sqlite3

def db_load():
    con = sqlite3.connect('cache.db')
    cur = con.cursor()
    cache = {}
    try:
        for row in cur.execute('select * from teslapy'):
            cache[row[0]] = json.loads(row[1])
    except sqlite3.OperationalError:
        pass
    con.close()
    return cache

def db_dump(cache):
    con = sqlite3.connect('cache.db')
    con.execute('create table if not exists teslapy (email text primary key, data json)')
    for email, data in cache.items():
        con.execute('replace into teslapy values (?, ?)', [email, json.dumps(data)])
    con.commit()
    con.close()

with teslapy.Tesla('[email protected]', cache_loader=db_load, cache_dumper=db_dump) as tesla:
	tesla.fetch_token()

Take a look at cli.py, menu.py or gui.py for more code examples.

Commands

These are the major commands:

Endpoint Parameters Value
UNLOCK
LOCK
HONK_HORN
FLASH_LIGHTS
CLIMATE_ON
CLIMATE_OFF
MAX_DEFROST on true or false
CHANGE_CLIMATE_TEMPERATURE_SETTING driver_temp, passenger_temp temperature in celcius
SCHEDULED_CHARGING 1 enable, time true or false, minutes past midnight
CHARGING_AMPS 1 charging_amps amperage
CHANGE_CHARGE_LIMIT percent percentage
CHANGE_SUNROOF_STATE state vent or close
WINDOW_CONTROL 2 command, lat, lon vent or close, 0, 0
ACTUATE_TRUNK which_trunk rear or front
REMOTE_START password password
TRIGGER_HOMELINK lat, lon current lattitude and logitude
CHARGE_PORT_DOOR_OPEN
CHARGE_PORT_DOOR_CLOSE
START_CHARGE
STOP_CHARGE
MEDIA_TOGGLE_PLAYBACK
MEDIA_NEXT_TRACK
MEDIA_PREVIOUS_TRACK
MEDIA_NEXT_FAVORITE
MEDIA_PREVIOUS_FAVORITE
MEDIA_VOLUME_UP
MEDIA_VOLUME_DOWN
SET_VALET_MODE on, password true or false, 4 digit PIN
RESET_VALET_PIN
SPEED_LIMIT_ACTIVATE pin 4 digit PIN
SPEED_LIMIT_DEACTIVATE pin 4 digit PIN
SPEED_LIMIT_SET_LIMIT limit_mph between 50-90
SPEED_LIMIT_CLEAR_PIN pin 4 digit PIN
SCHEDULE_SOFTWARE_UPDATE offset_sec seconds
CANCEL_SOFTWARE_UPDATE
SET_SENTRY_MODE on true or false
REMOTE_SEAT_HEATER_REQUEST heater, level seat 0-5, level 0-3
REMOTE_STEERING_WHEEL_HEATER_REQUEST on true or false

1 requires car version 2021.36 or higher.

2 close requires lat and lon values to be near the current location of the car.

Exceptions

Basic exception handling:

try:
    vehicles[0].command('HONK_HORN')
except teslapy.HTTPError as e:
    print(e)

All requests.exceptions and oauthlib.oauth2.rfc6749.errors classes are imported by the module. When the vehicle is asleep or offline and the vehicle needs to be online for the API endpoint to be executed, the following exception is raised: requests.exceptions.HTTPError: 408 Client Error: vehicle unavailable. The exception can be caught as teslapy.HTTPError.

Additionally, sync_wake_up() raises teslapy.VehicleError when the vehicle does not come online within the specified timeout. And command() also raises teslapy.VehicleError when the vehicle command response result is False. For instance, if one of the media endpoints is called and there is no user present in the vehicle, the following exception is raised: VehicleError: user_not_present.

As of January 29, 2021, Tesla updated this endpoint to follow RFC 7523 and requires the use of the SSO service (auth.tesla.com) for authentication. If you get a requests.exceptions.HTTPError: 400 Client Error: endpoint_deprecated:_please_update_your_app for url: https://owner-api.teslamotors.com/oauth/token then you are probably using an old version of this module.

As of September 3, 2021, Tesla has added ReCaptcha to the login form. This caused the headless login implemented by TeslaPy to break. If you get a ValueError: Credentials rejected. Recaptcha is required and you are using correct credentials then you are probably using an old version of this module.

Demo applications

The source repository contains three demo applications that optionally use selenium to automate weblogin. Version 3.13.0 or higher is required and version 4.0.0 or higher is required for Edge Chromium.

cli.py is a simple CLI application that can use almost all functionality of the TeslaPy module. The filter option allows you to select a product if more than one product is linked to your account. API output is JSON formatted:

usage: cli.py [-h] -e EMAIL [-f FILTER] [-a API] [-k KEYVALUE] [-c COMMAND]
              [-l] [-o] [-v] [-w] [-g] [-b] [-n] [-m] [-s] [-d] [-r]
              [--service] [--verify] [--chrome] [--edge] [--firefox] [--opera]
              [--safari] [--proxy PROXY]

Tesla Owner API CLI

optional arguments:
  -h, --help     show this help message and exit
  -e EMAIL       login email
  -f FILTER      filter on id, vin, etc.
  -a API         API call endpoint name
  -k KEYVALUE    API parameter (key=value)
  -c COMMAND     product command endpoint
  -l, --list     list all selected vehicles/batteries
  -o, --option   list vehicle option codes
  -v, --vin      vehicle identification number decode
  -w, --wake     wake up selected vehicle(s)
  -g, --get      get rollup of all vehicle data
  -b, --battery  get detailed battery state and config
  -n, --nearby   list nearby charging sites
  -m, --mobile   get mobile enabled state
  -s, --start    remote start drive
  -d, --debug    set logging level to debug
  -r, --stream   receive streaming vehicle data on-change
  --service      get service self scheduling eligibility
  --verify       disable verify SSL certificate
  --chrome       use Chrome (default)
  --edge         use Edge browser
  --firefox      use Firefox browser
  --opera        use Opera browser
  --safari       use Safari browser
  --proxy PROXY  proxy server URL

Example usage of cli.py:

python cli.py -e [email protected] -w -a ACTUATE_TRUNK -k which_trunk=front

menu.py is a menu-based console application that displays vehicle data in a tabular format. The application depends on geopy to convert GPS coordinates to a human readable address:

gui.py is a graphical user interface using tkinter. API calls are performed asynchronously using threading. The GUI supports auto refreshing of the vehicle data and displays a composed vehicle image. Note that the vehicle will not go to sleep, if auto refresh is enabled. The application depends on geopy to convert GPS coordinates to a human readable address. If Tcl/Tk GUI toolkit version of your Python installation is lower than 8.6 then pillow is required to display the vehicle image. User preferences, such as which web browser to use for authentication, persist upon application restart.

The demo applications can be containerized using the provided Dockerfile. A bind volume is used to store cache.json and gui.ini in the current directory on the host machine:

sudo docker build -t teslapy .
xhost +local:*
sudo docker run -ti --net=host --privileged -v "$(pwd)":/home/tsla teslapy

Vehicle data

Example output of get_vehicle_data() or python cli.py -e [email protected] -w -g below:

", "timestamp": 1569952097456, "use_range_badging": true, "wheel_type": "Pinwheel18" }, "vehicle_state": { "api_version": 6, "autopark_state_v2": "unavailable", "calendar_supported": true, "car_version": "2019.32.11.1 d39e85a", "center_display_state": 2, "df": 0, "dr": 0, "fd_window": 0, "fp_window": 0, "ft": 0, "is_user_present": true, "locked": false, "media_state": { "remote_control_enabled": true }, "notifications_supported": true, "odometer": 6963.081561, "parsed_calendar_supported": true, "pf": 0, "pr": 0, "rd_window": 0, "remote_start": false, "remote_start_enabled": true, "remote_start_supported": true, "rp_window": 0, "rt": 0, "sentry_mode": false, "sentry_mode_available": true, "software_update": { "expected_duration_sec": 2700, "status": "" }, "speed_limit_mode": { "active": false, "current_limit_mph": 85.0, "max_limit_mph": 90, "min_limit_mph": 50, "pin_code_set": false }, "sun_roof_percent_open": null, "sun_roof_state": "unknown", "timestamp": 1569952097456, "valet_mode": false, "valet_pin_needed": true, "vehicle_name": "Tim's Tesla" } } ">
{
    "id": 12345678901234567,
    "vehicle_id": 1234567890,
    "vin": "5YJ3E111111111111",
    "display_name": "Tim's Tesla",
    "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": null,
    "tokens": [
        "1234567890abcdef",
        "abcdef1234567890"
    ],
    "state": "online",
    "in_service": false,
    "id_s": "12345678901234567",
    "calendar_enabled": true,
    "api_version": 6,
    "backseat_token": null,
    "backseat_token_updated_at": null,
    "user_id": 123456,
    "charge_state": {
        "battery_heater_on": false,
        "battery_level": 44,
        "battery_range": 99.84,
        "charge_current_request": 16,
        "charge_current_request_max": 16,
        "charge_enable_request": true,
        "charge_energy_added": 14.54,
        "charge_limit_soc": 90,
        "charge_limit_soc_max": 100,
        "charge_limit_soc_min": 50,
        "charge_limit_soc_std": 90,
        "charge_miles_added_ideal": 66.5,
        "charge_miles_added_rated": 66.5,
        "charge_port_cold_weather_mode": false,
        "charge_port_door_open": true,
        "charge_port_latch": "Engaged",
        "charge_rate": 455.7,
        "charge_to_max_range": false,
        "charger_actual_current": 0,
        "charger_phases": null,
        "charger_pilot_current": 16,
        "charger_power": 100,
        "charger_voltage": 2,
        "charging_state": "Charging",
        "conn_charge_cable": "IEC",
        "est_battery_range": 78.13,
        "fast_charger_brand": "Tesla",
        "fast_charger_present": true,
        "fast_charger_type": "Combo",
        "ideal_battery_range": 99.84,
        "managed_charging_active": false,
        "managed_charging_start_time": null,
        "managed_charging_user_canceled": false,
        "max_range_charge_counter": 1,
        "minutes_to_full_charge": 15,
        "not_enough_power_to_heat": null,
        "scheduled_charging_pending": false,
        "scheduled_charging_start_time": null,
        "time_to_full_charge": 0.25,
        "timestamp": 1569952097456,
        "trip_charging": true,
        "usable_battery_level": 44,
        "user_charge_enable_request": null
    },
    "climate_state": {
        "battery_heater": false,
        "battery_heater_no_power": null,
        "climate_keeper_mode": "off",
        "driver_temp_setting": 21.0,
        "fan_status": 3,
        "inside_temp": 21.0,
        "is_auto_conditioning_on": true,
        "is_climate_on": true,
        "is_front_defroster_on": false,
        "is_preconditioning": false,
        "is_rear_defroster_on": false,
        "left_temp_direction": 54,
        "max_avail_temp": 28.0,
        "min_avail_temp": 15.0,
        "outside_temp": 13.5,
        "passenger_temp_setting": 21.0,
        "remote_heater_control_enabled": true,
        "right_temp_direction": 54,
        "seat_heater_left": 0,
        "seat_heater_right": 0,
        "side_mirror_heaters": false,
        "smart_preconditioning": false,
        "timestamp": 1569952097456,
        "wiper_blade_heater": false
    },
    "drive_state": {
        "gps_as_of": 1569952096,
        "heading": 240,
        "latitude": 52.531951,
        "longitude": 6.156999,
        "native_latitude": 52.531951,
        "native_location_supported": 1,
        "native_longitude": 6.156999,
        "native_type": "wgs",
        "power": -100,
        "shift_state": null,
        "speed": null,
        "timestamp": 1569952097456
    },
    "gui_settings": {
        "gui_24_hour_time": true,
        "gui_charge_rate_units": "km/hr",
        "gui_distance_units": "km/hr",
        "gui_range_display": "Rated",
        "gui_temperature_units": "C",
        "show_range_units": false,
        "timestamp": 1569952097456
    },
    "vehicle_config": {
        "can_accept_navigation_requests": true,
        "can_actuate_trunks": true,
        "car_special_type": "base",
        "car_type": "model3",
        "charge_port_type": "CCS",
        "eu_vehicle": true,
        "exterior_color": "SolidBlack",
        "has_air_suspension": false,
        "has_ludicrous_mode": false,
        "key_version": 2,
        "motorized_charge_port": true,
        "plg": false,
        "rear_seat_heaters": 0,
        "rear_seat_type": null,
        "rhd": false,
        "roof_color": "Glass",
        "seat_type": null,
        "spoiler_type": "None",
        "sun_roof_installed": null,
        "third_row_seats": "
   
    "
   ,
        "timestamp": 1569952097456,
        "use_range_badging": true,
        "wheel_type": "Pinwheel18"
    },
    "vehicle_state": {
        "api_version": 6,
        "autopark_state_v2": "unavailable",
        "calendar_supported": true,
        "car_version": "2019.32.11.1 d39e85a",
        "center_display_state": 2,
        "df": 0,
        "dr": 0,
		"fd_window": 0,
        "fp_window": 0,
        "ft": 0,
        "is_user_present": true,
        "locked": false,
        "media_state": {
            "remote_control_enabled": true
        },
        "notifications_supported": true,
        "odometer": 6963.081561,
        "parsed_calendar_supported": true,
        "pf": 0,
        "pr": 0,
		"rd_window": 0,
        "remote_start": false,
        "remote_start_enabled": true,
        "remote_start_supported": true,
		"rp_window": 0,
        "rt": 0,
        "sentry_mode": false,
        "sentry_mode_available": true,
        "software_update": {
            "expected_duration_sec": 2700,
            "status": ""
        },
        "speed_limit_mode": {
            "active": false,
            "current_limit_mph": 85.0,
            "max_limit_mph": 90,
            "min_limit_mph": 50,
            "pin_code_set": false
        },
        "sun_roof_percent_open": null,
        "sun_roof_state": "unknown",
        "timestamp": 1569952097456,
        "valet_mode": false,
        "valet_pin_needed": true,
        "vehicle_name": "Tim's Tesla"
    }
}

Example output of get_service_scheduling_data() or python cli.py -e [email protected] --service below:

{
    "response": {
        "enabled_vins": [
            {
                "vin": "5YJ3E111111111111",
                "next_appt_timestamp": "2021-06-08T13:15:00",
                "next_appt_end_timestamp": null,
                "show_badge": false
            }
        ]
    }
}

Powerwall data

Example output of get_battery_data() or python cli.py -e [email protected] -b below:

{
    "energy_site_id": 111110110110,
    "resource_type": "battery",
    "site_name": "Elon's House",
    "id": "STE10110111-00101",
    "gateway_id": "1111100-11-A--AAA11110A1A111",
    "asset_site_id": "a1100111-1a11-1aaa-a111-1a0011aa1111",
    "energy_left": 0,
    "total_pack_energy": 13746,
    "percentage_charged": 0,
    "battery_type": "ac_powerwall",
    "backup_capable": true,
    "battery_power": 0,
    "sync_grid_alert_enabled": false,
    "breaker_alert_enabled": false,
    "components": {
        "solar": true,
        "solar_type": "pv_panel",
        "battery": true,
        "grid": true,
        "backup": true,
        "gateway": "teg",
        "load_meter": true,
        "tou_capable": true,
        "storm_mode_capable": true,
        "flex_energy_request_capable": false,
        "car_charging_data_supported": false,
        "off_grid_vehicle_charging_reserve_supported": false,
        "vehicle_charging_performance_view_enabled": false,
        "vehicle_charging_solar_offset_view_enabled": false,
        "battery_solar_offset_view_enabled": true,
        "show_grid_import_battery_source_cards": true,
        "battery_type": "ac_powerwall",
        "configurable": false,
        "grid_services_enabled": false
    },
    "grid_status": "Active",
    "backup": {
        "backup_reserve_percent": 0,
        "events": null
    },
    "user_settings": {
        "storm_mode_enabled": false,
        "sync_grid_alert_enabled": false,
        "breaker_alert_enabled": false
    },
    "default_real_mode": "self_consumption",
    "operation": "self_consumption",
    "installation_date": "2020-01-01T10:10:00+08:00",
    "power_reading": [
        {
            "timestamp": "2021-02-24T04:25:39+08:00",
            "load_power": 5275,
            "solar_power": 3,
            "grid_power": 5262,
            "battery_power": 10,
            "generator_power": 0
        }
    ],
    "battery_count": 1
}

Installation

TeslaPy is available on PyPI:

python -m pip install teslapy

Make sure you have Python 2.7+ or 3.5+ installed on your system. Alternatively, clone the repository to your machine and run demo application cli.py, menu.py or gui.py to get started, after installing requests_oauthlib, geopy, selenium (optional) and websocket-client using PIP as follows:

python -m pip install requests_oauthlib geopy selenium websocket-client

and install ChromeDriver to use Selenium or on Ubuntu as follows:

sudo apt-get install python3-requests-oauthlib python3-geopy python3-selenium python3-websocket

If you prefer Firefox, install GeckoDriver or on Ubuntu as follows:

sudo apt-get install firefox-geckodriver

Comments
  • Add CHARGING_AMPS incl. yet unknown parameter name to README.md

    Add CHARGING_AMPS incl. yet unknown parameter name to README.md "Commands" table

    The new command CHARGING_AMPS obviously has to have a parameter to set the intended current. Does anybody know the name of this parameter and its value range (maybe, e.g. simply 5..16 for Model 3)? When it is known, it should be added to the according table in the Commands section of the README.md file.

    opened by frsteinb 31
  • requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://auth.tesla.com/oauth2/v3/authorize?

    requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://auth.tesla.com/oauth2/v3/authorize?

    I disabled MFA on my tesla account yet I still can't run menu.py

    Here is the error I get:

    Enter email: MY_TESLA_EMAIL Traceback (most recent call last): File "menu.py", line 336, in main() File "menu.py", line 306, in main vehicles = tesla.vehicle_list() File "C:\Users\aviad\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\teslapy_init_.py", line 327, in vehicle_list return [Vehicle(v, self) for v in self.api('VEHICLE_LIST')['response']] File "C:\Users\aviad\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\teslapy_init_.py", line 312, in api self.fetch_token() File "C:\Users\aviad\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\teslapy_init_.py", line 183, in fetch_token url = self.authorization_url() File "C:\Users\aviad\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\teslapy_init_.py", line 162, in authorization_url response.raise_for_status() # Raise HTTPError, if one occurred File "C:\Users\aviad\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\requests\models.py", line 960, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://auth.tesla.com/oauth2/v3/authorize?response_type=code&client_id=ownerapi&redirect_uri=https%3A%2F%2Fauth.tesla.com%2Fvoid%2Fcallback&scope=openid+email+offline_access&state=X2yy3x9XLOKcGwS3WQzW7aSRRUh9CL&code_challenge=sHsqezDB3WXgqipH5Cx8jDcx1YTwEQtV3hjHVEj7k3I&code_challenge_method=S256&login_hint=MY_TESLA_EMAIL

    opened by aviadoffer 23
  • My looping app will run for hours but never a day

    My looping app will run for hours but never a day

    My code is published as: https://github.com/israndy/SuperchargerLog

    I continue to receive this error, and because it happens daily I am not sure how to track it down, I just see this output after the last successful step the program did run:

    Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 449, in _make_request six.raise_from(e, None) File "", line 3, in raise_from File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connectionpool.py", line 444, in _make_request httplib_response = conn.getresponse()

    And it goes on for page after page of errors.

    opened by israndy 19
  • Issues with credentials : Credentials rejected

    Issues with credentials : Credentials rejected

    hey all, wanted to give this a shot, got everything installed but i'm having issues with logging in. i didnt have MFA enabled, using cli.py was still requesting a captcha. i logged into tesla, configured MFA anyhow and verified the captcha works using an authenticator app. no matter what i try, the cli.py script is returning invalid credentials. i've waited multiple iterations of credentials to verify too. thanks!

    Captcha: 364833
    Traceback (most recent call last):
      File "cli.py", line 100, in <module>
        main()
      File "cli.py", line 61, in main
        tesla.fetch_token()
      File "/var/www/scripts/TeslaPy/teslapy/__init__.py", line 203, in fetch_token
        raise ValueError('Credentials rejected')
    ValueError: Credentials rejected
    
    opened by 88gts 19
  • Asynchronous authenticator?

    Asynchronous authenticator?

    It would be nice to be able in a web application to show the auth url then wait for the user to provide the url including the code through a form submission. Any idea how I could achieve that?

    opened by morpheus65535 18
  • HTTPError: 401 Client Error: Unauthorized for url: https://owner-api.teslamotors.com/api/1/vehicles

    HTTPError: 401 Client Error: Unauthorized for url: https://owner-api.teslamotors.com/api/1/vehicles

    I've had a data collection program running for many months now without issue and has picked up successfully with the cached tokens after every restart. Today it failed with the following:

    Traceback (most recent call last): File "/mnt/seagate/private/Python/tesla/Julia.py", line 393, in vehicles = tesla.vehicle_list() File "/usr/local/lib/python2.7/dist-packages/teslapy/init.py", line 384, in vehicle_list return [Vehicle(v, self) for v in self.api('VEHICLE_LIST')['response']] File "/usr/local/lib/python2.7/dist-packages/teslapy/init.py", line 379, in api return self.request('GET', uri, params=kwargs) File "/usr/local/lib/python2.7/dist-packages/teslapy/init.py", line 148, in request response.raise_for_status() # Raise HTTPError, if one occurred File "/home/pi/.local/lib/python2.7/site-packages/requests/models.py", line 940, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://owner-api.teslamotors.com/api/1/vehicles

    I also tried using another program which is closely based on one of your sample programs and it fails with same error.

    I updated to the very latest TeslaPy (2.3.0) but no change.

    The token was refreshed on 2022-01-07 19:54:58 and has an expiry of 2022-02-21 19:54:58 (dates are in UK format).

    As this has just started to fail I'm not sure if this is a temporary fault with the Tesla infrastructure or if there has been a significant change again.

    The official Tesla App is still working correctly at the moment.

    Would appreciate any advice on how to further diagnose this problem.

    opened by Les-A 15
  • ValueError: Credentials rejected. Recaptcha is required

    ValueError: Credentials rejected. Recaptcha is required

    Hi,

    recently I'm getting this error :

    Traceback (most recent call last): File "/home/gettoken.py", line 29, in main(sys.argv[1],sys.argv[2]) File "/home/gettoken.py", line 24, in main s = tesla.fetch_token() File "/opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages/teslapy/init.py", line 227, in fetch_token raise ValueError('. '.join(msgs)) ValueError: Credentials rejected. Recaptcha is required

    It seems that this error is raised before asking for the captcha solver? I'm using this code to solve captchas online via 2captcha, tit worked perfectlly until yesterday, and now seems that solve_captcha it's not executing

    def solve_captcha(svg):
        #print("solver")
        with open('captcha.svg', 'wb') as f:
            f.write(svg)
        solver = CaptchaSolver('2captcha', api_key='xxxx')
        cairosvg.svg2png(url='captcha.svg', write_to='captcha.png')
        raw_data = open('captcha.png', 'rb').read()
        solv = solver.solve_captcha(raw_data)
        #print(solv)
        return solv
    
    def main(user, pwd):
         with teslapy.Tesla(user, pwd) as tesla:
              tesla.captcha_solver = solve_captcha   
              s = tesla.fetch_token()
              print(tesla.token)
              return tesla.token
    

    thanks!

    opened by totiherms 13
  • Feature request: streaming API support

    Feature request: streaming API support

    Would be great if this could support the streaming API as well, as it allows for more efficient updates than constantly polling the normal API endpoints. While the unofficial Tesla API documentation doesn't document the streaming API, the code apparently does support it. There are various other projects as well that support the streaming API.

    opened by marcone 12
  • Captcha issue

    Captcha issue

    Hello,

    Looks like tesla changed something.

    Traceback (most recent call last):
      File "/usr/local/scripts/teslacli/teslacli.py", line 40, in <module>
        main()
      File "/usr/local/scripts/teslacli/teslacli.py", line 31, in main
        tesla = fetch_tesla()
      File "/usr/local/scripts/teslacli/teslacli.py", line 16, in fetch_tesla
        tesla.fetch_token()
      File "/usr/local/scripts/teslacli/venv/lib/python3.9/site-packages/teslapy/__init__.py", line 210, in fetch_token
        raise ValueError('. '.join(msgs))
    ValueError: Credentials rejected. Captcha is required. Captcha does not match
    

    The first GET to oauth2/v3/authorize does not ask for a captcha, but after POST'ing username / password it rejects the login, and a new form is presented. Looks identical to the previous, but now a captcha is requested. teslapy doesn't handle this correctly.

    Had to copy this in (__init__.py after line 198) to check for it:

            form = HTMLForm(response.text)
            # Retrieve captcha image if required
            if 'captcha' in form:
                response = oauth.get(self.sso_base + 'captcha')
                response.raise_for_status()  # Raise HTTPError, if one occurred
                form['captcha'] = self.captcha_solver(response.content)
                if not form['captcha']:
                    raise ValueError('Missing captcha response')
                # Submit login credentials to get authorization code through redirect
                form.update({'identity': self.email, 'credential': self.password})
                response = oauth.post(self.sso_base + 'oauth2/v3/authorize',
                                      data=form, allow_redirects=False)
    
    opened by gaardiolor 10
  • Crash in vehicle_list()

    Crash in vehicle_list()

    Got the following crash this morning. I've 'bolded' the line that I think in my source code generated the crash. I'm using a refresh token to connect. It runs without issue for several hours. Not sure if it's about the access token expiring. The next expiration is today at 11:02:00 PM local time. I'll see if it does it then.

    The source is at https://github.com/SylvainGa/TeslaRainCheck

    
    Apr 15 11:31:06 weewx python3[20670]: Traceback (most recent call last):
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    Apr 15 11:31:06 weewx python3[20670]:     chunked=chunked)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
    Apr 15 11:31:06 weewx python3[20670]:     six.raise_from(e, None)
    Apr 15 11:31:06 weewx python3[20670]:   File "<string>", line 3, in raise_from
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
    Apr 15 11:31:06 weewx python3[20670]:     httplib_response = conn.getresponse()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse
    Apr 15 11:31:06 weewx python3[20670]:     response.begin()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3.7/http/client.py", line 310, in begin
    Apr 15 11:31:06 weewx python3[20670]:     version, status, reason = self._read_status()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3.7/http/client.py", line 279, in _read_status
    Apr 15 11:31:06 weewx python3[20670]:     raise RemoteDisconnected("Remote end closed connection without"
    Apr 15 11:31:06 weewx python3[20670]: http.client.RemoteDisconnected: Remote end closed connection without response
    Apr 15 11:31:06 weewx python3[20670]: During handling of the above exception, another exception occurred:
    Apr 15 11:31:06 weewx python3[20670]: Traceback (most recent call last):
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send
    Apr 15 11:31:06 weewx python3[20670]:     timeout=timeout
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    Apr 15 11:31:06 weewx python3[20670]:     _stacktrace=sys.exc_info()[2])
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 367, in increment
    Apr 15 11:31:06 weewx python3[20670]:     raise six.reraise(type(error), error, _stacktrace)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/six.py", line 692, in reraise
    Apr 15 11:31:06 weewx python3[20670]:     raise value.with_traceback(tb)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    Apr 15 11:31:06 weewx python3[20670]:     chunked=chunked)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 384, in _make_request
    Apr 15 11:31:06 weewx python3[20670]:     six.raise_from(e, None)
    Apr 15 11:31:06 weewx python3[20670]:   File "<string>", line 3, in raise_from
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 380, in _make_request
    Apr 15 11:31:06 weewx python3[20670]:     httplib_response = conn.getresponse()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3.7/http/client.py", line 1352, in getresponse
    Apr 15 11:31:06 weewx python3[20670]:     response.begin()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3.7/http/client.py", line 310, in begin
    Apr 15 11:31:06 weewx python3[20670]:     version, status, reason = self._read_status()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3.7/http/client.py", line 279, in _read_status
    Apr 15 11:31:06 weewx python3[20670]:     raise RemoteDisconnected("Remote end closed connection without"
    Apr 15 11:31:06 weewx python3[20670]: urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
    Apr 15 11:31:06 weewx python3[20670]: During handling of the above exception, another exception occurred:
    Apr 15 11:31:06 weewx python3[20670]: Traceback (most recent call last):
    Apr 15 11:31:06 weewx python3[20670]:   File "/home/pi/tesla/check_tesla_windows_mqtt.py", line 216, in <module>
    Apr 15 11:31:06 weewx python3[20670]:     client.loop_forever()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 1756, in loop_forever
    Apr 15 11:31:06 weewx python3[20670]:     rc = self._loop(timeout)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 1164, in _loop
    Apr 15 11:31:06 weewx python3[20670]:     rc = self.loop_read()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 1556, in loop_read
    Apr 15 11:31:06 weewx python3[20670]:     rc = self._packet_read()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 2439, in _packet_read
    Apr 15 11:31:06 weewx python3[20670]:     rc = self._packet_handle()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 3033, in _packet_handle
    Apr 15 11:31:06 weewx python3[20670]:     return self._handle_publish()
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 3327, in _handle_publish
    Apr 15 11:31:06 weewx python3[20670]:     self._handle_on_message(message)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 3570, in _handle_on_message
    Apr 15 11:31:06 weewx python3[20670]:     on_message(self, self._userdata, message)
    Apr 15 11:31:06 weewx python3[20670]:   File "/home/pi/tesla/check_tesla_windows_mqtt.py", line 87, in on_message
    **Apr 15 11:31:06 weewx python3[20670]:     vehicles = tesla.vehicle_list()**
    Apr 15 11:31:06 weewx python3[20670]:   File "./TeslaPy/teslapy/__init__.py", line 351, in vehicle_list
    Apr 15 11:31:06 weewx python3[20670]:     return [Vehicle(v, self) for v in self.api('VEHICLE_LIST')['response']]
    Apr 15 11:31:06 weewx python3[20670]:   File "./TeslaPy/teslapy/__init__.py", line 347, in api
    Apr 15 11:31:06 weewx python3[20670]:     **{arg_name: kwargs})
    Apr 15 11:31:06 weewx python3[20670]:   File "./TeslaPy/teslapy/__init__.py", line 141, in request
    Apr 15 11:31:06 weewx python3[20670]:     response = super(Tesla, self).request(method, url, **kwargs)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/requests_oauthlib/oauth2_session.py", line 360, in request
    Apr 15 11:31:06 weewx python3[20670]:     headers=headers, data=data, **kwargs)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
    Apr 15 11:31:06 weewx python3[20670]:     resp = self.send(prep, **send_kwargs)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
    Apr 15 11:31:06 weewx python3[20670]:     r = adapter.send(request, **kwargs)
    Apr 15 11:31:06 weewx python3[20670]:   File "/usr/lib/python3/dist-packages/requests/adapters.py", line 498, in send
    Apr 15 11:31:06 weewx python3[20670]:     raise ConnectionError(err, request=request)
    Apr 15 11:31:06 weewx python3[20670]: requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
    Apr 15 11:31:07 weewx systemd[1]: check_tesla_windows_mqtt.service: Main process exited, code=exited, status=1/FAILURE
    Apr 15 11:31:07 weewx systemd[1]: check_tesla_windows_mqtt.service: Failed with result 'exit-code'.
    
    opened by SylvainGa 9
  • HTTP Status 400 when querying historic battery data

    HTTP Status 400 when querying historic battery data

    I have a powerwall and try to get historic data via tesla.battery_list()[0].get_history_data().

    The built request for this however seems to be invalid. I get the following reported:

    HTTPError: 400 Client Error: kind `savings` is not supported for url: https://owner-api.teslamotors.com/api/1/energy_sites/2653779/history?kind=savings&period=day&end_date=2022-04-14T00%3A13%3A08.000Z
    
    opened by realdadfish 9
  • TypeError: unsupported format string passed to NoneType.__format__

    TypeError: unsupported format string passed to NoneType.__format__

    HI,

    treid your little programs. the menu.py threw me this:

    Traceback (most recent call last): File "/home/pos/python/./menu.py", line 347, in main() File "/home/pos/python/./menu.py", line 326, in main menu(vehicles[idx]) File "/home/pos/python/./menu.py", line 180, in menu show_vehicle_data(vehicle.get_vehicle_data()) File "/home/pos/python/./menu.py", line 75, in show_vehicle_data print(fmt.format(door.get(ve['ft']), door.get(ve['rt']))) TypeError: unsupported format string passed to NoneType.format

    opened by cycl0ne 5
  • sync_wake_up Works Fine With One Car But Sometimes Times Out On Another

    sync_wake_up Works Fine With One Car But Sometimes Times Out On Another

    One car (mine - 2022 Model Y) tends to handle the sync_wake_up() call just fine. Another Tesla owner who is running my code (another Model Y - pre-2022) and it times out relatively frequently on the sync_wake_up() call.

    I believe the timeout can be changed - although I haven't looked into it closely or how to use it.

    I'm really more interested in understanding why the difference in behavior. Are there car differences that can cause this? Maybe usage differences (my friend's car doesn't get a ton of use so....for example.....is the longer it's asleep does it take longer to wake it up?).

    I'm mostly just curious as to why....although any guidance from someone who has messed with changing timeout would also be of interest.

    Thanks.

    This is what happened after I added a 'timeout=300' to sync_wake_up. Prior to doing that it would exit with a timeout error.

    sc

    opened by Haselmaier 3
  • 'drive_state' Data Sometimes Not Provided Following 'get_vehicle_data'?

    'drive_state' Data Sometimes Not Provided Following 'get_vehicle_data'?

    It appears that sometimes the 'drive_state' dataset is not provided with a get_vehicle_data call.

    Could that be possible.....or maybe there's an issue on my end? My code will run for quite a while - checking some fields in that drive_state section. Then I'll get the following and aborts:

    Traceback (most recent call last): File "/home/pi/Desktop/Tesla/Suncatcherv5.3.py", line 292, in at_home, tpi,odometer_short = tesla_plugged_in() File "/home/pi/Desktop/Tesla/Suncatcherv5.3.py", line 16, in tesla_plugged_in lat_raw = cardata['drive_state']['latitude'] File "/home/pi/.local/lib/python3.9/site-packages/teslapy/init.py", line 610, in missing

    The errors/exceptions are pretty lengthy.....but this is the beginning. I've created a test program to only get the data and print it out. Sometimes that section is there....and sometimes it's not.

    Thoughts?

    Thanks!

    opened by Haselmaier 5
  • WebSocket does not terminate in streaming

    WebSocket does not terminate in streaming

    Hi there,

    I have been playing around with the streaming functionality, but I'm getting some weird behaviour. I have set retry=3 so if wsapp terminates, it tries to reconnect up to 3 times. However, after the disconnect, it seems like it connects to the server again, but does not receive any messages anymore and it gets stuck in that state (web socket still running).

    I have left ping_interval=10 to its default, and tried adding ping_timeout=5 to see if it fixes it, but have not been successful. Have you faced this issue before?

    I'm wondering if this perhaps could be due to the vehicle becoming unavailable? i.e. no data connectivity?

    opened by amirhmk 1
  • Calling api() returns 404 error

    Calling api() returns 404 error

    invite.py

    import teslapy
    import webview
    
    email = input("Email address: ")
    
    def custom_auth(url):
    	result = [""]
    	window = webview.create_window("Login", url)	
    	def on_loaded():
    		result[0] = window.get_current_url()
    		if "void/callback" in result[0].split("?")[0]:
    			window.destroy()
    	try:
    		window.events.loaded += on_loaded
    	except AttributeError:
    		window.loaded += on_loaded		
    	webview.start()
    	return result[0]	
    
    with teslapy.Tesla(email, authenticator=custom_auth) as tesla:
    	tesla.fetch_token()
    
    with teslapy.Tesla(email) as tesla:
    	vehicles = tesla.vehicle_list()
    	vehicle_id = vehicles[0]["vehicle_id"]
    	vehicle_dict = {"vehicle_id": vehicle_id}
    	endpoint ="FETCH_VEHICLE_SHARE_INVITES"
    	tesla.api(endpoint,vehicle_dict)
    

    Terminal output:

    Traceback (most recent call last):

    File "invite.py", line 25, in tesla.api(endpoint,vehicle_dict)

    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/teslapy/init.py", line 363, in api return self.request(endpoint['TYPE'], uri, serialize, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/teslapy/init.py", line 155, in request response.raise_for_status() # Raise HTTPError, if one occurred ^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self)

    requests.exceptions.HTTPError: 404 Client Error: not_found for url: https://owner-api.teslamotors.com/api/1/vehicles/265113217424/invitations

    opened by hafley 1
  • Security issue with cache.json

    Security issue with cache.json

    Thank you for such an excellent library.

    The is a security issue with this, cache.json has sensitive information. However, it is currently default to world readable. This means anyone on the machine can access the login credential.

    opened by reubenkan 1
Releases(v2.7.0)
  • v2.7.0(Dec 11, 2022)

  • v.2.6.0(Jul 3, 2022)

    This version supports both pywebview 3.6+ and older versions. New v4.9 API endpoints have been added as well as get_latest_vehicle_data() and time utility methods.

    Source code(tar.gz)
    Source code(zip)
  • v2.5.0(Apr 23, 2022)

    This version has improved account registered region detection and has an option to specify the SSO base URL. It includes support for staged authorization and a customizable app user agent string. The default kind for get_history_data() and get_calendar_history_data() has been changed to energy. New API endpoints have been added as well as other minor improvements and fixes.

    Source code(tar.gz)
    Source code(zip)
  • v2.4.0(Jan 30, 2022)

    This version supports third-party refresh tokens. New option codes have been added including the ability to look up a specific code. A convenience method has been added to determine vehicle availability. New API endpoints have been added and other minor improvements.

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(Dec 29, 2021)

  • v2.2.0(Nov 28, 2021)

  • v2.1.0(Oct 29, 2021)

    This release uses the SSO token instead of a JWT bearer to access the API and uses updated endpoints, such as setting charging amperage and scheduled departure. An optional timeout parameter has been added to the Tesla class constructor and the default authenticator method now prints the authentication URL to stdout if no web browser is available.

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Sep 12, 2021)

    This release no longer supports headless login as Tesla added ReCaptcha to the SSO service. Added support for a pluggable authentication method and other minor improvements.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Aug 22, 2021)

  • v1.4.0(Jul 14, 2021)

  • v1.3.0(Jun 6, 2021)

  • v1.2.0(May 1, 2021)

  • v1.1.0(Mar 11, 2021)

  • v1.0.0(Feb 22, 2021)

Owner
Tim Dorssers
Tim Dorssers
Slack Developer Kit for Python

Python Slack SDK The Slack platform offers several APIs to build apps. Each Slack API delivers part of the capabilities from the platform, so that you

SlackAPI 3.5k Jan 02, 2023
Best badge generator API to count visitors of your Repository / Account 🥇

github visitors badge A badge generator service to count visitors of your markdown file. Hello every one! In this post, I will tell you the story of m

Sᴇɴᴜ Gᴀᴍᴇʀ Bᴏʏ 〽 3 Dec 11, 2021
This is a bot which you can use in telegram to spam without flooding and enjoy being in the leaderboard

Telegram-Count-spamming-Bot This is a bot which you can use in telegram to spam without flooding and enjoy being in the leaderboard You can avoid the

Lalan Kumar 1 Oct 23, 2021
The official wrapper for spyse.com API, written in Python, aimed to help developers build their integrations with Spyse.

Python wrapper for Spyse API The official wrapper for spyse.com API, written in Python, aimed to help developers build their integrations with Spyse.

Spyse 15 Nov 22, 2022
Images to PDF Telegram Bot

ilovepdf Convert Images to PDF Bot This bot will helps you to create pdf's from your images [without leaving telegram] 😉 By Default: your pdf fil

✰Naͥbiͣlͫ A Navab✰ 116 Dec 29, 2022
Home Assistant Hilo Integration via HACS

BETA This is a beta release. There will be some bugs, issues, etc. Please bear with us and open issues in the repo. Hilo Hilo integration for Home Ass

66 Dec 23, 2022
A discord bot that moderates your server!

Staff Bot para Discord O que é? É um bot que modera o seu servidor no Discord, apagando mensagens indesejadas que os usuários mandem! Como usar Primei

Isac Gonçalves Cunha 3 Oct 07, 2021
Create custom Vanity URLs for Discord without 30 boosts

CustomVanity - Made by udp#6666 aka Apolo - OpenSource Custom Discord Vanity Creator How To Use Open CustomVanity.py Write your server invite code Wri

apolo 17 Aug 23, 2022
Twitter feed of newly published articles in Limnology

limnopapers Code to monitor limnology RSS feeds and tweet new articles. Scope The keywords and journal choices herein aim to focus on limnology (the s

7 Dec 20, 2022
Takes upcoming items from a Google Calendar and posts them to Slack.

Google Calendar to Slack by Jason Snell - [email protected] This Python s

6 Aug 21, 2022
A visualization of people a user follows on Twitter

Twitter-Map This software allows the user to create maps of Twitter accounts. Installation git clone Oliver Greenwood 12 Jul 20, 2022

HelpDESK Dynamics

Helpdesk Application The project is a Helpdesk application (Helpdesk dynamics) where staff of an organization can raise and assign job/trouble tickets

Okeoma Ihunwo 0 Nov 14, 2021
A delightful and complete interface to GitHub's amazing API

ghapi A delightful and complete interface to GitHub's amazing API ghapi provides 100% always-updated coverage of the entire GitHub API. Because we aut

fast.ai 428 Jan 08, 2023
Trading bot rienforcement with python

Trading_bot_rienforcement System: Ubuntu 16.04 GPU (GeForce GTX 1080 Ti) Instructions: In order to run the code: Make sure to clone the stable baselin

1 Oct 22, 2021
NMux is the version of the NMscript in termux

NMscript-termux-version Termux-Version NMux is the termux version of NMscript which is NMscript? NMscript is a simple script written in Python that he

cabeson sin z 5 Apr 23, 2022
Gera um PDF, logo depois de você responder um questionário simples, e envia para o e-mail que você informar.

PDF generator and send it for your email Criador: Francisco Robson de O. Dutra Filho Repositório criado no dia 18/09/2021 Instagram: @robsondutra_ Sob

8 Nov 22, 2021
The accompanying code for the paper "GMAT: Global Memory Augmentation for Transformers" (Ankit Gupta and Jonathan Berant).

GMAT: Global Memory Augmentation for Transformers This repository contains the accompanying code for the paper: "GMAT: Global Memory Augmentation for

Ankit Gupta 7 Oct 21, 2021
Automating whatsapp with python

whatsapp-automation Automating whatsapp with python used on this project pyautogui pywhatkit pyttsx3 SpeechRecognition colorama embedded in python tim

Miguel 60 Nov 21, 2022
Block Telegram's new

Telegram Channel Blocker Bot Channel go away! This bot is used to delete and ban message sent by channel How this appears? The reason this appears ple

16 Feb 15, 2022
Anti-league-discordbot - Harrasses imbeciles for playing league of legends

anti-league-discordbot harrasses imbeciles for playing league of legends Running

Chris Clem 2 Feb 12, 2022