Deprecated Binding - Volkswagen We Connect

Would this perhaps work for Skoda as well? (With other server settings) Seems like it’s the same App, with different layout

Thanks for the great bindings you provide :slight_smile:

Thanks @Chris_Thomsen! :slight_smile:

So you have an e-golf, cool! :slight_smile: I’ve not been able to test any of the e-manager API calls, which electric channels have you tested?

I cannot control f.ex the heater of my e-golf anymore

I’ve seen this myself and believe the request vechicle status report API call (request-vsr) is the culprit, since this API call forces the vehicle to send a status report.

I will probably change the logic so that an ordinary refresh will not use the request-vsr API call, that will instead be done via send a REFRESH command to a new channel so that the user of the binding can control how often it is called.

I’m also struggling a bit with the binding ending up in a situation where it fails to recover after getting an error code 2 from a get-fully-loaded-cars API call.

I will work with these issues and have a new binding jar out for test in a couple of days.

Hi @mrwee!

Would this perhaps work for Skoda as well?

I have no clue and the binding is based on the Web API and not the App API which are different.

If you could check which API calls the Skoda Web portal uses, we could compare?

Awesome @jannegpriv , i’ve tested only the info channels - havent tried to trigger the heater from the binding, yet.
Since it doesnt work from the official app, i figured that it wouldnt work from the binding either.

gotta disable the binding now, since its snow and ice here - and i really need to be able trigger the heater remotely :slight_smile:

/Chris

I’ve now built a new jar-file and updated the original post.

I’ve changed behaviour of the binding so that an ordinary refresh will not call the request-vsr since that API requests forces the vehicle to send a report to VW and that has restrictions in how many times that is allowed due to battery saving. What I’ve seen after tests so far is that information about position and trip data will be updated after each trip anyhow, so there is no real need in calling request-vsr unless you have to get the latest information for some reason.

You can trigger a request-vsr API call by sending a REFRESH command to the status channel of the Bridge, in that case the vehicle will send latest status to VW.

I’ve also, hopefully, solved the issue when binding failed to re-login after some token expiry.

Hi,
Thanks a lot for this binding, unfortunately there seems to be an issue with the number format for me. Any clue?

2020-03-24 17:27:25.605 [WARN ] [econnect.internal.VWWeConnectSession] - Exception caught java.lang.NumberFormatException: Expected an int but was 1.360 at line 1 column 110 path $.vehicleDetails.range while parsing JSON response {"vehicleDetails":{"lastConnectionTimeStamp":["22-03-2020","10:03"],"distanceCovered":"4.612","range":"1.360","serviceInspectionData":"665 Dag(en) / 25.500 km","oilInspectionData":"617 Dag(en) / 23.500 km","showOil":true,"showService":true,"flightMode":false},"errorCode":"0"} for request https://www.portal.volkswagen-we.com//portal/delegate/dashboard/WVxxx/-/vehicle-info/get-vehicle-details`
2020-03-24 17:27:27.236 [WARN ] [econnect.internal.VWWeConnectSession] - Error code on POST: url https://www.portal.volkswagen-we.com//portal/delegate/dashboard/WVxxx/-/rah/get-status, response {"errorCode":"2","timerCount":3}
2020-03-24 17:27:27.238 [WARN ] [econnect.internal.VWWeConnectSession] - Vehicle details is null!

tnx,

Hi @Christophe_Heerinckx, thanks for testing the binding. :+1:
Impressive range 1360 km :slight_smile:

Since my VW Tiguan has a maximum range of around 850 km I’ve never got the chance to see the range using a “.” as for “1.360” km. I will fix this and change internal type from int.

Stay tuned for a new jar-file!

New jar-file has been built, original post is updated.

NOTE: The binding is currently built towards OH 2.5.3, the last one was built for OH2.5.2 so when I dropped it in /usr/share/openhab/addons I had to manually delete the old binding jar-file and restart the new binding in the karaf console:

[20:28:54] openhabian@openhab:/usr/share/openhab2/addons$ openhab-cli console

Logging in as openhab
Password:  

                          __  _____    ____      
  ____  ____  ___  ____  / / / /   |  / __ )     
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  | 
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /      
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/     
    /_/                        2.5.1
                               Release Build   

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab>                                                                                                                                                                                                    
openhab>                                                                                                                                                                                                    
openhab>                                                                                                                                                                                                    
openhab> bundle:list |grep -i vw                                                                                                                                                                            
367 │ Active    │  80 │ 2.5.3.202003241922      │ openHAB Add-ons :: Bundles :: VW We Connect Binding
openhab> bundle:restart 367
1 Like

hi,
I have a VW e-up and the bridge is working properly but the vehicle thing has status UNKNOWN. Has anybody configured properly a VW e-up in OH2?
thanks
vwweconnect.log (529.4 KB)

Hi @Martin_Fischer!

Thanks for testing the binding, you are the first person having an electric car testing the binding. Since I’ve not been able to test the support myself this was kind of anticipated.

If you have the time I would happily debug this together with you, I think we then do it using DM since it will possibly require a number of new test jars to debug things out.

If that is OK feel free to send a DM! :slight_smile:

Hi Jan,

thanks for the information and for your help.
Of course, we can debug this together.

Thanks & Regards,
Martin

Hi Jan,
i tried starting the “emanagerClimate” from the binding just now, just updated to the latest binding available in the first post.
It seems to fail - however, at the moment the charging cable is not connected, and in the we-connect app i’m requested to confirm that i want to start the climate even though the cable is not connected.
maybe there is something additionally thats needed for this?

Btw. did you change the logic around refresh? :slight_smile:

i’ll connect the charging cable tomorrow, and test again - maybe its working when it doesnt need a confirmation.

i also noticed that the command sent is “charge-battery” - not sure if this is correct?

Log snip:
2020-04-11 20:45:19.966 [DEBUG] [econnect.internal.VWWeConnectSession] - Sending command: myvolkswagen.net - Choose your market / language
2020-04-11 20:45:19.966 [DEBUG] [econnect.internal.VWWeConnectSession] - postJSONVWWeConnectAPI URL: myvolkswagen.net - Choose your market / language Data: {“triggerAction”:“True”, “batteryPercent”:“100”} Referer: myvolkswagen.net - Choose your market / language XCSRF:kYeZ8BqD
2020-04-11 20:45:19.967 [DEBUG] [econnect.internal.VWWeConnectSession] - HTTP POST Request HttpRequest[POST //portal/delegate/dashboard/WVWZZZAUZJXXXXXXX/-/emanager/charge-battery HTTP/1.1]@c82617.
2020-04-11 20:45:21.140 [DEBUG] [.internal.handler.VWWeConnectHandler] - VIN: WVWZZZAUZJXXXXXXX JSON response: {“errorCode”:“0”,“actionNotification”:{“actionState”:“QUEUED”,“actionType”:“START”,“serviceType”:“RBC”,“errorTitle”:null,“errorMessage”:null}}
2020-04-11 20:45:21.141 [DEBUG] [econnect.internal.VWWeConnectSession] - ErrorCode: 0
2020-04-11 20:45:21.141 [DEBUG] [.internal.handler.VWWeConnectHandler] - Command myvolkswagen.net - Choose your market / language successfully sent to vehicle!
2020-04-11 20:45:26.142 [DEBUG] [econnect.internal.VWWeConnectSession] - Sending command: myvolkswagen.net - Choose your market / language
2020-04-11 20:45:28.143 [DEBUG] [econnect.internal.VWWeConnectSession] - postJSONVWWeConnectAPI URL: myvolkswagen.net - Choose your market / language Fields: null Referer: myvolkswagen.net - Choose your market / language XCSRF:kYeZ8BqD
2020-04-11 20:45:28.144 [DEBUG] [econnect.internal.VWWeConnectSession] - HTTP POST Request HttpRequest[POST //portal/delegate/dashboard/WVWZZZAUZJXXXXXXX/-/vsr/get-request-status HTTP/1.1]@45caa86a.
2020-04-11 20:45:28.272 [DEBUG] [.internal.handler.VWWeConnectHandler] - Content: {“errorCode”:“2”}
2020-04-11 20:45:28.273 [DEBUG] [econnect.internal.VWWeConnectSession] - ErrorCode: 2
2020-04-11 20:45:28.274 [WARN ] [.internal.handler.VWWeConnectHandler] - Failed to request status for vehicle WVWZZZAUZJXXXXXXX! HTTP response: 200 Response: {“errorCode”:“2”}
2020-04-11 20:45:28.274 [WARN ] [.internal.handler.VWWeConnectHandler] - The vehicle WVWZZZAUZJXXXXXXX failed to handle command myvolkswagen.net - Choose your market / language true

thanks for your hard work :slight_smile:
/Chris

Btw. did you change the logic around refresh? :slight_smile:

Yes, I’ve got no problems with activating heater or unlocking car now since I implemented that change.

i tried starting the “emanagerClimate

Since I do not own an electrical VW I’ve not been able to test that at all, it is just hardcoded from API specs that I’ve seen on internet.

I’ve tried to get some debugging help from people owning electrical cars but have not received so much info yet. If you have time we could debug emanager API calls together?

I need someone who owns an electrical car to login into to the VW We Connect portal and use the developer tools to debug the API calls for emanager and send me info about them in a PM.

Sweet, sure, i can do that - do you have some more specific instructions? :slight_smile:
i’m logged in, and have dev tools open, but not sure what you need :slight_smile:

/Chris

The get-xxx API calls that I’m interested in are the ones that are unique for electric cars:

For fetching vehicle status:

  • -/emanager/get-emanager
  • /-/emanager/get-notifications

For performing actions:

  • /-/emanager/charge-battery
  • /-/emanager/trigger-climatisation
  • /-/emanager/trigger-windowheating

and I’m interested in both how the POST message in sent and how the JSON response for the status API calls looks like.

If you also can see a get-status API call, I would be interested to get more info on which parameters that the call uses and how the reponse looks like.

What I’m partculary interested in the API calls are the part that is listed under ‘Request Headers’ in the Headers tab:

image

It is possible to mark the text and copy it via Ctrl-c and then pasting in in a text document with Ctrl-v .
The sensitive data part that you can mask in the vehicle VIN number, this is how the get-status API call looks in my browser:

`Request Headers``

:authority: www.portal.volkswagen-we.com
:method: POST
:path: /portal/delegate/dashboard/WVxxxxxxxxxxxxxxxxxx/-/rah/get-status
:scheme: https
accept: application/json, text/plain, */*
accept-encoding: gzip, deflate, br
accept-language: sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7
content-length: 0
content-type: application/json;charset=utf-8
cookie: adbCDP=2; COOKIE_SUPPORT=true; CARNET_LANGUAGE_ID=sv_SE; _sdsat_Opt_Out=false; GUEST_LANGUAGE_ID=sv_SE; sc_appvn=VWConnectLandingpage2%3E1%3E1%7CCar-NetCMS%3E2%3E2; AMCVS_1D59171B520E91320A490D44%40AdobeOrg=1; s_cc=true; VW_COOKIE_AGREEMENT=true; AMCV_1D59171B520E91320A490D44%40AdobeOrg=-1303530583%7CMCIDTS%7C18359%7CMCMID%7C38009297664418318793053385746933707846%7CMCAAMLH-1586805483%7C6%7CMCAAMB-1586805483%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%7CMCOPTOUT-1586207883s%7CNONE%7CMCAID%7CNONE%7CvVersion%7C3.3.0; sc_prop32=Car-Net; s_vnum=1588284000169%26vn%3D1; s_invisit=true; sc_appvn=VWConnectLandingpage2%3E1%3E1%7CCar-Net%3E1%3E1; s_cc=true; sc_prevpage=Car-Net%20%3A%20home%20%3A%20Viewport%20%3A%20top-of-page; LFR_SESSION_STATE_20159=1586200954456; JSESSIONID=955B2C27727AC9DD3187D0E92CD438E2.green-1
origin: https://www.portal.volkswagen-we.com
referer: https://www.portal.volkswagen-we.com/portal/delegate/dashboard/WVxxxxxxxxxxxxxxxx
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
x-csrf-token: XdSCOei7

Response JSON

{"errorCode":"0","timerCount":3,"remoteAuxiliaryHeating":{"status":{"active":false,"operationMode":"HEATING","outdoorTemp":"8 °C","remainingTime":30},"timers":[{"timerId":1,"active":false,"weekDay":6,"time":{"hours":0,"minutes":0},"nextActivationDate":"11.04.2020"},{"timerId":2,"active":false,"weekDay":6,"time":{"hours":0,"minutes":0},"nextActivationDate":"11.04.2020"},{"timerId":3,"active":false,"weekDay":6,"time":{"hours":0,"minutes":0},"nextActivationDate":"11.04.2020"}]}}

Hi,
sent you a PM now with more logs i hope is helpful :slight_smile:

/Chris

I also own a skoda …

You may tell me what i have to check to compare?

You may tell me what i have to check to compare?

I’ve would need to see the login sequence to the Skoda Connect Web Portal and also the API calls for fetching status info and for actions.

The VW API has the following status API endpoints:

  • mainnavigation/load-car-details
  • vehicle-info/get-vehicle-details
  • vsr/request-vsr
  • vsr/get-vsr
  • rts/get-latest-trip-statistics
  • cf/get-location
  • rah/get-status
  • emanager/get-emanager

and the following action URLs:

  • vsr/remote-lock/unlock
  • rah/quick-start/stop
  • emanager/charge-battery
  • emanager/trigger-climatisation
  • emanager/trigger-windowheating

Use your browsers developer tools (In Chrome right-click and select Inspect), then use the Network tab to trace all HTTP traffic between your browser and the Skoda Connect Portal. Look for HTTP POST containing get-xxx e.g.

Check Headers for the complete API POST and Response for the JSON response.

Save them all in a log file and send to me in a PM. Make sure not to include any login details.

I suspect the Skoda Connect Portal has a totally different API, hence it will be very difficult for me to reverse engineer it, since I don’t own a Skoda.

It is probably a better idéa in that case to create a separate binding for the Skoda Connect Portal and that someone that owns a Skoda does the implementation.

I’ve done som refactoring of the binding, fixing some new stuff for electrical cars (hopefully, maybe broken old stuff) :wink: README has also been updated with new channels for electrical cars.
It has been running successfully in my production environment for a couple of days, original post has been updated.

I’ve up’ed my development environment to upcoming 2.5.4 so you need to remove the old jar-file from
/usr/share/openhab2/addons folder before dropping this one there.

You might also need to launch the karaf console and stop the old version if it still running and then start the 2.5.4-version. In my example below I’ve already done that, just showing the commands for stop/start, but you probably know that already.

[22:47:52] openhabian@openhab:~$ openhab-cli console

Logging in as openhab
Password:  

                          __  _____    ____      
  ____  ____  ___  ____  / / / /   |  / __ )     
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  | 
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /      
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/     
    /_/                        2.5.1
                               Release Build   

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab> bundle:list |grep -i vw
370 │ Active    │  80 │ 2.5.4.202004091524      │ openHAB Add-ons :: Bundles :: VW We Connect Binding
openhab> bundle:stop 367
openhab> bundle:start 370

Then re-discover your VW by deleting the thing and then re-discover it.

Really interested to get feed-back from people owning an electrical VW.
DEBUG log for the get-emanager API call would be nice to get. :smiley:

1 Like

Hi Jan,

thanks a lot for the great work so far. I’m currently driving a passat GTE, so a hybrid and some of the e-manager API’s should work.

What I’m missing is the current overall mileage of the car. Is this expected to be returned by the API? I see it in the VW mobile app.

I’ve tried to start to climate the car, which was not working.
I’ve plugged it in charging. This state is also not reflected.
I’ve tried to start to climate the car again, which was again not working, even it is plugged in.

I’ll PM you the corresponding debug log.

Keep up the great work. I would really appreciate some more fixes;) I’m happy to test if you need more support.