Closed focher closed 3 years ago
It appears there's a pull request that is working to add support for the new authentication flow - and add support for MFA. Hopefully that will come soon but not sure if some changes will be necessary in the plugin settings to support MFA.
The same issue with fixes is found here: timdorr/tesla-api#263
https://github.com/mseminatore/TeslaJS/issues/218 has had the PR merged which supports the new Tesla authentication flow and MFA.
Just an update. TeslaJS version 4.9.7 has the new login flow. I can report it "works", meaning it solves the Unauthorized error, but there's still an underlying issue in that the authentication is not clean. I have not enabled MFA on my account to test yet.
It does generate a series of errors when attempting to authenticate and retrieve a token, but eventually tries enough times to get the token.
[2/6/2021, 3:38:32 PM] [Model 3] Logging into Tesla with username/password… TeslaJS error: TypeError: Cannot read property 'forEach' of null at /homebridge/node_modules/homebridge-tesla/node_modules/teslajs/src/auth.js:51:26 at tryCallOne (/homebridge/node_modules/homebridge-tesla/node_modules/teslajs/node_modules/promise/lib/core.js:37:12) at /homebridge/node_modules/homebridge-tesla/node_modules/teslajs/node_modules/promise/lib/core.js:123:15 at flush (/homebridge/node_modules/homebridge-tesla/node_modules/teslajs/node_modules/asap/raw.js:50:29) at processTicksAndRejections (internal/process/task_queues.js:75:11)
I think it's worthwhile to update to TeslaJS 4.9.7 even as they continue to work out the underlying loop problem, as it allows the authentication to work with the new official Tesla authentication flow.
For those who want to test or simply put a "hotfix" in place for the authentication issue until the package is updated, you can manually open up the Terminal in Homebridge, then navigate to node_modules/homebridge-tesla. Open the package.json in an editor, then change the teslajs entry to ^4.9.7. Save the file and then do an npm upgrade
to update TeslaJS to 4.9.7 with the new authentication support.
Solved with v2.5.4 that upgraded to use the current TeslaJS library.
I recently started receiving the following and the plugin is no longer working.
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 (https://github.com/mseminatore/TeslaJS/issues/218).