{"id":13693121,"url":"https://github.com/zmsp/python-my-tesla","last_synced_at":"2025-05-02T21:31:24.309Z","repository":{"id":56010389,"uuid":"136684688","full_name":"zmsp/python-my-tesla","owner":"zmsp","description":"Python Wrapper for Tesla API","archived":false,"fork":false,"pushed_at":"2024-02-23T17:30:05.000Z","size":23,"stargazers_count":27,"open_issues_count":4,"forks_count":10,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-11T07:50:07.727Z","etag":null,"topics":["car","python","tesla","tesla-api"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmsp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-06-09T02:40:23.000Z","updated_at":"2022-12-19T21:16:00.000Z","dependencies_parsed_at":"2024-04-08T02:33:43.188Z","dependency_job_id":null,"html_url":"https://github.com/zmsp/python-my-tesla","commit_stats":{"total_commits":11,"total_committers":3,"mean_commits":"3.6666666666666665","dds":"0.36363636363636365","last_synced_commit":"73d58f71783d1a4dd39c33591a01839ad6c9b818"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmsp%2Fpython-my-tesla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmsp%2Fpython-my-tesla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmsp%2Fpython-my-tesla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmsp%2Fpython-my-tesla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmsp","download_url":"https://codeload.github.com/zmsp/python-my-tesla/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224337286,"owners_count":17294698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["car","python","tesla","tesla-api"],"created_at":"2024-08-02T17:01:05.883Z","updated_at":"2024-11-12T19:30:27.028Z","avatar_url":"https://github.com/zmsp.png","language":"Python","funding_links":[],"categories":["API Wrappers"],"sub_categories":[],"readme":"# Install\nYou can install latest stable version from PyPI:\n\n```pip3 install myTesla```\n\n# Usage:\n\n```python\nimport myTesla\n\nmy_model_s = myTesla.connect('test@example.com', 'MySecurePassword')\ncharge_state = my_model_s.charge_state()\ndoor_lock = my_model_s.door_lock()\nmy_model_s.honk_horn()\nprint(charge_state)\nprint(door_lock)\n```\n\n\n\n\n# Documentation: \nThis program was build using API documentation listed on  [https://tesla-api.timdorr.com/](https://tesla-api.timdorr.com/.). The functions closely follow the API documentation. Please see this page for detailed information of the function parameters.\n\n## Initiating connection\nIn order to initiate connection, the following information is needed.  \n\nThe arguements for initiating the connection is the following:  \n\n```python\ndef __init__(self, email='', password='',\n            vehicle_index=0,\n            base_url=\"https://owner-api.teslamotors.com\",\n            access_token=None,\n            tesla_backend_token_response=None,\n            ownerapi_client_id=\"81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384\",\n            ownerapi_client_secret=\"c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3\",\n            )\n```\n### Connection arguement description descriptioons: \n\nThe details of these parameters can be found on this page See https://tesla-api.timdorr.com/api-basics/authentication\n* `email`: Your mytesla username\n* `password`: Your mytesla password\n* `vehicle_index`: Index of your vehicle, if you have multiple vehicles\n* `access_token`:  # Access token can be used instead of email and password.\n* `tesla_backend_token_response`: # A backend response can be used instead of email/password or accesss token. The format of the backend response is documented here https://tesla-api.timdorr.com/api-basics/authentication#response\n* `base_url`: base_url is taken from https://timdorr.docs.apiary.io/#reference/authentication/tokens/get-an-access-token\n* `OWNERAPI_CLIENT_ID`: OWNERAPI_CLIENT_ID is taken from https://tesla-api.timdorr.com/api-basics/authentication#post-oauth-token-grant_type-password\n* `OWNERAPI_CLIENT_SECRET`:  OWNERAPI_CLIENT_SECRET is taken from https://tesla-api.timdorr.com/api-basics/authentication#post-oauth-token-grant_type-password\n\n\n## Function Descriptions\n* `myTesla.connect.get_access_token`: Returns access token information that could be used to authenticate instead of email/password.\n* `myTesla.connect.select_vehicle`: Switches car based on index/vin/or vehicle_id if you have multiple vehicle on your account.\n* `myTesla.connect.vehicles`: Retrieve a list of your owned vehicles\n* `myTesla.connect.mobile_enabled`: Determines if mobile access to the vehicle is enabled.\n* `myTesla.connect.charge_state`: Returns the state of charge in the battery.\n* `myTesla.connect.climate_state`: Returns the current temperature and climate control state.\n* `myTesla.connect.drive_state`: Returns the driving and position state of the vehicle.\n* `myTesla.connect.gui_settings`: Returns various information about the GUI settings of the car, such as unit format and range display.\n* `myTesla.connect.vehicle_state`: Returns the vehicle's physical state, such as which doors are open.\n* `myTesla.connect.wake_up`: Wakes up the car from the sleep state. Necessary to get some data from the car.\n* `myTesla.connect.set_valet_mode`: Sets valet mode on or off with a PIN to disable it from within the car.\n* `myTesla.connect.reset_valet_pin`: Resets the PIN set for valet mode, if set.\n* `myTesla.connect.charge_port_door_open`: Opens the charge port.\n* `myTesla.connect.charge_standard`: Set the charge mode to standard\n* `myTesla.connect.charge_max_range`: Set the charge mode to max range\n* `myTesla.connect.set_charge_limit`:Set the charge limit to a custom percentage.\n* `myTesla.connect.charge_start`: Start charging. Must be plugged in, have power available, and not have reached your charge limit.\n* `myTesla.connect.charge_stop`: Stop charging. Must already be charging.\n* `myTesla.connect.honk_horn`: Honk horn\n* `myTesla.connect.door_unlock`:  Unlock the car's doors.\n* `myTesla.connect.door_lock`: Lock the car doors.\n* `myTesla.connect.set_temps`: Set the temperature target for the HVAC system.\n* `myTesla.connect.auto_conditioning_start`: Start the climate control system. Will cool or heat automatically, depending on set temperature.\n* `myTesla.connect.auto_conditioning_stop`: Stop the climate control system.\n* `myTesla.connect.sun_roof_control`: Controls the car's panoramic roof, if installed.\n* `myTesla.connect.remote_start_drive`: Start the car for keyless driving. Must start driving within 2 minutes of issuing this request.\n* `myTesla.connect.trunk_open`: Open the trunk or frunk. Call the endpoint again to close (this only works on rear powered trunks)\n\n\n# Legal Agreement/ Disclaimer\nThis program is provided as is. This program is not supported or endorsed by Tesla Motors. By using this software, you agree to not hold me (Zobair Shahadat ) and any of the contributers liable for anything.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmsp%2Fpython-my-tesla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmsp%2Fpython-my-tesla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmsp%2Fpython-my-tesla/lists"}