Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

homebridge-tesla

2.4.2 • Public • Published

Tesla Accessory

Example config.json:

{
  "accessories": [
    {
      "accessory": "Tesla",
      "name": "Model 3",
      "vin": "5JJYCB522AB296261",
      "username": "bobs@burgers.com",
      "password": "bobbobbaran",
      "authToken": "authToken",
      "waitMinutes": 1
    }
  ]
}

Exposes lock services for doors, trunk, and front trunk. Also exposes an on/off switch for climate control, charge state, and keyless driving.

If you define a value for waitMinutes, you can control the amount of time the plugin will wait for the car to wake up. The default is one minute.

If you define a value for authToken, you do not need to provide your username or password credentials. Generating a token can be done many ways. Tokens for Teslas is one option. npm install -g generate-tesla-token is another.

If you use the example above, you would gain Siri commands like:

  • "Unlock the Model 3 Doors" (unlock the vehicle)
  • "Open the Model 3 Trunk" (pop the trunk)
  • "Open the Model 3 Front Trunk" (pop the frunk)
  • "Open the Model 3 Charge Port" (open the charging port)
  • "Turn on the Model 3 Climate" (turn on climate control)
  • "Turn on the Model 3 Charger" (begin charging even if outside your schedule)
  • "Turn on the Model 3 Starter" (enable keyless driving for 2 minutes - requires password in config, authToken is not sufficient)
  • "Turn on the Model 3 Connection" (wake the car up so you can ask if it's locked, etc.)

Important Note: The Home app will allow you to customize the default names of these services. You may be tempted to, for instance, change your "Model 3 Front Trunk" service to just "Front Trunk" so you can say "Open the Front Trunk". Don't do this! The names of these services are essentially global and live in a giant pool of names. Siri will get confused unless every service has an easily distinguished name.

You may disable various services using additional boolean configuration settings. See config.schema.json for more information.

Multiple Vehicles

Have a garage full of Teslas? Well you're in luck Mr. Musk, becuase you can easily add all of them to HomeKit by creating a separate accessory for each one distinguished by their unique VIN numbers:

{
  "accessories": [
    {
      "accessory": "Tesla",
      "name": "Model 3",
      "vin": "5JJYCB522AB296261",
      "username": "bobs@burgers.com",
      "password": "bobbobbaran"
    },
    {
      "accessory": "Tesla",
      "name": "Model X",
      "vin": "1XSYCA2224A216162",
      "username": "bobs@burgers.com",
      "password": "bobbobbaran"
    }
  ]
}

Development

You can run Rollup in watch mode to automatically transpile code as you write it:

  npm run dev

Install

npm i homebridge-tesla

DownloadsWeekly Downloads

32

Version

2.4.2

License

ISC

Unpacked Size

50.9 kB

Total Files

4

Last publish

Collaborators

  • avatar