https://github.com/alandtse/tesla
Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.6%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Basic Info
Statistics
- Stars: 679
- Watchers: 23
- Forks: 114
- Open Issues: 162
- Releases: 111
Topics
Metadata Files
README.md
Tesla Custom Integration
A 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.
To use the component, you will need an application to generate a Tesla refresh token:
- Android: Tesla Tokens
- iOS: Auth App for Tesla
- TeslaFi: Tesla v3 API Tokens
- Chromium/Edge: Chromium Tesla Token Generator
Installation
- Use HACS, in
HACS > Integrations > Explore & Add Repositoriessearch for "Tesla". After adding thishttps://github.com/alandtse/teslaas a custom repository. Skip to 7. - 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). - If you do not have a
custom_componentsdirectory (folder) there, you need to create it. - In the
custom_componentsdirectory (folder) create a new folder calledtesla_custom. - Download all the files from the
custom_components/tesla_custom/directory (folder) in this repository. - Place the files you downloaded in the new directory (folder) you created.
- Restart Home Assistant.
- Add the integration:
or in the HA UI go to "Settings" -> "Devices & Services" then click "+" and search for "Tesla Custom Integration".
- For most vehicles, you will need to the Tesla Fleet API Proxy (see below).
Note: This integration will wake up your vehicle(s) during installation.
Tesla Fleet API Proxy
Tesla has deprecated 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).
If your vehicle is affected by this (most likely), you'll need to install the Tesla HTTP Proxy add-on and configure this component to use it. This requires a complex setup; see here for step-by-step instructions.
Usage
The Tesla integration offers integration with the Tesla cloud service and provides presence detection as well as sensors such as charger state and temperature.
This integration provides the following entities for vehicles:
- Binary sensors - charger connection, charging status, car online, parking brake, car asleep, and door status.
- Buttons - horn, flash lights, wake up1, force data update1, 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.
- Climate - turn HVAC on/off, set target temperature, set preset modes (defrost, keep on, dog mode and camp mode).
- Device tracker - car location1, and active route destination.
- Cover - Charger door, frunk, trunk, and windows.
- Locks - door lock, and charge port latch lock.
Note: Set
statetoheat_cooloroffto enable/disable your Tesla's climate system via a scene. - Selects - seat heaters and cabin overheat protection2. Note: Turning on a heated seat will cause the climate to turn on.
- 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.
- Switches - heated steering wheel, charger, sentry mode, polling, and valet mode.1.
- Update - software update2
1 Diagnostics entities.
2 Configuration entities.
This integration provides the following entities for energy sites:
- Binary sensors - Powerwall charging and grid status.
- Selects - grid charging, export rule and operation mode.
- Sensors - solar power, grid power, load power, battery level, battery Wh remaining and backup reserve.
Options
Tesla options are set via Configuration -> Integrations -> Tesla -> Options.
- Seconds between polling - referred to below as the
polling_interval. - 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.
- 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 for more information.
- 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.
Potential Battery impacts
Here are some things to consider and understand when implementing the Tesla component and its potential effect on your car's battery.
- The
polling_intervaldetermines 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. - 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. - 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).
- You can also toggle the
polling switchon/off to disable polling of the vehicle completely via automations or the Lovelace UI.
Contributions are welcome!
If you want to contribute to this please read the Contribution guidelines
Component built with integration_blueprint.
Owner
- Name: Alan Tse
- Login: alandtse
- Kind: user
- Website: https://www.buymeacoffee.com/alandtse
- Repositories: 29
- Profile: https://github.com/alandtse
GitHub Events
Total
- Create event: 5
- Release event: 3
- Issues event: 49
- Watch event: 82
- Delete event: 4
- Issue comment event: 219
- Push event: 89
- Pull request review comment event: 7
- Pull request review event: 14
- Pull request event: 28
- Fork event: 12
Last Year
- Create event: 5
- Release event: 3
- Issues event: 49
- Watch event: 82
- Delete event: 4
- Issue comment event: 219
- Push event: 89
- Pull request review comment event: 7
- Pull request review event: 14
- Pull request event: 28
- Fork event: 12
Committers
Last synced: 11 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Alan D. Tse | a****e@g****m | 111 |
| github-actions | g****s@g****m | 66 |
| github-actions | a****n@g****m | 40 |
| pre-commit-ci[bot] | 6****] | 31 |
| InTheDaylight14 | 6****4 | 25 |
| J. Nick Koston | n****k@k****g | 19 |
| Michael Benz | m****l@b****o | 12 |
| Carlin Hefner | 5****o | 11 |
| shred86 | 3****6 | 10 |
| ehendrix23 | h****k@h****m | 7 |
| Dag Stuan | D****n@g****m | 7 |
| Elliott Balsley | 3****m | 6 |
| Stephen Jones | s****s@r****m | 5 |
| dandelionclock | y****n@g****m | 4 |
| Olen | o****a@n****o | 4 |
| purcell-lab | 7****b | 3 |
| Christian Güdel | cg@d****h | 2 |
| Darren Jones | 1****y | 2 |
| Emniroll | 3****l | 1 |
| Doug Fultz | d****z | 1 |
| DoloresHA | c****2@g****m | 1 |
| Giovanni Iachello | 6****o | 1 |
| Ian Brown | i****n@c****m | 1 |
| Brian Gates | b****s@g****m | 1 |
| Brett Adams | B****7 | 1 |
| Andy Allsopp | a****p@g****m | 1 |
| semantic-release | s****e | 1 |
| kevin brintnall | k****t@r****t | 1 |
| gkwok1 | 5****1 | 1 |
| functionpointer | s****n@g****m | 1 |
| and 25 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 5 months ago
All Time
- Total issues: 230
- Total pull requests: 127
- Average time to close issues: about 1 month
- Average time to close pull requests: 16 days
- Total issue authors: 199
- Total pull request authors: 34
- Average comments per issue: 3.76
- Average comments per pull request: 1.65
- Merged pull requests: 85
- Bot issues: 0
- Bot pull requests: 7
Past Year
- Issues: 46
- Pull requests: 28
- Average time to close issues: 4 days
- Average time to close pull requests: 10 days
- Issue authors: 45
- Pull request authors: 10
- Average comments per issue: 0.89
- Average comments per pull request: 2.04
- Merged pull requests: 14
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- alandtse (4)
- colmbuckley (3)
- Nessy1970 (3)
- mcolyer (3)
- ChrisJ60 (3)
- jherby2k (3)
- i-am-shodan (2)
- fcastilloec (2)
- enoch85 (2)
- baylanger (2)
- bdr99 (2)
- freshfieldx (2)
- stepir (2)
- Steve-gnome (2)
- purcell-lab (2)
Pull Request Authors
- alandtse (52)
- pre-commit-ci[bot] (7)
- bdraco (6)
- ehendrix23 (6)
- skipishere (5)
- llamafilm (5)
- dandelionclock (5)
- flaviorighi (4)
- mcc05 (3)
- ddaddy (3)
- ChrisJ60 (2)
- resnostyle (2)
- Megabytemb (2)
- giachello (2)
- arallsopp (2)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v2 composite
- github/codeql-action/analyze v1 composite
- github/codeql-action/autobuild v1 composite
- github/codeql-action/init v1 composite
- actions/checkout v2 composite
- hacs/action main composite
- home-assistant/actions/hassfest master composite
- amannn/action-semantic-pull-request v4 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/setup-python v1 composite
- hacs/action main composite
- home-assistant/actions/hassfest master composite
- snok/install-poetry v1 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/setup-python v1 composite
- hacs/action main composite
- home-assistant/actions/hassfest master composite
- snok/install-poetry v1 composite
- actions/checkout v3 composite
- ad-m/github-push-action master composite
- relekang/python-semantic-release master composite
- svenstaro/upload-release-action v1-release composite
- 133 dependencies
- python ^3.10
- teslajsonpy ^3.7.2