nfarina / homebridge-tesla

Tesla plugin for homebridge: https://github.com/nfarina/homebridge
154 stars 38 forks source link

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

Closed loftux closed 2 years ago

loftux commented 3 years ago

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 homebridge-tesla@2.5.3

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
loftux commented 3 years ago

This is possibly fixed with latest release that updates Teslajs version. Created my own plugin, so not using this and cannot verify. Closing the issue.

christoph-spielmann commented 3 years ago

Same problem here with the latest version. The plugin dies not work with my Model 3.

mavantix commented 3 years ago

Same issue with 2.6.0, just times out, have to wake car with Tesla app...

loftux commented 3 years ago

Seems like this issue should be reopened to get attention , so I'm doing so.

MishaStorozhuk commented 3 years ago

Any update?...

dsully commented 3 years ago

Also seeing this. Could be an interface binding issue?

nfarina commented 2 years ago

After updating the plugin, I found myself getting lots of 408 errors myself, even when the car was reported to be "awake"! This response code comes directly from Tesla's API, and I believe it truly means "timeout" - as in, the API tried to fetch state from the car in realtime, and wasn't able to.

In my case, I tried moving one of my wifi access points closer to the vehicle and switching it to my 2G SSID, and so far I'm not getting any more 408 errors. Will report back after a few days though.

Worth noting that I was seeing the same "timeouts" in the official Tesla app as well - meaning the app sat there "spinning" waiting to connect to the car and never did. It also seems better now.