Giter Site home page Giter Site logo

homebridge-tesla's Introduction

Caution

This plugin currently does not work. Tesla has removed the REST API that this plugin, and nearly every 3rd-party Tesla app, uses. Many popular apps are broken right now. Tesla has introduced a new official API but it's currently unworkable. More information on this thread.

Tesla Accessory

Got a Tesla? Want to let Siri boss it around? Look no further.

Services

After installation below, you'll get the default services enabled:

  • "Unlock the car doors" (unlock the vehicle)
  • "Open the trunk"
  • "Open the front trunk"
  • "Set the climate to 72 degrees" (turns on climate control if off)
  • "Turn on sentry mode"

You can also configure the plugin to enable these additional services:

  • "Set the charge limit to 80%"
  • "Set the charging amps to 24"
  • "Turn on the steering wheel heater"
  • "Turn on the defrost"
  • "Open the charge port"
  • "Turn on the charger" (begins charging even if outside schedule)
  • "Turn on the starter" (enables keyless driving)
  • "Open HomeLink" (opens your garage or other door via HomeLink in supported vehicles)

NOTE: The "charge limit" service is exposed as a "Lightbulb" in HomeKit. This is the only way to get something Siri can control as a percentage value.

Installation

If you're running a Homebridge UI like homebridge-ui-config-x then you can use it to install homebridge-tesla and configure it there. All configuration options should be supported.

Manual Installation

npm install --global homebridge-tesla

Example config.json:

{
  "accessories": [
    {
      "accessory": "Tesla",
      "name": "Model 3",
      "vin": "5JJYCB522AB296261",
      "refreshToken": "eyJhbGciOiJSUzI1…"
    }
  ]
}

To enable and disable services, you'll need to add more options. For example, to disable the Sentry Mode switch:

  
  "refreshToken": "eyJhbGciOiJSUzI1…",
  # Add this:
  "sentryMode": false
}

You can find the full list of configuration settings in config.schema.json.

Setting up the Home App

The plugin exposes a single HomeKit "Accessory" representing the car, which contains multiple services for all the different switches and locks. This is the way.

Unfortunately, there is a very annoying known bug with iOS 16 where, when adding accessories with multiple services, the services are all given the same name as the main accessory.

This means that if your accessory (car) name is "Model Y", then (for instance) the trunk service will be renamed to "Model Y". And you'll say "open the trunk" and Siri will say "I don't know what you mean."

You'll need to manually tap into each service tile and change its name back to what you want. NOTE Tapping "X" on the accessory name will display the true name.

Additionally, you'll find that when you tap into the car in the Home app to, say, open the trunk, you'll see a big scrolling page of switches and locks with no labels. This is just what the Home app does.

To improve this, you can create a new "Room" in HomeKit for each car. So you might have a "Model Y" room, and you can place your Model Y accessory inside there. Then you can configure it to "Show as separate tiles" and you get this lovely presentation of all your widgets in the "room" (pictured at top).

Here's a video demonstrating the complete setup process as of iOS 16.

Waking the Car Up

Tesla cars love to go to "sleep" to preserve battery life, meaning their connection to the Tesla servers is usually not active.

Telling Siri to do something to your car will wake it up first. So "open the car doors" does what you'd expect: wakes up the car if needed, then opens the doors.

IMPORTANT NOTE: The car can take a long time to wake up! Often long enough that it exceeds Siri's hardcoded 10-seconds-or-so timeout. Because of this, the plugin is designed to only keep Siri waiting for a maximum of five seconds. After that, it will return "OK" to Siri and so you will not be notified if the command subsequently fails.

I've found that commands almost always succeed. If they fail a lot for you, you might make sure your car's Wifi connection (if at home) is strong enough. The car is really picky about this (ask me how I know).

Reading State

Asking Siri about your car, like "What's the charge level?" or "Is the trunk open?" will not wake up the car. This is because Siri asks a lot in the background and we don't want this to impact the car's battery life.

If you ask Siri if the trunk is open, and the car is online already, the plugin will query the car and you'll get the right answer. If the car is not online, the plugin will return the last-known value, which may be wrong.

If you require the correct answer, you'll need to wake the car up first. You can do this by turning on the special "Connection" switch. This switch is not subject to the default five-second timeout, so if Siri thinks the switch is on, it's on for real and you can read accurate data about the car.

Generating a Refresh Token

Tesla API access requires a "refresh token" which is tricky to get. There are some apps available that can help with this, check out this list. I have personally used the macOS app "Auth app for Tesla" (linked via that site) and it worked for me.

Once you get a refresh token using an app (it's very long), you can paste it into your plugin configuration above.

NOTE This plugin used to accept an authToken property which was intended to be an optional refresh token. If you have one already, you can just paste that token in the refreshToken property. The authToken property is no longer used, since the name refreshToken is more accurate and sets the token apart from OAuth "access tokens" which are only good for 8 hours.

Multiple Vehicles

Have a garage full of Teslas? Well you're in luck Mr. Musk, because 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",
      "refreshToken": ""
    },
    {
      "accessory": "Tesla",
      "name": "Model X",
      "vin": "1XSYCA2224A216162",
      "refreshToken": "…can be the same…"
    }
  ]
}

Note that you'll need to come up with different names for all the exposed services. The Home app will not let you have two services named "Trunk".

Instead, you could have a "Model Y Trunk" and a "Model 3 Trunk" and you'd just need to remember to use the right prefix when talking to Siri. You will need to do all this renaming in the Home app as in the video above.

HomeLink

For vehicles with HomeLink support, the plugin allows you to enable the feature to send a HomeLink signal from the car. This is disabled by default. You also must provide a latitude and longitude value for the HomeLink device.

Once that is done, you can issue commands like "Open the HomeLink". If you don't have any other garage doors in HomeKit, you may also be able to just say "Open the garage door" since it's exposed as a true garage door service.

  
  "refreshToken": "",
  "enableHomeLink": true,
  "latitude": "37.492655",
  "longitude": "-121.944644"
}

Charge Level

The car can supply the current charge level of the battery as a percentage. As with the other services, this will only update if the car is online.

Note that asking Siri about the "battery level" or "charge level" of anything will usually result in Siri telling you the battery level of your phone. Instead, you can ask Siri "Is the Model 3 charging?" and the level should be returned in the reply.

Climate Switch

By default, the climate control is exposed as a "HVAC" accessory similar to a thermostat in your home. This allows you to say things like "Set the climate to 69 degrees." If you don't need this level of control, you may prefer to expose the climate control as a simple switch. This allows you to say things like "Turn on the climate control" or "Turn off the climate control." The temperature setting will be whatever the car is already set to.

  
  "refreshToken": "",
  "climateSwitch": true
}

Development

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

  npm run dev

homebridge-tesla's People

Contributors

aveach avatar cbrandlehner avatar davidwkeith avatar farhad-a avatar focher avatar jaredmoody avatar jbardo-godaddy avatar jimhe avatar joshschools avatar nfarina avatar raffertyj avatar rlisle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-tesla's Issues

Homelink Command

Would you consider adding a Homelink command? That is the garage door opener.

It's a straightforward POST. The only hitch is that it requires also passing the LATITUDE and LONGITUDE. I propose that these could be user specified config settings as fixed values. The API wants to check if you are physically close to one of your saved Homelink devices but it's no harm if the command gets triggered when out of range.

POST /api/1/vehicles/{id}/command/trigger_homelink

Parameter Example Description
lat 36.98765432109876 Current latitude.
lon -77.12345678901234 Current longitude.

This accessory is not responding on HOME app

I have been using homebridge-tesla for a couple years. Within the recent past, it stopped working. I updated to v2.5.2 and still seeing this message "This accessory is not responding". I already regenerated the token.
In the log, I saw "Initializing Tesla accessory..." and then "Waking up vehicle."
There is no response to "Connection".

How can I debug this?

TeslaJS error: Unauthorized

I recently started receiving the following and the plugin is no longer working.

[1/31/2021, 6:24:11 PM] [Model 3] Logging into Tesla with username/password…
[1/31/2021, 6:24:12 PM] [Model 3] Got a login token.
TeslaJS error: Unauthorized

It seems this is actually related to a change in the way Tesla is allowing authentication, and the TeslaJS library is not updated to support it. I've also created an issue in that repository (mseminatore/TeslaJS#218).

Climate as HVAC accessory

Great plug-in!

Have you considered exposing the climate as HVAC accessory rather than a plain switch? I’d love to be able to see the current interior temp and set target temp through HomeKit!

Thank you

How to use with automation?

Hi! I wanted to use this to automate my hvac but I am unsure if I need to manually wake the car with the connected switch before I can send a hvac on request. It seems that if my car is asleep the hvac fixed 'not responding' on the tile in the home app. And if I need to switch the connected switch to on, is that where the 1 min wait time for the config is for?

Error after installing

Hi I just installed this plugin with:
npm install homebridge-tesla

and when I put the details in the config file and start Homebridge I get this error,

Error: The requested accessory 'Tesla' was not registered by any plugin.
at API.accessory (/usr/lib/node_modules/homebridge/lib/api.js:64:13)
at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:297:42)
at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:91:38)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:59:10)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1103:10)
at Module.load (internal/modules/cjs/loader.js:914:32)
at Function.Module._load (internal/modules/cjs/loader.js:822:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1143:12)
at internal/main/run_main_module.js:16:11

Any help would be great,

Thank you,
Jason

Using the plugin with multiple cars

Is there a way to use the plugin when having multiple Tesla cars.
What do I need to change/add in the config file to get it working for two (or more) Tesla cars?

Enable / Disable Accessories

Hello

Would it be possible to add flags to enable or disable what shows in HomeKit? For example, hiding the trunk and front trunk, so that one could use Siri to “Unlock the Car” without also popping the trunk and frunk.

Thanks!

Is the teslams dependency supposed to be set to >=1.3.0?

I'm completely new to this and I may be misunderstanding something. But my homebridge-tesla update failed because it needed teslams.

Installed teslams and it still won't install because the dependency is set to 1.3.0 or greater. The node installed version is 1.2.2 which seems to be the latest version?

Request: Presence Detection to trigger switch (ie garage open/close)

Wondering how the connection to the car is handled by this/homebridge and if it would be possible to detect the car arriving home to trigger a switch (and thereby open a garage door).

I have tried to do this with automations but the iPhone connection is not always fast enough to trigger. Since the car is on, I wonder if it may have faster/better/more reliable presence detection.

To get around Homekit automation limitations, I would automate presence of car to trigger a dummy switch with that switch triggering the garage open (via MyQ)

If not possible, I'll close this issue. Thanks!

Encountering errors post authentication fix

Homebridge is able to login again, but I'm getting lots of errors and can't manipulate anything other than the connection switch...

This is what I'm seeing in the HB logs:
[2/14/2021, 8:24:34 PM] [Model S] Logging into Tesla with username/password…
[2/14/2021, 8:24:35 PM] [Model S] Got a login token.
[2/14/2021, 8:24:35 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:35 PM] [Model S] Connection on? true
[2/14/2021, 8:24:35 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:35 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:36 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:36 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:36 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:36 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:37 PM] [Model S] Using vehicle "Ronin" with state "online"
TeslaJS error: Error response: 500
[2/14/2021, 8:24:37 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:37 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:37 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:38 PM] [Model S] Using vehicle "Ronin" with state "online"
TeslaJS error: Error response: 540
TeslaJS error: Error response: 500
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
[2/14/2021, 8:24:40 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:41 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:41 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:41 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:41 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:42 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:42 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:42 PM] [Model S] Using vehicle "Ronin" with state "online"
TeslaJS error: Error response: 540
[2/14/2021, 8:24:42 PM] [Model S] Using vehicle "Ronin" with state "online"
TeslaJS error: Error response: 540
[2/14/2021, 8:24:43 PM] [Model S] Using vehicle "Ronin" with state "online"
[2/14/2021, 8:24:43 PM] [Model S] Using vehicle "Ronin" with state "online"
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 500
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540
TeslaJS error: Error response: 540

I've uninstalled/rebooted/reinstalled a few times. Any idea as to what might be going on? Is there somewhere I can grab more detailed logs for this Plugin?

Login issues

Hi everyone,

it appears that Tesla is gradually changing the procedure for retrieving the token. For users already affected by this, the plugin does not work properly anymore and requires an update.

I have been experiencing severe issues with all services and apps using the Tesla API for the last two weeks. Only one service could be connected to the API at a time. Whenever another one logged itself in, all others were thrown out immediately – probably meaning that their tokens have been revoked. Only the official Tesla iOS app seemed to be independent, only showing a brief note „Session timed out“ and then loading normally.

Those are the apps and services I am using, and all of them were affected:

  • homebridge-tesla (on one Raspberry Pi)
  • Tronity
  • TeslaFi
  • A Better Route Planner
  • Tesla Remote (on two iPhones and two iPads to be used within Siri-Shortcuts)
  • Watch for Tesla (on two Apple Watches)

A couple of days ago, I received an interesting message from TeslaFi:

_We noticed that your TeslaFi account may have been affected by a recent change with Tesla’s authentication process. As you may know Tesla recently implemented a two factor authentication option on Tesla.com accounts. This new option created a different workflow for creating Tesla tokens which TeslaFi uses to obtain data from your vehicle.

It appears Tesla is slowly transitioning accounts to use only this new system and your account may have had this put in place.

We have implemented this new token generation workflow which will correct the issue. If you visit Settings->Tesla Account and select “Generate My Token” the issue with the tokens being unauthorized will be corrected._

After logging in again as described, TeslaFi seemed to operate independent of all other apps while those those still fought for access and threw each other out regularly. After contacting the Tronity developers, they changed the login procedure over night and Tronity worked fine as well. Watch for Tesla has also been updated a few days ago and is fine by now. ABRP still has some issues as it is immediately deactivated by homebridge-tesla or Tesla Remote but is at least able to peacefully co-exist with Tronity, TeslaFi and Watch for Tesla.

td;dr

The homebridge-tesla plugin needs an update to cope with the new login procedure. The change seems to be related to the introduction of multi-factor authentication at Tesla, though it also affects users who have not activated MFA yet. Unfortunately, I have no knowledge of the exact details of this new procedure. I am in contact with several other developers and will keep you posted in case I can get anything out of them.

Best regards,
Jochen

Add charge state query

Would love to be able to see what my current charge state is at (especially via Siri).

Ideally we would return the value based on the user's setting in the car (i.e. 63 miles or 28%)

No Response on Home App

Hello,

I've installed this several times and I always get a No Response on the Home App.

I'm not expert on Homebridge by any means but I was able to install other plugins and not this one. This one seems to be very good. If I get it to work.

All I've done is install the Plugin via HOOBS 3.1.1 and add the Accessory like it shows in the details page.

Any help would be appreciated. Thank you

IMG_1080

siri control issues.

Sooo, I'm having an issue where siri commands, while providing feedback in the affirmative, don't actually work. Using the buttons in control center is perfectly reliable, but not via siri. The odd thing is occasionally it will work via siri to either lock/unlock the car, but not the other way around. also, home bridge will readout the command, just not the one I want.. for example locked = false when I'm trying to ask it to lock.

Perhaps worth noting I did get these errors while installing via npm

sudo npm -g install homebridge-tesla


npm WARN deprecated [email protected]: connect 2.x series is deprecated

> [email protected] install /usr/local/lib/node_modules/homebridge-tesla/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/homebridge-tesla/node_modules/kerberos/build'
gyp ERR! System Darwin 16.6.0
gyp ERR! command "/usr/local/Cellar/node/8.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge-tesla/node_modules/kerberos
gyp ERR! node -v v8.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
+ [email protected]
added 263 packages in 19.251s

Tesla location/distance accessory

Feature request
An accessory switch/sensor that turns on when the Tesla is within a certain distance from a location.

How it will be used
When my Tesla is within a distance from home the accessory turns on. This triggers an automation to open the garage door using the myQ plugin.

Suggestions for additional features

First of all: Thanks! I just got an idea about controlling teslas cabin heating via homebridge. This works perfectly!

Here is a couple of other ideas that came to my mind:

  • Using brightness control (or maybe battery status and another switch) to show charging state and to start/stop charging
  • Temperature indicators for inside and outside (better than to combine them to thermostat control as it requires more clicks to activate heating)

New install - No response in the Home App

Hi,

I've installed this plug in today (Homebridge is running Mac OS). I'm seeing a constant no response from all the tiles in the Home App but no errors in the logs. I know the car is awake as I've done that manually. The logs don't show much other than a lot of logins:

[12/3/2020, 3:52:02 PM] [Model 3] Got a login token.
[12/3/2020, 3:52:02 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:52:02 PM] [Model 3] Got a login token.
[12/3/2020, 3:52:02 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:52:03 PM] [Model 3] Got a login token.
[12/3/2020, 3:52:03 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:52:03 PM] [Model 3] Got a login token.
[12/3/2020, 3:52:03 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:52:04 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:31 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:32 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:32 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:33 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:33 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:33 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:34 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:35 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:35 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:35 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:36 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:36 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:36 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:37 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:38 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:38 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:38 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:39 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:40 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:40 PM] [Model 3] Got a login token.
[12/3/2020, 3:55:40 PM] [Model 3] Logging into Tesla with username/password…
[12/3/2020, 3:55:41 PM] [Model 3] Got a login token.

I'm not using MFA just good old username and password.

Any ideas please?

John.

Connection seems to be ON all the time

I have been using homebridge-tesla from 2-3 years ago. Due to other reasons, I did a complete reinstall to the latest of everything today. It seems like the Connection to the car is always on and that seems like it would drain the battery.
Is there a way to configure to NOT keep Connection ON all the time?

No Response on Home App

The same as issue #32. It doesn't matter if the car is awake or asleep. The Connection button does nothing, since the button doesn't appear operational when there is a No Response status on it. I suppose I can just give up, since I have the Stats app for iOS, which enables Siri shortcuts to the car controls.

HomeKit update performance

A cold start of HomeKit causes a refresh and polling of the Tesla api. During this time homebridge accessories can say updating in the HomeKit ui for several seconds. Is it possible to have the Tesla plugin poll asynchronously and store the required state values statically so that anytime homebridge api reads state values they are returned instantly? Perhaps there can be an option ‘background-polling’ and when set to true it follows this behavior?

Speed of the plugin

Hi @nfarina ,

First of all, really appreciate this great plugin!
I do have a question on the time that the plugin needs to update in HomeKit. It shows as non responding in HomeKit first and takes about 20-30 seconds to update. I’ve been running the plugin on a clean install of homebridge, no further plugins, fiber internet connection of 250mb/s. Is there any way to speed-up this process?

Not waking up

My Apple Home app indicates my Tesla states have no response. The homebridge log shows
Using vehicle "XXXX" with state "asleep"

And shows no sign of trying to wake up the car from homebridge.

If I wake up the car by using the Tesla app, then the Home app reports the right states.
Am I missing some config setting?

add keyless driving as option

Is there any chance you could add keyless driving as an option? Would be awesome to say "Hey siri, start keyless driving" and be on your way.

thanks

Performance Issues ?

I just rebuilt a new homebridge and have noticed that the peformance degrades significantly after installing this plugin. Is there a way I can check logs to see what's causing the problem?

Simple example - I can turn an indoor light on/off from Homekit almost instantaneous�ly before installing this plugin, but after installing it takes 3-5 seconds before the light will turn on.

Excessive logging of vehicle state

Thanks for the awesome plugin. All the accessories in the Home app are functioning as expected after playing with the names a bit.

One thing that's bugging me is the repeated log messages of the vehicle state in getVehicle which is called repeatedly and thus fills the log with the same message. Ideally this would be logged only once until the state changed and then again when awakened. Here's what is logged after opening the room I made for my Tesla accessories in the Home app and then turning the connection on. If anyone can work on this that'd be much appreciated. Thank you again for this great plugin.

[11/4/2020, 8:15:21 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:21 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:21 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:21 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:21 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:21 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:22 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:22 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:22 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:22 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:22 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:28 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:28 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:28 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:28 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:28 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:28 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:29 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:29 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:29 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:29 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:29 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:30 AM] [my] Waking up vehicle.
[11/4/2020, 8:15:30 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:30 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:30 AM] [my] Waiting for vehicle to wake up...
[11/4/2020, 8:15:32 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:32 AM] [my] Waiting for vehicle to wake up...
[11/4/2020, 8:15:34 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:34 AM] [my] Waiting for vehicle to wake up...
[11/4/2020, 8:15:38 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:38 AM] [my] Waiting for vehicle to wake up...
[11/4/2020, 8:15:43 AM] [my] Using vehicle "009237" with state "asleep"
[11/4/2020, 8:15:43 AM] [my] Waiting for vehicle to wake up...
[11/4/2020, 8:15:48 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:49 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:49 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:49 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:49 AM] [my] Charging? false
[11/4/2020, 8:15:49 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:49 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:50 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:50 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:50 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:50 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:50 AM] [my] Remote start active? false
[11/4/2020, 8:15:50 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:50 AM] [my] Using vehicle "009237" with state "online"
[11/4/2020, 8:15:50 AM] [my] Climate on? false

Cannot install

I am sure I am doing something wrong somewhere. Please be gentle, completely new to Homebridge. Here is the log:

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning ENODATA: Cache input stream was empty npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation. npm ERR! code EINTEGRITY npm ERR! errno EINTEGRITY npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/homebridge-tesla: Integrity verification failed

Allow for additional wakeup time

Noticed today my car climate control didn't kick on when expected. Looking at the logs, I see the following:

Feb 01 06:38:57 homepi homebridge[5440]: [2019-2-1 06:38:57] [Model 3] Using vehicle "Smurf" with state "asleep"
Feb 01 06:38:58 homepi homebridge[5440]: [2019-2-1 06:38:58] [Model 3] Using vehicle "Smurf" with state "asleep"
Feb 01 06:39:00 homepi homebridge[5440]: [2019-2-1 06:39:00] [Model 3] Using vehicle "Smurf" with state "asleep"
Feb 01 06:39:00 homepi homebridge[5440]: [2019-2-1 06:39:00] [Model 3] Waiting for vehicle to wake up…
Feb 01 06:39:01 homepi homebridge[5440]: [2019-2-1 06:39:01] [Model 3] Using vehicle "Smurf" with state "asleep"
Feb 01 06:39:01 homepi homebridge[5440]: [2019-2-1 06:39:01] [Model 3] Waiting for vehicle to wake up…
Feb 01 06:39:03 homepi homebridge[5440]: [2019-2-1 06:39:03] [Model 3] Using vehicle "Smurf" with state "asleep"
Feb 01 06:39:03 homepi homebridge[5440]: [2019-2-1 06:39:03] [Model 3] Waiting for vehicle to wake up…
Feb 01 06:39:08 homepi homebridge[5440]: [2019-2-1 06:39:08] [Model 3] Using vehicle "Smurf" with state "asleep"
Feb 01 06:39:08 homepi homebridge[5440]: [2019-2-1 06:39:08] [Model 3] Waiting for vehicle to wake up…
Feb 01 06:39:13 homepi homebridge[5440]: [2019-2-1 06:39:13] [Model 3] Using vehicle "Smurf" with state "offline"
Feb 01 06:39:13 homepi homebridge[5440]: [2019-2-1 06:39:13] [Model 3] Waiting for vehicle to wake up…
Feb 01 06:39:18 homepi homebridge[5440]: [2019-2-1 06:39:18] [Model 3] Using vehicle "Smurf" with state "offline"
Feb 01 06:39:18 homepi homebridge[5440]: [2019-2-1 06:39:18] [Model 3] Waiting for vehicle to wake up…
Feb 01 06:39:23 homepi homebridge[5440]: [2019-2-1 06:39:23] [Model 3] Using vehicle "Smurf" with state "offline"
Feb 01 06:39:23 homepi homebridge[5440]: [2019-2-1 06:39:23] [Model 3] Waiting for vehicle to wake up…
Feb 01 06:39:29 homepi homebridge[5440]: [2019-2-1 06:39:29] [Model 3] Using vehicle "Smurf" with state "offline"
Feb 01 06:39:29 homepi homebridge[5440]: [2019-2-1 06:39:29] [Model 3] Waiting for vehicle to wake up…

Looking at the code, I see you limit it to 30 seconds. Would you be willing to lengthen that, or add a config value that allows someone to set it to a longer value? Model 3 sometimes is a little stubborn waking up.

With state "asleep" fail with TeslaJS error: Error response: 408

When car is in state "asleep", Homekit fails to fetch status with "No response".
It is all working when car is awake.
It is not possible to wake the car with the toggle when it has failed with "No response".

As can be seen in the logs, the error when asleep is because of a time-out (408).
It looks like the error is actually in TeslaJS library, checked there but no issue filed for "408".

Environment:
Raspberry Pi docker, OS: Linux 5.4.72-v7l+ arm
Node.js v14.15.3
Homebridge v1.2.5
[email protected]

This is the log output, running in debug mode dit not output additional information.

[1/13/2021, 8:34:12 PM] Homebridge v1.2.5 is running on port 51218.
[1/13/2021, 8:48:32 PM] [Model3] Logging into Tesla with username/password…
[1/13/2021, 8:48:33 PM] [Model3] Got a login token.
[1/13/2021, 8:48:34 PM] [Model3] Using vehicle "Model3" with state "asleep"
[1/13/2021, 8:48:34 PM] [Model3] Using vehicle "Model3" with state "asleep"
[1/13/2021, 8:48:34 PM] [Model3] Connection on? false
[1/13/2021, 8:48:35 PM] [Model3] Using vehicle "Model3" with state "asleep"
TeslaJS error: Error response: 408
TeslaJS error: Error response: 408
[1/13/2021, 8:48:35 PM] [Model3] Using vehicle "Model3" with state "asleep"
TeslaJS error: Error response: 408

Cannot find Tesla

Firstly, thanks so much for all your work on Homebridge.

The logs keeps saying No vehicles were found matching the VIN ${vin} entered in your config.json. Available vehicles: (there is nothing after Available vehicles) I have checked the VIN, username, and password and I am sure they are correct. The home app has the accessories but shows them as non-responsive. I tried using an authcode instead, but that didn't work either.

Error login in

[Model S] Error logging into Tesla: Error: 401: {"response":"undefined_method_`strip'_for_nil:nilclass"}

any clues why I'm getting this error?

Thanks

Additional functionality: ChargePort

Really love the project.
Is it also possible to add a command to open the Chargeport?
Currently I need to open the app or enter the car to release the charging cable.
I know it's possible in Teslajs so perhaps it can already be done throught the homebridge instance?

disable notifications

I'd like an option to globally disable notifications. I have the home app on a number of devices and don't care about notifications anywhere; I don't want to have to go into each one individually to disable notifications on each thing

Add API token support

Leaving a password in plaintext is undesirable, it’d be cool to support getting a token once with the credentials instead, either with the plugin itself or another site. TeslaFi vends these tokens and they can be obtained in other ways.

npm package incomplete

When installing this plugin via npm or using 'Homebridge Config UI X', the file config.schema.json is missing. This results in inability to configure the plugin using 'Homebridge Config UI X'.

Tested with version 2.3.0

"Always Connected" leads to permanent "No Response"

I have been running this plugin successfully for about a year. Two weeks ago, I disabled "Always Connected" in my Tesla while I was on vacation, but left "enable mobile access" enabled. When I returned, I re-enabled "Always Connected", but Homekit will no longer connect to the car. I continue to get "No Response". Any suggestions? I run Homebridge on a raspberry pi and tried changing the IP address. I also removed the Tesla accessory and re-added it, to no avail.

Startup error if variables not in config.json

So I'm back after a short hiatus, and it seems as if the readme was updated, and doesn't state that the previously required entries in config.json are necessary (trunk, trunk, charger, etc). Starting up homebridge without those entires results in a UUID error and homebridge shutting down.

TypeError: Cannot read property 'UUID' of undefined
at Accessory.addService (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:149:35)
at /usr/local/lib/node_modules/homebridge/lib/server.js:471:19
at Array.forEach ()
at Server._createAccessory (/usr/local/lib/node_modules/homebridge/lib/server.js:451:14)
at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:309:26)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:91:38)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Got SIGTERM, shutting down Homebridge...

When adding them back in, I still cannot get remote start to work, it's not recognized as a command.

Thanks!

typo in readme.md

it says:
"authToken": "authToken" "waitMinutes": 1

but shoud say:
"authToken": "authToken", "waitMinutes": 1

Login Issues with Username/Password

Getting this error repeatedly today. Not using authToken - only username and password

[2/17/2021, 12:10:19 PM] [Car3] Logging into Tesla with username/password…
TeslaJS error: TypeError: Cannot read property 'forEach' of null
at /usr/local/lib/node_modules/homebridge-tesla/node_modules/teslajs/src/auth.js:51:26
at tryCallOne (/usr/local/lib/node_modules/homebridge-tesla/node_modules/promise/lib/core.js:37:12)
at /usr/local/lib/node_modules/homebridge-tesla/node_modules/promise/lib/core.js:123:15
at flush (/usr/local/lib/node_modules/homebridge-tesla/node_modules/asap/raw.js:50:29)
at processTicksAndRejections (node:internal/process/task_queues:75:11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.