这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@kaikreuzer
Copy link
Member

Fixes #15878 (comment)

I tracked this down to a bug which used to update the location from both the location information as well as the "active route location" information, which seems to be delivered by Tesla even though no route is active while the car stays at home.

By cleanly separating these two location types now, the frequent location updates while the car is at home should not appear anymore.

Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer kaikreuzer added the bug An unexpected problem or unintended behavior of an add-on label Dec 9, 2023
@kaikreuzer kaikreuzer requested a review from a team December 9, 2023 23:13
@kaikreuzer kaikreuzer requested a review from kgoderis as a code owner December 9, 2023 23:13
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@lolodomo lolodomo merged commit 92383ab into openhab:main Dec 10, 2023
@lolodomo lolodomo added this to the 4.1 milestone Dec 10, 2023
@phuongpham
Copy link

phuongpham commented Dec 10, 2023

great thanks!
Can you please built it with -Dohc.version=4.0.0 to ensure it's compatible with OH 4.0?

@kaikreuzer @psmedley ?

@psmedley
Copy link
Contributor

great thanks!
Can you please built it with -Dohc.version=4.0.0 to ensure it's compatible with OH 4.0?

@kaikreuzer @psmedley ?

Fix is included in 4.1 Milestone 5

@phuongpham
Copy link

great thanks!
Can you please built it with -Dohc.version=4.0.0 to ensure it's compatible with OH 4.0?
@kaikreuzer @psmedley ?

Fix is included in 4.1 Milestone 5

Thanks for the feedback.
I'm still running on the stable build so I'm still on OH 4.0.4.

@cauer71
Copy link

cauer71 commented Dec 30, 2023

Since the update to 4.1, the coordinates issue has been solved for me with the last fix, but the event stream no longer works. in the trace I see that the streaming connection is established once, but the second request gets “error” as a response, see in the log file at: 2023-12-30 10:25:50.293 @kaikreuzer @psmedley

2023-12-30 10:25:39.148 [DEBUG] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Starting the client to connect to wss://streaming.vn.teslamotors.com/streaming/
2023-12-30 10:25:39.166 [DEBUG] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Connecting to wss://streaming.vn.teslamotors.com/streaming/
2023-12-30 10:25:39.445 [DEBUG] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Connected to streaming.vn.teslamotors.com/52.210.26.136 with hash 1....308
2023-12-30 10:25:39.447 [DEBUG] [internal.handler.TeslaVehicleHandler] - Event : Authenticating vehicle 168813....812
2023-12-30 10:25:39.447 [TRACE] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Received raw data '{"msg_type":"control:hello","connection_timeout":0}'
2023-12-30 10:25:39.449 [DEBUG] [internal.handler.TeslaVehicleHandler] - Event : Received hello
2023-12-30 10:25:39.449 [DEBUG] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Sending raw data '{"msg_type":"data:subscribe_oauth","token":"121212.....21212","value":"odometer,speed,soc,elevation,est_heading,est_lat,est_lng,power,shift_state,range,est_range,heading","tag":"168813953812"}'
2023-12-30 10:25:40.292 [TRACE] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Received raw data '{"msg_type":"data:update","tag":"168813953812","value":"1703928339603,36107.1,,38,246,177,46.xxx,11.xxx,-5,,120,119,177"}'
2023-12-30 10:25:40.293 [DEBUG] [internal.handler.TeslaVehicleHandler] - Event : Received an update: '1703928339603,36107.1,,38,246,177,46.xx,11.xx,-5,,120,119,177'
2023-12-30 10:25:40.294 [DEBUG] [internal.handler.TeslaVehicleHandler] - STS 2023-12-30T10:25:40.294 CTS 2023-12-30T10:25:39.603 Delta 691
2023-12-30 10:25:40.295 [DEBUG] [internal.handler.TeslaVehicleHandler] - Event : Event stamp is 2023-12-30T10:25:39.603
2023-12-30 10:25:40.297 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'timestamp':'1703928339603' is successfully processed
2023-12-30 10:25:40.302 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'odometer':'36107.1' is successfully processed
2023-12-30 10:25:40.305 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'speed':'' is successfully processed
2023-12-30 10:25:40.306 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'soc':'38' is successfully processed
2023-12-30 10:25:40.308 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'elevation':'246' is successfully processed
2023-12-30 10:25:40.310 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'est_heading':'177' is successfully processed
2023-12-30 10:25:40.313 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'est_lat':'46.xx' is successfully processed
2023-12-30 10:25:40.315 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'est_lng':'11.xx' is successfully processed
2023-12-30 10:25:40.318 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'power':'-5' is successfully processed
2023-12-30 10:25:40.321 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'shift_state':'' is successfully processed
2023-12-30 10:25:40.323 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'range':'120' is successfully processed
2023-12-30 10:25:40.325 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'est_range':'119' is successfully processed
2023-12-30 10:25:40.327 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'heading':'177' is successfully processed
2023-12-30 10:25:42.934 [TRACE] [internal.handler.TeslaVehicleHandler] - Event : Pinging the Tesla event stream infrastructure
..
2023-12-30 10:25:42.946 [TRACE] [internal.handler.TeslaVehicleHandler] - Event : Pinging the Tesla event stream infrastructure
2023-12-30 10:25:42.989 [TRACE] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Received a Pong with a roundtrip of 44 milliseconds
..
2023-12-30 10:25:42.991 [TRACE] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Received a Pong with a roundtrip of 43 milliseconds
2023-12-30 10:25:43.348 [TRACE] [internal.handler.TeslaVehicleHandler] - Event : Pinging the Tesla event stream infrastructure
2023-12-30 10:25:43.391 [TRACE] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Received a Pong with a roundtrip of 41 milliseconds
2023-12-30 10:25:50.293 [TRACE] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Received raw data '{"msg_type":"data:error","tag":"168813953812","value":"disconnected","error_type":"vehicle_disconnected"}'
2023-12-30 10:25:50.299 [DEBUG] [internal.handler.TeslaVehicleHandler] - Event : Received an error: 'disconnected'/'vehicle_disconnected'
2023-12-30 10:25:50.302 [DEBUG] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Closing the session
2023-12-30 10:25:50.348 [DEBUG] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Closed the session with status 1000 for reason null

2023-12-30 10:25:51.452 [DEBUG] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : The client to connect to wss://streaming.vn.teslamotors.com/streaming/ is already running
2023-12-30 10:25:51.454 [DEBUG] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Connecting to wss://streaming.vn.teslamotors.com/streaming/
2023-12-30 10:25:51.670 [DEBUG] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Connected to streaming.vn.teslamotors.com/52.210.26.136 with hash 28292335
2023-12-30 10:25:51.672 [TRACE] [internal.handler.TeslaVehicleHandler] - Event : Pinging the Tesla event stream infrastructure
2023-12-30 10:25:51.672 [TRACE] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Received raw data '{"msg_type":"control:hello","connection_timeout":0}'
2023-12-30 10:25:51.673 [DEBUG] [internal.handler.TeslaVehicleHandler] - Event : Received hello
2023-12-30 10:25:51.716 [TRACE] [.internal.handler.TeslaEventEndpoint] - TeslaEventEndpoint-tesla:model3:9538692daa:5YJ3E7EB3MF825xxx : Received a Pong with a roundtrip of 42 milliseconds
2023-12-30 10:25:54.937 [TRACE] [internal.handler.TeslaVehicleHandler] - Event : Pinging the Tesla event stream infrastructure
2023-12-30 10:25:54.937 [TRACE] [internal.handler.TeslaVehicleHandler] - Event : Pinging the Tesla event stream infrastructur

@uqs
Copy link
Contributor

uqs commented Dec 30, 2023

There's still a (different) bug in how the location is updated on the items, namely it's done as 2 separate updates, leading to bogus lat/long when coming online.

OH restarted, everything is null, wake up the car, debug trace shows this series of events:

2023-12-30 14:33:32.216 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'native_longitude':'8.XXX' is successfully processed
...                                                           
2023-12-30 14:33:32.249 [TRACE] [internal.handler.TeslaVehicleHandler] - The variable/value pair 'native_latitude':'47.XXX' is successfully processed
...                               
2023-12-30 14:31:30.224 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Model3_Location' changed from NULL to 0,8.XXX
2023-12-30 14:31:30.248 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Model3_Location' changed from 0,8.XXX to 47.XXX,8.XXX

Ignore the timestamps, I must've grabbed the first part from a later cycle. Anyway, the location update must be done for lat+long at the same time, not sequentially as the data is being parsed.

I'll take a crack at this next year, but don't hold your breath...

austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
Signed-off-by: Kai Kreuzer <kai@openhab.org>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
joni1993 pushed a commit to joni1993/openhab-addons that referenced this pull request Oct 15, 2024
Signed-off-by: Kai Kreuzer <kai@openhab.org>
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 this pull request may close these issues.

[tesla] Latest vehicle update to 2023.38.x breaks location updates

6 participants