Tesla items not updated after some time

Hi all, I’m trying to get the Tesla binding to work. I’ve generated a refresh token and configured my Tesla account thing, car and items. Initially, everything’s fine and the updates keep coming.

When the car is sleeping for a few hours(?), however, the updates stop and the item values don’t change anymore, although the account and car things stay online. If I restart the binding or openHAB, the updates resume.

There’s already a ticket describing this behaviour (with little progress), but I wonder: Is this a configuration error or is nobody using the Tesla binding “as is” currently? Or are there workarounds?

1 Like

It’s really a pity that there is no progress. I have exact the same issue and spend many hours to band-aid it somehow but to not much avail. Given that our Tesla is the key electricity consumer in our household, the whole smart energy use of my smart home breaks down with this :frowning:

I agree it’s really a pity that this is not working. Makes this beautiful binding pretty much useless. I spent quite a lot of time in figuring out why it is broken and had a look at the source code even though I’m not a Java dev. I assume that the auth outdates after some while and the binding never gos for a re-authentication.

I just discovered that I put this thread in “Off-Topic” and moved it into the correct section (for visibility).

Did you try the current snapshot release for 3.4? I haven’t had a problem with it.

Interesting. I’m on 3.4.0.M1 and am having the described problems. Is this the version you’re referring to? Because it seems that nothing changed between 3.3.0 and 3.4.0.M1.

No I just checked out main and built it. I also made some changes to it for my preferences but I don’t think I had any issues with the original before I patched it and in any case nothing to do with the api token. That expires every 8 hours, and in my log I see normal refreshes (for days).

You didn’t post a log. If it is like the one that you referenced in the ticket, that is from a build from July. Maybe try building it yourself or just get the current from jfrog, JFrog

OK, I checked both binding version 3.4.0.M1 and a snapshot from JFrog. If I enable debog logging, this is what I see after 8 hours:

2022-09-04 22:30:56.664 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 401, Unauthorized
2022-09-04 22:30:56.665 [DEBUG] [internal.handler.TeslaVehicleHandler] - The access token has expired, trying to get a new one.
2022-09-04 22:30:56.666 [DEBUG] [internal.handler.TeslaAccountHandler] - Found a request token created at 2022-09-04 14:30:52
2022-09-04 22:30:56.667 [DEBUG] [internal.handler.TeslaAccountHandler] - The token has expired at 2022-09-04 14:59:40
2022-09-04 22:30:56.667 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - Exchanging SSO refresh token for API access token
2022-09-04 22:30:56.684 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - An exception occurred while invoking a HTTP request: 'java.io.EOFException: HttpConnectionOverHTTP@3e66d6eb::DecryptedEndPoint@395430f2{l=/192.168.XX.XX:43854,r=auth.tesla.com/69.192.160.83:443,OPEN,fill=-,flush=-,to=28803741/0}'
2022-09-04 22:30:56.685 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - An error occurred during refresh of SSO token: no response
2022-09-04 22:30:56.686 [DEBUG] [internal.handler.TeslaVehicleHandler] - An error occurred while querying the vehicle

I’m using the “Auth for Tesla” App to generate a refresh token, but the result looks as if an access token is used.

What is the contents of […] after java.io.EOFException or is it printed exactly that way?

I updated my previous reply with the full error message. Sorry, I thought the rest might already be sufficient.

There is some discussion about that error here: java.io.EOFException: HttpConnectionOverHTTP@6f56146f::DecryptedEndPoint@71b6e0a0... error · Issue #3891 · eclipse/jetty.project · GitHub
I don’t get that error, and I don’t know if that is your problem. The API is behind a WAF so that also may have something to do with it.
Just for fun you might want to try a different refresh token generator. I use Tesla Access Token Generator - Microsoft Edge Addons and have not had an issue with it.

In theory, you can test the refresh by doing something like this, but I haven’t gotten it to work correctly (their WAF may fingerprint curl or something).

curl -v -i -A 'Mozilla/5.0' -X PUT -H 'Content-Type: application/json' -d "{ \"grant_type\":\"refresh_token\",\"client_id\":\"ownerapi\",\"refresh_token\":\"$refresh\",\"scope\":\"openid email offline_access\" }"  https://auth.tesla.com/oauth2/v3/token

Where $refresh is the refresh token you got from the addon. Actually even though it would fail, it would be interesting to try to see what error comes back. You should get back a 403 or the actual access token. Any other response might be interesting to know.

One other thing I thought of, to rule out a WAF issue due to excessive polling, might be to just let the binding run while the car is asleep and verify that you get the error. That is no fastpolling of the API like when the car is in motion or charging. Leaving the car in Sentry all day also keeps it awake. So just park, no Sentry, restart the binding so that it is just polling for the minimal stuff, and see if the refresh still breaks after the 8 hour timeout.

07-Sep-2022 10:24:00.662 [DEBUG] [binding.tesla.internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
07-Sep-2022 10:24:00.665 [DEBUG] [binding.tesla.internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN xxxxx
07-Sep-2022 10:24:00.666 [DEBUG] [binding.tesla.internal.handler.TeslaVehicleHandler] - Vehicle state is asleep
07-Sep-2022 10:24:00.667 [DEBUG] [binding.tesla.internal.handler.TeslaVehicleHandler] - Vehicle is asleep.

2 Likes

Hi Bill, thank you again for taking the time to help, I really appreciate it! The problem also occurs, if the car is asleep as I usually don’t use sentry mode at night and it still happens. I’ve tried the token generator you mentioned and will report back.

My Tesla bridge and car are also statically defined, if that matters.
You might also want to try installing a minimal openhab on vm in the cloud, outside of your ISP, to rule out WAF issues.

So, the token generator is not the problem. The problem still occurs. I don’t understand, why the access token can be retrieved initially but not during refresh.

When I added the new refresh token:

2022-09-07 17:45:06.229 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'tesla.things'
2022-09-07 17:45:06.314 [DEBUG] [internal.handler.TeslaAccountHandler] - Setting up an authenticated connection to the Tesla back-end
2022-09-07 17:45:06.315 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - Exchanging SSO refresh token for API access token
2022-09-07 17:45:08.034 [DEBUG] [internal.handler.TeslaAccountHandler] - Querying the vehicle: Response: 200: OK

Refresh:

2022-09-08 01:45:07.374 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 401, Unauthorized
2022-09-08 01:45:07.375 [DEBUG] [internal.handler.TeslaVehicleHandler] - The access token has expired, trying to get a new one.
2022-09-08 01:45:07.376 [DEBUG] [internal.handler.TeslaAccountHandler] - Found a request token created at 2022-09-07 17:45:06
2022-09-08 01:45:07.377 [DEBUG] [internal.handler.TeslaAccountHandler] - The token has expired at 2022-09-07 18:13:54
2022-09-08 01:45:07.377 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - Exchanging SSO refresh token for API access token
2022-09-08 01:45:07.390 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - An exception occurred while invoking a HTTP request: 'java.io.EOFException: HttpConnectionOverHTTP@928adce::DecryptedEndPoint@5868049e{l=/192.168.XX.XX:40958,r=auth.tesla.com/69.192.160.83:443,OPEN,fill=-,flush=-,to=28800593/0}'
2022-09-08 01:45:07.391 [DEBUG] [sla.internal.handler.TeslaSSOHandler] - An error occurred during refresh of SSO token: no response
2022-09-08 01:45:07.391 [DEBUG] [internal.handler.TeslaVehicleHandler] - An error occurred while querying the vehicle

How often does your car wake up, if you’re not using it? The logs show that it’s online once an hour, although I’m using neither the app nor the car. I’m not sure if the binding is to blame, although “allow wake-ups” is false.

The car shouldn’t wake up if it is not charging, occupied, moving, or in some kind of console mode (dog, camp, etc…). If you have something else polling it maybe that would keep it awake and maybe over time the WAF doesn’t like the high frequency polling. Make sure you don’t have another copy of openhab or something like teslascope looking at it.

To see what the state is doing over a period time it may be better to graph it.


Number nTeslaState "nState [%d]"
Number nTeslaState_chart

where nTeslaState is calculated by this rule:

rule "Tesla State Changed"
    when
    Item TeslaState changed

    then
        if (previousState == NULL) return;
        switch (TeslaState.state) {
            case "online" : {
                nTeslaState.postUpdate(1)
            }
            case "asleep" : {
                nTeslaState.postUpdate(0)
            }
            case "offline" : {
                nTeslaState.postUpdate(-0.5)
            }
            case "waking" : {
                nTeslaState.postUpdate(0.5)
            }
            case "unknown" : {
                nTeslaState.postUpdate(-1)
            }

        }
end

Then you can do something like:

                Frame
                {
                            Switch label="State" item=nTeslaState_chart icon=line mappings=[0="Hide", 1="Hour", 2="Day", 3="Week", 4="Month"]
                                Chart  item=nTeslaState  period=h refresh=30000  visibility=[nTeslaState_chart==1]
                                Chart  item=nTeslaState  period=D refresh=30000  visibility=[nTeslaState_chart==2]
                                Chart  item=nTeslaState  period=W refresh=30000  visibility=[nTeslaState_chart==3]
                                Chart  item=nTeslaState  period=M refresh=30000  visibility=[nTeslaState_chart==4]
                }

Thanks again for the help. Ive already been using a state variable and a timestamp that is updated, whenever the car changes from “asleep” to “online” and vice versa. Over the last week, I watched the car and binding more closely (through debug logs) and think there’s something wrong with the binding or my configuration (I even cleared openHAB’s cache and tmp folders). I’m not using other services that use the Tesla API and I even closed the Tesla app during my tests. Nothing should prevent the car from sleeping or wake it up. I only know that strange things are going on, if I use the binding. Here are two excerpts from my log.

The car wakes up after sleeping for 10 minutes, although nothing should have woken it up. No app use, no physical interaction and the car certainly didn’t move. I don’t know what happens here and why (I manually marked the lines with state changes):

2022-09-08 16:41:35.447 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is neither charging nor moving, skipping updates to allow it to sleep
2022-09-08 16:41:43.471 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:41:43.474 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:41:43.478 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is neither charging nor moving, skipping updates to allow it to sleep
2022-09-08 16:41:50.449 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is neither charging nor moving, skipping updates to allow it to sleep
2022-09-08 16:42:05.450 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is neither charging nor moving, skipping updates to allow it to sleep
2022-09-08 16:42:20.451 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is neither charging nor moving, skipping updates to allow it to sleep
2022-09-08 16:42:35.453 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is neither charging nor moving, skipping updates to allow it to sleep
**2022-09-08 16:42:46.531 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TeslaState' changed from online to asleep**
2022-09-08 16:42:46.660 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TeslaStateChangeTimestamp' changed from 2022-09-08T16:20:31.479529+0200 to 2022-09-08T16:42:46.656414+0200
2022-09-08 16:42:46.525 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:42:46.528 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:43:46.743 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:43:46.745 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:44:50.516 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:44:50.518 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:45:53.673 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:45:53.676 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:46:56.343 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:46:56.345 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:47:59.325 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:47:59.326 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:47:59.327 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is inactive
2022-09-08 16:49:02.416 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:49:02.418 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:50:05.385 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:50:05.388 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:51:08.333 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:51:08.335 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
**2022-09-08 16:52:11.325 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TeslaState' changed from asleep to online**
2022-09-08 16:52:11.345 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TeslaStateChangeTimestamp' changed from 2022-09-08T16:42:46.656414+0200 to 2022-09-08T16:52:11.331642+0200
2022-09-08 16:52:11.319 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:52:11.322 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:52:11.325 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is now awake, updating all data
2022-09-08 16:52:11.326 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: drive_state
2022-09-08 16:52:11.329 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicle_state
2022-09-08 16:52:11.614 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle moved, resetting last location timestamp
2022-09-08 16:52:12.327 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: charge_state
2022-09-08 16:52:13.658 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TeslaInsideTemperature' changed from 21.7 °C to 21.5 °C
2022-09-08 16:52:13.659 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TeslaOutsideTemperature' changed from 21 °C to 20.5 °C
2022-09-08 16:52:13.328 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: climate_state
2022-09-08 16:52:14.330 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: gui_settings
2022-09-08 16:52:15.331 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: charge_state
2022-09-08 16:52:16.332 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: climate_state
2022-09-08 16:52:17.332 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: gui_settings
2022-09-08 16:52:18.334 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: mobile_enabled
2022-09-08 16:52:20.462 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: drive_state
2022-09-08 16:52:21.463 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicle_state
2022-09-08 16:52:35.462 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: drive_state
2022-09-08 16:52:36.463 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicle_state
2022-09-08 16:52:50.463 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: drive_state
2022-09-08 16:52:51.464 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicle_state
2022-09-08 16:53:05.463 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: drive_state
2022-09-08 16:53:06.464 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicle_state
2022-09-08 16:53:11.824 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TeslaOutsideTemperature' changed from 20.5 °C to 21 °C
2022-09-08 16:53:11.489 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 16:53:11.491 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 16:53:11.494 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: charge_state
2022-09-08 16:53:11.494 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: climate_state
2022-09-08 16:53:12.495 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: gui_settings
2022-09-08 16:53:13.496 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: mobile_enabled
2022-09-08 16:53:20.464 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: drive_state
2022-09-08 16:53:21.465 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicle_state
2022-09-08 16:53:35.464 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: drive_state
2022-09-08 16:53:36.465 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicle_state
2022-09-08 16:53:50.464 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: drive_state
2022-09-08 16:53:51.465 [DEBUG] [internal.handler.TeslaAccountHandler] - Invoking: vehicle_state

In this second example, the state changes to asleep, but the binding appears do miss this (I marked the relevant lines again):

**2022-09-08 17:08:43.587 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TeslaState' changed from online to asleep**
2022-09-08 17:08:43.592 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'TeslaStateChangeTimestamp' changed from 2022-09-08T16:52:11.331642+0200 to 2022-09-08T17:08:43.589571+0200
2022-09-08 17:08:43.580 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:08:43.583 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:09:46.361 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:09:46.364 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:10:52.372 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:10:52.375 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:11:52.835 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:11:52.838 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:12:56.602 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:12:56.604 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:13:59.498 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:13:59.500 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:13:59.501 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle is inactive
2022-09-08 17:15:02.578 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:15:02.580 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:16:06.861 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:16:06.864 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:17:10.468 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:17:10.471 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:18:13.503 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:18:13.506 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:19:16.580 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:19:16.582 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:20:19.656 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:20:19.659 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:21:20.286 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:21:20.288 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:22:20.726 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:22:20.729 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:23:21.094 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:23:21.097 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:24:21.505 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:24:21.508 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:25:21.936 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:25:21.938 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:26:25.746 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:26:25.749 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:27:26.009 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:27:26.011 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:28:29.557 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:28:29.559 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:29:32.514 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:29:32.517 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:30:35.614 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:30:35.616 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:31:38.583 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:31:38.585 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:32:40.007 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:32:40.011 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:33:43.493 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:33:43.496 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
2022-09-08 17:34:43.700 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:34:43.703 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX
**2022-09-08 17:34:43.705 [DEBUG] [internal.handler.TeslaVehicleHandler] - Vehicle did not fall asleep within sleep period, checking again**
2022-09-08 17:35:44.160 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle, response : 200, OK
2022-09-08 17:35:44.162 [DEBUG] [internal.handler.TeslaVehicleHandler] - Querying the vehicle: VIN XXXXXXXXXXXXXXXXX

I don’t know what’s going on here. Combined with the unsolved token refresh problem I decided to disable the binding for now. If the binding was really this “confused” or broken, shouldn’t others/everyone have these problems?

You have to be careful about cause and effect, bearing in mind events very close together can get in the log “out of order”.
So, above, the query is timestamped earlier and naturally enough wakes the car up to answer the query?

Why would it make a query after this announcement?

I don’t know. Some unfinished business perhaps - we might imagine something like a configured value that cannot actually be read (wrong model or something) so the binding re-tries it from time to time as an error recovery, not taking ‘sleep’ into account.

1 Like

It always queries every minute. What it does is stops querying the detailed vehicle endpoint that wakes the car for 20 minutes, after 5 minutes of inactivity (this default is annoying imho but see below).
If you want to have more logging around what the binding is actually doing you can build the binding from my branch openhab2-addons/bundles/org.openhab.binding.tesla at tesla3.4 · billfor/openhab2-addons · GitHub. It will show additional debugging information regarding throttles and states. See [tesla] Options to control polling frequency and sleep (Model 3) by billfor · Pull Request #13337 · openhab/openhab-addons · GitHub for a description of what it does.

Hi guys,
maybe unrelated directly but I wanted to ask you as I see you’re using the binding… I’ve tested the binding on my Model Y but it seems I cannot do a “changes” - I can only read states of certain channels. Is that right and intended or something is not working on my end?
My idea is to start charging only when my solar inverter has enough power from the sun. There are two options - to trigger the powerwall or to trigger the tesla. Do you know if this may work?

Cheers,
K.

Hi,

I have just started to implement smart charging on my Tesla Model S. I’m building the algorithms in a NodeJS application utilizing the openhab REST API to “talk” with the car.

To start with, this was looking very promising, but after looking more into working with the binding, like hooking up some event listeners (EventSource) to ChargingState, ChargeLimit and SetChargingAmps, the binding seems very “unreliable”.

Sometimes it works (almost) as expected. When changing one of the above-mentioned properties via the REST API, the events are triggered – although with a substantial delay - and I get the new values back when requesting them.

When changing the same properties via the Tesla app, I’m not able to read the new values – and no events are triggered.

Does somebody have experience with, or knowledge about using this binding via the REST API?

Thanks!

Some additional info:
Just now, a change of ChargeLimit and SetChargingAmps from the app was working – with substantial delay.

A few minutes later, it stopped detecting changes done from the app again

1 Like