Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tesla] Error fetching the list of vehicles : 412:org.apache.cxf.jaxrs.impl.ResponseImpl$1@c37d94 #16318

Closed
phuongpham opened this issue Jan 23, 2024 · 40 comments · Fixed by #16331
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@phuongpham
Copy link

Suddently this night my Tesla things become offline.
When I check the log I received follow error:

[ERROR] [.internal.handler.TeslaAccountHandler] - Error fetching the list of vehicles : 412:org.apache.cxf.jaxrs.impl.ResponseImpl$1@c37d94

Potential fix here:
teslamate-org/teslamate#3629

@phuongpham phuongpham added the bug An unexpected problem or unintended behavior of an add-on label Jan 23, 2024
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/error-fetching-the-list-of-vehicles-412-org-apache-cxf-jaxrs-impl-responseimpl-1-c37d94/153295/7

@Chrischan20
Copy link

I have the same issue. Tesla OFFLINE since yesterday.

[ERROR] [internal.handler.TeslaAccountHandler] - Error fetching the list of vehicles : 412:org.apache.cxf.jaxrs.impl.ResponseImpl$1@160fc1d
[WARN ] [internal.handler.TeslaVehicleHandler] - Got an unsuccessful result, setting vehicle to offline and will try again

My Teslafi.com account also stopped receiving data and required a change of authentication. It was mentioned that "Tesla has changed to a new officially supported Tesla API to connect your car"

Happy to support or test something if required.
Hope somebody can fix it soon.

@kaikreuzer
Copy link
Member

I can confirm that I have the same. I cannot say, when I will find time to look into it, though; hopefully at the weekend.

xzavrel added a commit to xzavrel/openhab-addons that referenced this issue Jan 24, 2024
xzavrel added a commit to xzavrel/openhab-addons that referenced this issue Jan 24, 2024
@xzavrel
Copy link

xzavrel commented Jan 24, 2024

I can confirm that I have the same. I cannot say, when I will find time to look into it, though; hopefully at the weekend.

I made a simple change and tested on SNAPSHOT version, that the binding is working great again.

EDITED: Sorry I'm wrong. Tesla Account is working great, but vehicleData is not loaded. I will investigate the situation.

@xzavrel
Copy link

xzavrel commented Jan 24, 2024

Maybe there is some other API change as I get these 404.


2024-01-24 13:33:13.345 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicleData
2024-01-24 13:33:13.553 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request vehicleData: 404: Not Found
2024-01-24 13:34:13.664 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2024-01-24 13:34:13.670 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXX
2024-01-24 13:34:13.674 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle state is online
2024-01-24 13:34:13.679 [DEBUG] [internal.handler.TeslaVehicleHandler] - Car has moved recently and can not sleep
2024-01-24 13:34:13.682 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicleData
2024-01-24 13:34:13.919 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request vehicleData: 404: Not Found
2024-01-24 13:35:13.992 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2024-01-24 13:35:13.997 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXX
2024-01-24 13:35:14.001 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle state is online
2024-01-24 13:35:14.005 [DEBUG] [internal.handler.TeslaVehicleHandler] - Car has not moved in 5 min, and can sleep
2024-01-24 13:35:14.008 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is inactive
2024-01-24 13:35:14.010 [DEBUG] [internal.handler.TeslaVehicleHandler] - Car has not moved in 5 min, and can sleep
2024-01-24 13:35:14.017 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: wake_up
2024-01-24 13:35:14.247 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request wake_up: 404: Not Found
2024-01-24 13:36:14.297 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK

@phuongpham
Copy link
Author

Maybe there is some other API change as I get these 404.


2024-01-24 13:33:13.345 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicleData
2024-01-24 13:33:13.553 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request vehicleData: 404: Not Found
2024-01-24 13:34:13.664 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2024-01-24 13:34:13.670 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXX
2024-01-24 13:34:13.674 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle state is online
2024-01-24 13:34:13.679 [DEBUG] [internal.handler.TeslaVehicleHandler] - Car has moved recently and can not sleep
2024-01-24 13:34:13.682 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicleData
2024-01-24 13:34:13.919 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request vehicleData: 404: Not Found
2024-01-24 13:35:13.992 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2024-01-24 13:35:13.997 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXX
2024-01-24 13:35:14.001 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle state is online
2024-01-24 13:35:14.005 [DEBUG] [internal.handler.TeslaVehicleHandler] - Car has not moved in 5 min, and can sleep
2024-01-24 13:35:14.008 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is inactive
2024-01-24 13:35:14.010 [DEBUG] [internal.handler.TeslaVehicleHandler] - Car has not moved in 5 min, and can sleep
2024-01-24 13:35:14.017 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: wake_up
2024-01-24 13:35:14.247 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request wake_up: 404: Not Found
2024-01-24 13:36:14.297 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK

can you please share the snapshot?

@xzavrel
Copy link

xzavrel commented Jan 24, 2024

@phuongpham
Copy link
Author

can you please share the snapshot?

https://download.vojtechzavrel.cz/org.openhab.binding.tesla-3.4.6-SNAPSHOT.jar

Thanks! will this work on OH 4.1.1?

@theater
Copy link
Contributor

theater commented Jan 25, 2024

See this: timdorr/tesla-api#763
Maybe the end of using the unofficial API?
Could this be the reason or they only changed endpoints?

@nommy68
Copy link

nommy68 commented Jan 25, 2024

I can confirm that I have the same. I cannot say, when I will find time to look into it, though; hopefully at the weekend.

I made a simple change and tested on SNAPSHOT version, that the binding is working great again.

EDITED: Sorry I'm wrong. Tesla Account is working great, but vehicleData is not loaded. I will investigate the situation.

I read a bit through the corresponding issue on teslafi, and ist seems that only changing the endpoint from /vehicles to /products might lead to further problems. The response might now contain not only vehicles but also other tesla products (e.g. batteries), so it would be a good idea to filter the response for vehicles.

@theater
Copy link
Contributor

theater commented Jan 25, 2024

yeah. Makes sense. And maybe a future feature request could be to model the wall chargers (I have one for example) which are already supported into the the tesla app....

P.S. What I'm really concerned is the above information that they plan to cut off the regular access to the API and use only the official API channel which may get charged after a while...

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/tesla-account-rapidly-flapping-offline-online/153363/3

@psmedley
Copy link
Contributor

I also made some changes - https://smedley.id.au/tmp/org.openhab.binding.tesla-4.1.2-SNAPSHOT.jar
My changes are in https://github.com/psmedley/openhab-addons/commits/tesla-4.1.x

@nommy68
Copy link

nommy68 commented Jan 25, 2024

I also made some changes - https://smedley.id.au/tmp/org.openhab.binding.tesla-4.1.2-SNAPSHOT.jar My changes are in https://github.com/psmedley/openhab-addons/commits/tesla-4.1.x

Does not work for me. The account thing goes online and the car thing appears in the inbox (when awake) but all channels stay NULL.
and the car goes offline [communication error] after some seconds.
This is in the log:

2024-01-25 23:01:52.896 [DEBUG] [internal.handler.TeslaAccountHandler] - Disposing the Tesla account handler for tesla:account:dcf2473fa4
2024-01-25 23:01:52.898 [DEBUG] [internal.handler.TeslaAccountHandler] - Initializing the Tesla account handler for dcf2473fa4
2024-01-25 23:01:52.899 [DEBUG] [internal.handler.TeslaAccountHandler] - Setting up an authenticated connection to the Tesla back-end
2024-01-25 23:01:52.900 [DEBUG] [internal.handler.TeslaAccountHandler] - Current authentication time 2024-01-25 23:01:52
2024-01-25 23:01:52.901 [DEBUG] [internal.handler.TeslaAccountHandler] - Found a request token from 2024-01-25 22:34:20
2024-01-25 23:01:52.903 [DEBUG] [internal.handler.TeslaAccountHandler] - Access token expiration time 2024-01-26 06:34:20
2024-01-25 23:01:52.904 [DEBUG] [internal.handler.TeslaAccountHandler] - The access token has not expired yet
2024-01-25 23:01:53.090 [DEBUG] [internal.handler.TeslaAccountHandler] - Querying the vehicle: Response: 200: OK
2024-01-25 23:01:53.093 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: null
2024-01-25 23:01:53.470 [TRACE] [internal.handler.TeslaAccountHandler] - Request : null:null yields {"id":1492931737XXXXXX,"user_id":1XXXXXX,"vehicle_id":625XXXXXX,"vin":"5YJ3E7EA5LF7XXXXX ... lot of vehicle info here... ,"webcam_available":true}}
2024-01-25 23:01:53.473 [DEBUG] [scovery.TeslaVehicleDiscoveryService] - Found a model3 vehicle
2024-01-25 23:01:53.488 [DEBUG] [internal.handler.TeslaAccountHandler] - Querying the vehicle: VIN 5YJ3E7EA5LF7XXXXX
2024-01-25 23:01:53.492 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle state is initializing or unknown
2024-01-25 23:01:53.498 [TRACE] [internal.handler.TeslaAccountHandler] - Vehicle is id 1492931737XXXXXX/vehicle_id 625XXXXXX/tokens [c130a9e9766XXXXX, a45e770473bXXXXX]
2024-01-25 23:01:53.523 [DEBUG] [internal.handler.TeslaAccountHandler] - Querying the vehicle: VIN 5YJ3E7EA5LF7XXXXX
2024-01-25 23:01:53.525 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle state is initializing or unknown
2024-01-25 23:01:53.528 [TRACE] [internal.handler.TeslaAccountHandler] - Vehicle is id 1492931737XXXXXX/vehicle_id 625XXXXXX/tokens [c130a9e9766XXXXX, a45e770473bXXXXX]
2024-01-25 23:01:54.684 [DEBUG] [internal.handler.TeslaVehicleHandler] - Event : The vehicle is not awake
2024-01-25 23:01:54.766 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 412, Precondition Failed
2024-01-25 23:01:54.767 [WARN ] [internal.handler.TeslaVehicleHandler] - Got an unsuccessful result, setting vehicle to offline and will try again
2024-01-25 23:01:54.768 [DEBUG] [internal.handler.TeslaVehicleHandler] - An error occurred while querying the vehicle
2024-01-25 23:02:23.635 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 412, Precondition Failed
2024-01-25 23:02:23.636 [WARN ] [internal.handler.TeslaVehicleHandler] - Got an unsuccessful result, setting vehicle to offline and will try again
2024-01-25 23:02:23.637 [DEBUG] [internal.handler.TeslaVehicleHandler] - An error occurred while querying the vehicle
2024-01-25 23:02:23.731 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 412, Precondition Failed
2024-01-25 23:02:23.732 [WARN ] [internal.handler.TeslaVehicleHandler] - Got an unsuccessful result, setting vehicle to offline and will try again
2024-01-25 23:02:23.734 [DEBUG] [internal.handler.TeslaVehicleHandler] - An error occurred while querying the vehicle

@phuongpham
Copy link
Author

I also made some changes - https://smedley.id.au/tmp/org.openhab.binding.tesla-4.1.2-SNAPSHOT.jar My changes are in https://github.com/psmedley/openhab-addons/commits/tesla-4.1.x

Does not work for me. The account thing goes online and the car thing appears in the inbox (when awake) but all channels stay NULL. and the car goes offline [communication error] after some seconds. This is in the log:

2024-01-25 23:01:52.896 [DEBUG] [internal.handler.TeslaAccountHandler] - Disposing the Tesla account handler for tesla:account:dcf2473fa4
2024-01-25 23:01:52.898 [DEBUG] [internal.handler.TeslaAccountHandler] - Initializing the Tesla account handler for dcf2473fa4
2024-01-25 23:01:52.899 [DEBUG] [internal.handler.TeslaAccountHandler] - Setting up an authenticated connection to the Tesla back-end
2024-01-25 23:01:52.900 [DEBUG] [internal.handler.TeslaAccountHandler] - Current authentication time 2024-01-25 23:01:52
2024-01-25 23:01:52.901 [DEBUG] [internal.handler.TeslaAccountHandler] - Found a request token from 2024-01-25 22:34:20
2024-01-25 23:01:52.903 [DEBUG] [internal.handler.TeslaAccountHandler] - Access token expiration time 2024-01-26 06:34:20
2024-01-25 23:01:52.904 [DEBUG] [internal.handler.TeslaAccountHandler] - The access token has not expired yet
2024-01-25 23:01:53.090 [DEBUG] [internal.handler.TeslaAccountHandler] - Querying the vehicle: Response: 200: OK
2024-01-25 23:01:53.093 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: null
2024-01-25 23:01:53.470 [TRACE] [internal.handler.TeslaAccountHandler] - Request : null:null yields {"id":1492931737XXXXXX,"user_id":1XXXXXX,"vehicle_id":625XXXXXX,"vin":"5YJ3E7EA5LF7XXXXX ... lot of vehicle info here... ,"webcam_available":true}}
2024-01-25 23:01:53.473 [DEBUG] [scovery.TeslaVehicleDiscoveryService] - Found a model3 vehicle
2024-01-25 23:01:53.488 [DEBUG] [internal.handler.TeslaAccountHandler] - Querying the vehicle: VIN 5YJ3E7EA5LF7XXXXX
2024-01-25 23:01:53.492 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle state is initializing or unknown
2024-01-25 23:01:53.498 [TRACE] [internal.handler.TeslaAccountHandler] - Vehicle is id 1492931737XXXXXX/vehicle_id 625XXXXXX/tokens [c130a9e9766XXXXX, a45e770473bXXXXX]
2024-01-25 23:01:53.523 [DEBUG] [internal.handler.TeslaAccountHandler] - Querying the vehicle: VIN 5YJ3E7EA5LF7XXXXX
2024-01-25 23:01:53.525 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle state is initializing or unknown
2024-01-25 23:01:53.528 [TRACE] [internal.handler.TeslaAccountHandler] - Vehicle is id 1492931737XXXXXX/vehicle_id 625XXXXXX/tokens [c130a9e9766XXXXX, a45e770473bXXXXX]
2024-01-25 23:01:54.684 [DEBUG] [internal.handler.TeslaVehicleHandler] - Event : The vehicle is not awake
2024-01-25 23:01:54.766 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 412, Precondition Failed
2024-01-25 23:01:54.767 [WARN ] [internal.handler.TeslaVehicleHandler] - Got an unsuccessful result, setting vehicle to offline and will try again
2024-01-25 23:01:54.768 [DEBUG] [internal.handler.TeslaVehicleHandler] - An error occurred while querying the vehicle
2024-01-25 23:02:23.635 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 412, Precondition Failed
2024-01-25 23:02:23.636 [WARN ] [internal.handler.TeslaVehicleHandler] - Got an unsuccessful result, setting vehicle to offline and will try again
2024-01-25 23:02:23.637 [DEBUG] [internal.handler.TeslaVehicleHandler] - An error occurred while querying the vehicle
2024-01-25 23:02:23.731 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 412, Precondition Failed
2024-01-25 23:02:23.732 [WARN ] [internal.handler.TeslaVehicleHandler] - Got an unsuccessful result, setting vehicle to offline and will try again
2024-01-25 23:02:23.734 [DEBUG] [internal.handler.TeslaVehicleHandler] - An error occurred while querying the vehicle

Yes I got same results

@nommy68
Copy link

nommy68 commented Jan 26, 2024

I also made some changes - https://smedley.id.au/tmp/org.openhab.binding.tesla-4.1.2-SNAPSHOT.jar My changes are in https://github.com/psmedley/openhab-addons/commits/tesla-4.1.x

Finally I made it working! Even sending commands (at least charging, sentry, auto conditioning ON/OFF) is working.
What I did:

  1. deactivating car and tesla account.
  2. uninstalling the binding (and removing any old org.openhab.binding.tesla*.jar-files from \openHAB-addons.
  3. stopping openhab service.
  4. running sudo openhab-cli clean-cache
  5. pasting org.openhab.binding.tesla-4.1.2-SNAPSHOT.jar to \openHAB-addons.
  6. starting openhab service and give openhab enough time to completely start up.
  7. adding new tesla account thing (with token from old one).
  8. car appears in inbox!
  9. switching items to new discovered car.
  10. deleting old car and old tesla account.

@psmedley
Copy link
Contributor

Based on some information at https://teslamotorsclub.com/tmc/threads/using-fleet-api-to-control-my-powerwall-reserve-percentage.320164/page-2 there were some API issues yesterday...

@psmedley
Copy link
Contributor

Started a thread about moving to Fleet API...

@phuongpham
Copy link
Author

phuongpham commented Jan 27, 2024

I also made some changes - https://smedley.id.au/tmp/org.openhab.binding.tesla-4.1.2-SNAPSHOT.jar My changes are in https://github.com/psmedley/openhab-addons/commits/tesla-4.1.x

Finally I made it working! Even sending commands (at least charging, sentry, auto conditioning ON/OFF) is working. What I did:

  1. deactivating car and tesla account.
  2. uninstalling the binding (and removing any old org.openhab.binding.tesla*.jar-files from \openHAB-addons.
  3. stopping openhab service.
  4. running sudo openhab-cli clean-cache
  5. pasting org.openhab.binding.tesla-4.1.2-SNAPSHOT.jar to \openHAB-addons.
  6. starting openhab service and give openhab enough time to completely start up.
  7. adding new tesla account thing (with token from old one).
  8. car appears in inbox!
  9. switching items to new discovered car.
  10. deleting old car and old tesla account.

Can confirm it working with the snapshot.
Thanks for your contribution @psmedley 👍

@theater
Copy link
Contributor

theater commented Jan 27, 2024

Hi,
could whoever makes the changes for the API changes, could you maybe add some logger.trace lines of the raw responses in the handlers?
Would be great if we can easily see what the API is returning before the parse attempt is made.
In my opinion this will ease the troubleshooting

Cheers,
Konstantin

P.S. Or I may do it myself and open another PR but I guess whoever is changing now endpoints has done that anyway...

@kaikreuzer
Copy link
Member

Thanks @psmedley for looking into it, your fix seems to work fine for me as well.
I have created #16331 and will backport the fix to 4.1 once merged.

@psmedley
Copy link
Contributor

oops - thread about moving to Fleet API ithat I mentioned in #16318 (comment) is at https://community.openhab.org/t/tesla-teslapowerwallcloud-time-to-think-about-fleet-api/153392/2

@xzavrel
Copy link

xzavrel commented Jan 28, 2024

@psmedley - i don'ŧ see more changes in the API than switching to product endpoint (and small refactoring), am I right?

@nommy68 - it's not working for me with models - what tesla model do you have?

If I add the discovered vehicle (it is type vehicle not type models) i got This thing has no channels. Either the thing type doesn't define channels, or they may be detected and appear later.

@psmedley
Copy link
Contributor

@psmedley - i don'ŧ see more changes in the API than switching to product endpoint (and small refactoring), am I right?

@nommy68 - it's not working for me with models - what tesla model do you have?

If I add the discovered vehicle (it is type vehicle not type models) i got This thing has no channels. Either the thing type doesn't define channels, or they may be detected and appear later.

The change to Fleet API isn't too bad - the hard bit is the need for a proxy to send commands via the REST api.

You need to wake the vehicle to generate the list of channels.

@xzavrel
Copy link

xzavrel commented Jan 28, 2024

@psmedley - sorry I didn'ŧ ment moving to the fleet API but the curret hotfix - switchting for product products endopoint in PR https://github.com/openhab/openhab-addons/pull/16331/files. It seems to me to be the same change I had in PR #16322.

And I'm still recieving 404 error:

2024-01-28 09:37:29.729 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle state is online
2024-01-28 09:37:29.733 [DEBUG] [internal.handler.TeslaVehicleHandler] - Car has not moved in 5 min, and can sleep
2024-01-28 09:37:29.735 [DEBUG] [internal.handler.TeslaVehicleHandler] - Car has not moved in 5 min, and can sleep
2024-01-28 09:37:29.737 [DEBUG] [internal.handler.TeslaVehicleHandler] - Throttled state polling to allow sleep, occupied/idle, or in a console mode
2024-01-28 09:37:30.997 [DEBUG] [internal.handler.TeslaAccountHandler] - Setting up an authenticated connection to the Tesla back-end
2024-01-28 09:37:31.000 [DEBUG] [internal.handler.TeslaAccountHandler] - Current authentication time 2024-01-28 09:37:30
2024-01-28 09:37:31.002 [DEBUG] [internal.handler.TeslaAccountHandler] - Found a request token from 2024-01-28 09:28:17
2024-01-28 09:37:31.005 [DEBUG] [internal.handler.TeslaAccountHandler] - Access token expiration time 2024-01-28 17:28:17
2024-01-28 09:37:31.007 [DEBUG] [internal.handler.TeslaAccountHandler] - The access token has not expired yet
2024-01-28 09:37:31.412 [DEBUG] [internal.handler.TeslaAccountHandler] - Querying the vehicle: Response: 200: OK
2024-01-28 09:37:31.416 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: null
2024-01-28 09:37:31.675 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request null: 404: Not Found
2024-01-28 09:37:31.677 [DEBUG] [scovery.TeslaVehicleDiscoveryService] - Found a vehicle vehicle

@hlemmens
Copy link

I installed org.openhab.binding.tesla-4.2.0-SNAPSHOT.jar. Doesn't work for me. I get a server error when I try to enable the bridge-thing. Any help available?

@kaikreuzer
Copy link
Member

kaikreuzer commented Jan 29, 2024

@hlemmens Are you running a 4.2.0-SNAPSHOT runtime? If so, there is no need to install the jar separately.

@hlemmens
Copy link

I'm running the 4.1.1 stable version.

@nommy68
Copy link

nommy68 commented Jan 29, 2024

@nommy68 - it's not working for me with models - what tesla model do you have?

I have a mid 2020 Model 3, no other Tesls products.

@hlemmens
Copy link

@nommy68 My problem is probably not related to the model as I don't even get a bridge running.

I have a 2019 Model 3.

@Chrischan20
Copy link

I also made some changes - https://smedley.id.au/tmp/org.openhab.binding.tesla-4.1.2-SNAPSHOT.jar My changes are in https://github.com/psmedley/openhab-addons/commits/tesla-4.1.x

Finally I made it working! Even sending commands (at least charging, sentry, auto conditioning ON/OFF) is working. What I did:

  1. deactivating car and tesla account.
  2. uninstalling the binding (and removing any old org.openhab.binding.tesla*.jar-files from \openHAB-addons.
  3. stopping openhab service.
  4. running sudo openhab-cli clean-cache
  5. pasting org.openhab.binding.tesla-4.1.2-SNAPSHOT.jar to \openHAB-addons.
  6. starting openhab service and give openhab enough time to completely start up.
  7. adding new tesla account thing (with token from old one).
  8. car appears in inbox!
  9. switching items to new discovered car.
  10. deleting old car and old tesla account.

I can confirm everyting is working again with my Model 3 (2019) after following the procedure with the 4.1.2-SNAPSHOT!

@hlemmens
Copy link

I find the tesla add ons in 2 folders:
/srv/openhab-userdata/tmp/mvn/org/openhab/addons/bundles/org.openhab.binding.tesla
and
/var/lib/openhab/tmp/mvn/org/openhab/addons/bundles/org.openhab.binding.tesla

Which one should I delete and replace?

@psmedley
Copy link
Contributor

Uninstall the binding via the add-ons store, and copy the snapshot into /usr/share/openhab/addons

@hlemmens
Copy link

hlemmens commented Jan 30, 2024

Thanks. Works fine now.

Sorry, to optimistic. Bridge blocks from time to time.

Debug log:
2024-01-30 21:56:46.927 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - An exception occurred while invoking a HTTP request: 'java.io.EOFException: HttpConnectionOverHTTP@d621f8f::DecryptedEndPoint@649e09ca{l=/192.168.0.13:50158,r=auth.tesla.com/2.21.16.79:443,OPEN,fill=-,flush=-,to=5587773/0}'

looks like an issue we had last year issue #14435

@julesx81
Copy link

julesx81 commented Jan 30, 2024

can you please share the snapshot?

https://download.vojtechzavrel.cz/org.openhab.binding.tesla-3.4.6-SNAPSHOT.jar

This snap doesn't work on my OH 3.4.4

@michi6383
Copy link

Setting charging amps and start/stop charging is a forbidden command. can some help please?
2024-02-02 14:42:43.454 [DEBUG] [internal.handler.TeslaVehicleHandler] - handleCommand tesla:models:tesla_account_michael:tesla_models_michael:chargingamps 5.0
2024-02-02 14:42:43.455 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: set_charging_amps
2024-02-02 14:42:43.458 [DEBUG] [internal.handler.TeslaVehicleHandler] - handleCommand tesla:models:tesla_account_michael:tesla_models_michael:charge ON
2024-02-02 14:42:43.459 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: charge_start
2024-02-02 14:42:43.620 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request set_charging_amps: 403: Forbidden
2024-02-02 14:42:43.648 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request charge_start: 403: Forbidden
2024-02-02 14:42:49.714 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2024-02-02 14:42:49.715 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN LRWxxxxxxxxx

@psmedley
Copy link
Contributor

psmedley commented Feb 2, 2024

Setting charging amps and start/stop charging is a forbidden command. can some help please? 2024-02-02 14:42:43.454 [DEBUG] [internal.handler.TeslaVehicleHandler] - handleCommand tesla:models:tesla_account_michael:tesla_models_michael:chargingamps 5.0 2024-02-02 14:42:43.455 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: set_charging_amps 2024-02-02 14:42:43.458 [DEBUG] [internal.handler.TeslaVehicleHandler] - handleCommand tesla:models:tesla_account_michael:tesla_models_michael:charge ON 2024-02-02 14:42:43.459 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: charge_start 2024-02-02 14:42:43.620 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request set_charging_amps: 403: Forbidden 2024-02-02 14:42:43.648 [DEBUG] [internal.handler.TeslaAccountHandler] - An error occurred while communicating with the vehicle during request charge_start: 403: Forbidden 2024-02-02 14:42:49.714 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK 2024-02-02 14:42:49.715 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN LRWxxxxxxxxx

Is this a new vehicle? Newer vehicles are prohibited from sending commands via the deprecated owners api. I have a test version of the binding using the newer fleet api. there is a forum post about this at https://community.openhab.org/t/tesla-teslapowerwallcloud-time-to-think-about-fleet-api/153392 - DM me for a link to the binding and instructions on how to register your card to the binding.

@hlemmens
Copy link

hlemmens commented Feb 5, 2024

It seems the new snapshot is unable to refresh the access token:

2024-02-05 06:19:40.318 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 401, Unauthorized
2024-02-05 06:19:40.319 [DEBUG] [internal.handler.TeslaVehicleHandler] - The access token has expired, trying to get a new one.
2024-02-05 06:19:40.320 [DEBUG] [internal.handler.TeslaAccountHandler] - Current authentication time 2024-02-05 06:19:40
2024-02-05 06:19:40.321 [DEBUG] [internal.handler.TeslaAccountHandler] - Found a request token from 2024-02-04 22:18:47
2024-02-05 06:19:40.322 [DEBUG] [internal.handler.TeslaAccountHandler] - Access token expiration time 2024-02-05 06:18:47
2024-02-05 06:19:40.322 [DEBUG] [internal.handler.TeslaAccountHandler] - The access token has expired
2024-02-05 06:19:40.323 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - Exchanging SSO refresh token for API access token
2024-02-05 06:19:40.348 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - An exception occurred while invoking a HTTP request: 'java.io.EOFException: HttpConnectionOverHTTP@4df9f0ba::DecryptedEndPoint@1fa09643{l=/192.168.0.13:39004,r=auth.tesla.com/2.21.16.79:443,OPEN,fill=-,flush=-,to=28853028/0}'
2024-02-05 06:19:40.349 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - An error occurred during refresh of SSO token: no response
2024-02-05 06:19:40.350 [DEBUG] [internal.handler.TeslaVehicleHandler] - An error occurred while querying the vehicle

This is the same issue as we had in #14435

Anyone able to fix?

@lsiepel
Copy link
Contributor

lsiepel commented Feb 5, 2024

Please create a seperate issue as this is closed.

@hlemmens
Copy link

hlemmens commented Feb 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.