dbweb-ch / ioBroker.tesla-motors

ioBroker Adapter for Tesla Motors Cars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo

ioBroker.tesla-motors

NPM version Downloads Stable installed Dependency Status Known Vulnerabilities Build Status

NPM

tesla motors adapter for ioBroker

This Adapter adds control over your Tesla car to ioBroker.

Configuration

  1. Create a new instance of the adapter, each car needs its own instance.
  2. Select your prefered refresh Rate (See Refresh Rate)
  3. Enter your Tesla Username and Tesla Password.
  4. Click "get Token" to request a Token and a Refresh Token from Tesla.
  5. Choose your car in the dropdown.

Refresh Rate

To save battery, the car goes to sleep mode after a certain time of no activity.
Getting information from the car can only be done when the car is awake.
Users reported so called "vampire drain", where the car can consume up to 10km of Range per day if it does not go to sleep state.
To prevent from that, you can choose your desired Refresh Rate:

  • Off - The adapter does not wake up the car on its own. It only wakes up the car upon request (If you set a State).
    If the car woke up on its own, the adapter will request car data once.
  • Temperate - The Adapter will wake up the car once per hour to get his state.
  • Aggressive - The Adapter will wake up the car once per minute.
  • Smart - The Adapter tries to be smart. It will observe the car states to determine if it should be awake or should go to sleep soon. In any case, it lets the car go asleep after 10 Minutes where noting was observed (no action, no Climate, no Driving, no Charging). It then does not wake up the car anymore, if you need that, you can trigger it on your own.

Using the adapter

The Adapter creates several states. They are grouped by their topics:

  • chargeState - about charging, battery and range.
  • climateState - Temperatures and window states.
  • driveState - Position and speed
  • softwareUpdate - Information about pending software updates
  • vehicle - Information about your vehicle

There is a special group called command where you can find all commands to control your car. Some of them are working both ways, for example the climate state will change when climate is turned off by the car. You can see this in the "Send / Recieve" column.

Name Description Send / Recieve
ChargePort Open / Close charge Port SR
UnlockChargePort Unlocks the charge Port S
Charging Start / Stop Charging SR
Climate Start / Stop Climate SR
RemoteStart Activate / Deactivate remote start SR
SentryMode Activate / Deactivate sentry mode SR
SetChargeLimit Set charge Limit in % SR
SetTemperature Set Target Temperature. Don't forget to turn on climate! SR
SpeedLimit Activate Speed Limit SR
SpeedLimitValue Speed Limit value SR
StartSoftwareUpdate Start Software Update SR
SunRoofVent Sun Roof Vent SR
ValetMode Valet Mode SR
ValetPin Valet Pin SR
standby If car is in standby (Set this to wake up manually) SR
doorLock Locks / Opens the door SR
flashLights Flash the lights S
honkHorn Honk the horn S
openFrunk Open Frunk (No recieve) S
openTrunk Open Trunk (No recieve) S
seat_heater_left Seat Heater Left level (0-3) SR
seat_heater_rear_center Rear center seat heater (0-3) SR
seat_heater_rear_left Rear left seat heater (0-3) SR
seat_heater_rear_right Rear right seat heater (0-3) SR
seat_heater_right Seat Heater Right level (0-3) SR
steering_wheel_heater Steering wheel heater SR
windowVent Window Vent SR

Security & Credentials

The Tesla API uses a Token-Based security approach.
The Token will expire (currently after 45 days) but the system can retrieve a new Token using the Refresh Token.
Your credentials do not have to be stored for the Adapter to work, but if you are getting problems with refreshing the token this could make it more stable as the adapter can get a complete new token any time.

Warning:
With your Tesla credentials you can control the while car including open Windows and even driving around. Keep your credentials save!
To reject all Tokens, change your Tesla account Password!

Contributors

  • dbweb-ch
  • Apollon77
  • Hombach
  • klein0r

Changelog

Note that missing version entries are typically dependency updates for security.

0.5.5

  • (dbweb-ch) Fix issue with manual token input
  • (dbweb-ch) Fix issue with token refresh and double encryption

0.5.4

  • (Hombach) Fixed vulnerability; removed tests for node 10
  • (dbweb-ch) Enable to manual entry tokens

0.5.3

  • (dbweb-ch) Improved smart wakeup plan
  • (dbweb-ch) wakeup more reliable on action request
  • (dbweb-ch) Don't wake up the car every 12 hours anymore. If this is needed, trigger it by iobroker.

0.5.1

  • (Hombach) Added tests for node 16; updated dependencies

0.5.0

  • (klein0r) Store passwords and other sensitive information encrypted (BREAKING CHANGE)

0.4.3

  • (dbweb-ch) Refresh mode aggressive: change refresh rate to 1 second instead of 1 minute
  • (dbweb-ch) Add homelink support

0.4.2

  • (dbweb-ch) Define instanceObject "info.connection" to prevent warning with js-controller 3.2.

0.4.1

  • (dbweb-ch) Add "Stopped" as charge state where car can go asleep

0.4.0

  • (dbweb-ch) Implement 2FA Authentification, use new authentification flow

0.3.2

  • (dbweb-ch) Bugfix logging leading to a crash when authentication failed

0.3.1

  • (dbweb-ch) Check token refresh more often

0.3.0

  • (Hombach) Removed tests for node 8; updated dependencies

0.2.3

  • (dbweb-ch) Refresh info every 5 seconds when car is moving

0.2.2

  • (dbweb-ch) Use decrypt from ioBrokerTools, fix issue with selecting car

0.2.1

  • (dbweb-ch) Fix bug with odomoter, refactor object creation, fix issues with compact mode

0.2.0

  • (dbweb-ch) Included testing
  • (dbweb-ch) Encrypt passwords

0.1.2

  • (dbweb-ch) Added Roles, refactor states.
  • Attention: "awake" replaced by "standby" and inverted!
  • Attention: Door lock is inverted.

0.1.1

  • (dbweb-ch) Fix for Wakeup plan "smart"

0.1.0

  • (dbweb-ch) Small fixes for Beta-Version release

0.0.3

  • (dbweb-ch) control all state, added wakeup strategy

0.0.2

  • (dbweb-ch) added all states

0.0.1

  • (dbweb-ch) initial release

License

MIT License

Copyright (c) 2021 Dominic Blattmann nick@dbweb.ch

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

ioBroker Adapter for Tesla Motors Cars

License:MIT License


Languages

Language:JavaScript 88.7%Language:HTML 11.1%Language:CSS 0.2%