{"id":13846900,"url":"https://github.com/alandtse/tesla","last_synced_at":"2025-05-15T04:04:21.808Z","repository":{"id":37415908,"uuid":"362700564","full_name":"alandtse/tesla","owner":"alandtse","description":"Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.","archived":false,"fork":false,"pushed_at":"2025-05-12T18:13:44.000Z","size":1621,"stargazers_count":655,"open_issues_count":157,"forks_count":109,"subscribers_count":25,"default_branch":"dev","last_synced_at":"2025-05-12T19:28:56.979Z","etag":null,"topics":["hacktoberfest","home-assistant","home-assistant-component","integration","tesla"],"latest_commit_sha":null,"homepage":"","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/alandtse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-29T05:29:15.000Z","updated_at":"2025-05-06T00:06:28.000Z","dependencies_parsed_at":"2024-05-20T21:02:13.534Z","dependency_job_id":"8cfa88f5-2210-486b-b7ee-a8ec56948a44","html_url":"https://github.com/alandtse/tesla","commit_stats":{"total_commits":402,"total_committers":55,"mean_commits":"7.3090909090909095","dds":0.7238805970149254,"last_synced_commit":"3760ff380d7370b0ee01947d2905b7097442ba0e"},"previous_names":[],"tags_count":108,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alandtse%2Ftesla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alandtse%2Ftesla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alandtse%2Ftesla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alandtse%2Ftesla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alandtse","download_url":"https://codeload.github.com/alandtse/tesla/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270640,"owners_count":22042858,"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":["hacktoberfest","home-assistant","home-assistant-component","integration","tesla"],"created_at":"2024-08-04T18:00:49.782Z","updated_at":"2025-05-15T04:04:21.774Z","avatar_url":"https://github.com/alandtse.png","language":"Python","funding_links":["https://www.buymeacoffee.com/alandtse"],"categories":["Tips and Notes","Custom Integrations"],"sub_categories":["Home Assistant Integration","🚗 Cars \u0026 EV charging"],"readme":"# Tesla Custom Integration\n\n[![GitHub Release][releases-shield]][releases]\n![GitHub all releases][download-all]\n![GitHub release (latest by SemVer)][download-latest]\n[![GitHub Activity][commits-shield]][commits]\n\n[![License][license-shield]][license]\n\n[![hacs][hacsbadge]][hacs]\n![Project Maintenance][maintenance-shield]\n[![BuyMeCoffee][buymecoffeebadge]][buymecoffee]\n\n[![Discord][discord-shield]][discord]\n[![Community Forum][forum-shield]][forum]\n\nA fork of the previous official Tesla integration in Home Assistant which has been removed due to Tesla login issues. Do not report issues to Home Assistant.\n\nTo use the component, you will need an application to generate a Tesla refresh token:\n\n- Android: [Tesla Tokens](https://play.google.com/store/apps/details?id=net.leveugle.teslatokens)\n- iOS: [Auth App for Tesla](https://apps.apple.com/us/app/auth-app-for-tesla/id1552058613)\n- TeslaFi: [Tesla v3 API Tokens](https://support.teslafi.com/en/communities/1/topics/16979-tesla-v3-api-tokens)\n- Chromium/Edge: [Chromium Tesla Token Generator](https://github.com/DoctorMcKay/chromium-tesla-token-generator)\n\n## Installation\n\n1. Use [HACS](https://hacs.xyz/docs/setup/download), in `HACS \u003e Integrations \u003e Explore \u0026 Add Repositories` search for \"Tesla\". After adding this `https://github.com/alandtse/tesla` as a custom repository. Skip to 7.\n2. If you do not have HACS, use the tool of choice to open the directory (folder) for your HA configuration (where you find `configuration.yaml`).\n3. If you do not have a `custom_components` directory (folder) there, you need to create it.\n4. In the `custom_components` directory (folder) create a new folder called `tesla_custom`.\n5. Download _all_ the files from the `custom_components/tesla_custom/` directory (folder) in this repository.\n6. Place the files you downloaded in the new directory (folder) you created.\n7. Restart Home Assistant.\n8. Add the integration: [![Add Integration][add-integration-badge]][add-integration] or in the HA UI go to \"Settings\" -\u003e \"Devices \u0026 Services\" then click \"+\" and search for \"Tesla Custom Integration\".\n9. For most vehicles, you will need to the Tesla Fleet API Proxy (see [below](#tesla-fleet-api-proxy)).\n\nNote: This integration will wake up your vehicle(s) during installation.\n\n## Tesla Fleet API Proxy\n\nTesla has [deprecated](https://developer.tesla.com/docs/fleet-api) the Owner API for _most_ vehicles in favor of a new Fleet API with end-to-end encryption. You'll know you're affected if you see `teslajsonpy.exceptions.TeslaException` errors in the log when attempting to send commands (sensors will work regardless).\n\nIf your vehicle is affected by this (most likely), you'll need to install the [Tesla HTTP Proxy](https://github.com/llamafilm/tesla-http-proxy-addon) add-on and configure this component to use it. This requires a complex setup; see [here](https://github.com/alandtse/tesla/wiki/Proxy-setup-with-DuckDNS-and-NGinx) for step-by-step instructions.\n\n\u003c!----\u003e\n\n## Usage\n\nThe `Tesla` integration offers integration with the [Tesla](https://auth.tesla.com/login) cloud service and provides presence detection as well as sensors such as charger state and temperature.\n\nThis integration provides the following entities for vehicles:\n\n- Binary sensors - charger connection, charging status, car online, parking brake, car asleep, and door status.\n- Buttons - horn, flash lights, wake up\u003csup\u003e1\u003c/sup\u003e, force data update\u003csup\u003e1\u003c/sup\u003e, trigger HomeLink, and remote start. **Note:** The HomeLink button is disabled by default as some vehicles don't have this option. Enable via configuration/entities if desired.\n- Climate - turn HVAC on/off, set target temperature, set preset modes (defrost, keep on, dog mode and camp mode).\n- Device tracker - car location\u003csup\u003e1\u003c/sup\u003e, and active route destination.\n- Cover - Charger door, frunk, trunk, and windows.\n- Locks - door lock, and charge port latch lock.\n  **Note:** Set `state` to `heat_cool` or `off` to enable/disable your Tesla's climate system via a scene.\n- Selects - seat heaters and cabin overheat protection\u003csup\u003e2\u003c/sup\u003e. **Note:** Turning on a heated seat will cause the climate to turn on.\n- Sensors - battery level, charge rate, energy added, charger power, inside/outside temperature, odometer, estimated range, time charge complete, TPMS pressure, active route arrival time and distance to arrival.\n- Switches - heated steering wheel, charger, sentry mode, polling, and valet mode.\u003csup\u003e1\u003c/sup\u003e.\n- Update - software update\u003csup\u003e2\u003c/sup\u003e\n\n\u003csup\u003e1\u003c/sup\u003e _Diagnostics entities._\u003cbr/\u003e\n\u003csup\u003e2\u003c/sup\u003e _Configuration entities._\n\nThis integration provides the following entities for energy sites:\n\n- Binary sensors - Powerwall charging and grid status.\n- Selects - grid charging, export rule and operation mode.\n- Sensors - solar power, grid power, load power, battery level, battery Wh remaining and backup reserve.\n\n## Options\n\nTesla options are set via **Configuration** -\u003e **Integrations** -\u003e **Tesla** -\u003e **Options**.\n\n- Seconds between polling - referred to below as the `polling_interval`.\n- Wake cars on start - Whether to wake sleeping cars on Home Assistant startup. This allows a user to choose whether cars should continue to sleep (and not update information) or to wake up the cars potentially interrupting long term hibernation and increasing vampire drain.\n- Polling policy - When do we actively poll the car to get updates, and when do we try to allow the car to sleep. See [the Wiki](https://github.com/alandtse/tesla/wiki/Polling-policy) for more information.\n- Sync Data from TeslaMate via MQTT - Enable syncing of Data from an TeslaMate instance via MQTT, essentially enabling the Streaming API for updates. This requires MQTT to be configured in Home Assistant.\n\n## Potential Battery impacts\n\nHere are some things to consider and understand when implementing the Tesla component and its potential effect on your car's battery.\n\n- The `polling_interval` determines when to check if the car is awake and new information is available, but the Tesla integration will not wake up a sleeping car during this polling. By default, the polling will occur every 660 seconds. Polling a car too frequently can keep the car awake and drain the battery. Different firmware versions and measurements of Tesla cars can take from 11 to 15 minutes for sleep mode to occur. There is no official information on sleep mode timings so your mileage may vary and you should experiment with different polling times for an optimal experience.\n- The car will, however, be woken up when a command is actively sent to the car, such as door unlock or turning on the HVAC. It will then also fetch updated information while the car is awake based on the `polling_interval`.\n- The car can intentionally be woken up to fetch recent information by sending a harmless command, for example, a lock command. This can be used in an automation to, for example, ensure that updated information is available every morning. (Note that the command must be valid for that specific car model. So locking the frunk of a Model 3 will not wake up that car).\n- You can also toggle the `polling switch` on/off to disable polling of the vehicle completely via automations or the Lovelace UI.\n\n## Contributions are welcome!\n\nIf you want to contribute to this please read the [Contribution guidelines](CONTRIBUTING.md)\n\n_Component built with [integration_blueprint][integration_blueprint]._\n\n---\n\n[integration_blueprint]: https://github.com/custom-components/integration_blueprint\n[buymecoffee]: https://www.buymeacoffee.com/alandtse\n[buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge\n[commits-shield]: https://img.shields.io/github/commit-activity/w/alandtse/tesla?style=for-the-badge\n[commits]: https://github.com/alandtse/tesla/commits/main\n[hacs]: https://github.com/hacs/integration\n[hacsbadge]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge\n[discord]: https://discord.gg/Qa5fW2R\n[discord-shield]: https://img.shields.io/discord/330944238910963714.svg?style=for-the-badge\n[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge\n[forum]: https://community.home-assistant.io/\n[license]: LICENSE\n[license-shield]: https://img.shields.io/github/license/alandtse/tesla.svg?style=for-the-badge\n[maintenance-shield]: https://img.shields.io/badge/maintainer-Alan%20Tse%20%40alandtse-blue.svg?style=for-the-badge\n[releases-shield]: https://img.shields.io/github/release/alandtse/tesla.svg?style=for-the-badge\n[releases]: https://github.com/alandtse/tesla/releases\n[download-all]: https://img.shields.io/github/downloads/alandtse/tesla/total?style=for-the-badge\n[download-latest]: https://img.shields.io/github/downloads/alandtse/tesla/latest/total?style=for-the-badge\n[add-integration]: https://my.home-assistant.io/redirect/config_flow_start?domain=tesla_custom\n[add-integration-badge]: https://my.home-assistant.io/badges/config_flow_start.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falandtse%2Ftesla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falandtse%2Ftesla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falandtse%2Ftesla/lists"}