Skoda Connect

I tried both as string and as int. Debugged in VS code and this is the body for the 403:
{"error":{"errorCode":"RS.security.9007","description":"MBB Roles and Rights responded: 403 - Forbidden"}}'

The car is a few days old. Could be something has changed for MY21.

https://mal-1a.prd.ece.vwg-connect.com/api/rolesrights/authorization/v2/security-pin-auth-completed gets securityToken returned so should not be an issue with spin

What car is it?
Because starting parking heater (combustion_engine_heater) isnā€™t available on all models even if the hardwate is there.
Not available on my MY20 Superb iV at least, only electric climatisation.

Edit: just realized you posted a successful(?) start above.
I canā€™t really help there since I donā€™t have the rs function.
Perhaps you can debug the skodaconnect lib? ā€œskodaconnect: debugā€ under logger in configuration.yaml

Merged pull request created by @Farfar and created new plugin version for HA - https://github.com/lendy007/homeassistant-skodaconnect/releases/tag/1.0.10

@tanelv - can you try this branch of library - https://github.com/lendy007/skodaconnect/tree/MY2021_heating_test

I have tried to change there message format to XML when server fal-3a.prd.eu.dp.vwg-connect.com is used. Because this server is for newer model year so maybe it needs XML format instead of JSON. On my car for this heating it was using msg.volkswagen.de server and JSON formatā€¦ If you confirm it is working, I can commit then this branch as permanent fix.

Thank you

1.0.10 does indeed also enable starting climate heating through home assistant for my Superb iV !
Nice work.

I just tried with the following and it works:

name:
  !secret Skoda_VIN: 'Skoda'

Is ā€œRequest in progressā€ supported for anyone with Skoda?
Else I have a plan to implement force refresh of vehicle status data but this will break current implementation that triggers request updates.

I havenā€™t decided what might be the best approach since I donā€™t know how many requests are allowed until VW servers starts throttling (hard limit that gets reset after vehicle start).
Either we implement via manual refresh, a switch in HA that can be used manually or in automations.
Or we configure an automatic refresh based on how old the vehicle data is (with configurable age in configuration.yaml?).

The only problem with manual refresh would be we canā€™t add automations depending on the dataā€¦ like give notification when electric battery is fully charged.

Figured it out! SPIN needs to be validated with
https://mal-3a.prd.eu.dp.vwg-connect.com/api/rolesrights/authorization/v2/vehicles/$vin/services/rheating_v1/operations/P_QSACT/security-pin-auth-requested and
https://mal-3a.prd.eu.dp.vwg-connect.com/api/rolesrights/authorization/v2/security-pin-auth-completed instead and then it works

Iā€™m going to experiment and see if I can trigger data update for the different functions or if thereā€™s only refresh available for the vsr (vehicle status report) as is implemented for VW.

The App have a separate refresh icon on each section and as far as I can tell the update only updates the current section but Iā€™m not sure if itā€™s only a ā€œGETā€ for the latest data on the servers or if it actually triggers an update from the vehicle. Will have to debug the app some more.

But so far when my car has been charging then it updates the data on the servers continuously. Not sure if thatā€™s applicable for all sections though.

Nice!
I see that the SPIN auth is configured statically to mal-1a.prd.ece.vwg-connect.com.

@lendy007 seems like thereā€™s some work to be done to remove the static hosts and use homeregion instead.

@Depechie - you are right, but with manual trigger you can create automation to update how often you wantā€¦

@Farfar - I think we need to implement both - configurable parameter which will compare data age in received reply and update if older than configured parameter and also have manual trigger available for purpose of automations (like if I want to do something at 6:00 with data, I will schedule some force update for 5:55)ā€¦

1 Like

Yes, will also need to check if we are throttled, and if throttled block refresh until new data is received.
I am testing right now how many refresh I can issue before I get throttled.

Awesome overview thanks to this integration, love it!!

2 Likes

@tanelv - you opened my eyes, thank you! During checking this urls I have also found why lock/unlock isnā€™t working - because SPIN token needs to be requested for specific operations and I am trying to lock/unlock with SPIN token for heatingā€¦

Will fix this (but firstly need to fix chimney on my house :smiley:)

1 Like

I just got throttled for opening/closing doors using Android app.
In the request response, I got header X-RateLimit-Remaining and the app notified me that only 1 action remaining. After this the app made a POST to
https://fal-3a.prd.eu.dp.vwg-connect.com/fs-car/bs/vsr/v1/Skoda/CZ/vehicles/VIN/requests
and got response:

HTTP/1.1 429 Too Many Requests
{
    "error": {
        "description": "TSS responded: 429 -",
        "errorCode": "VSR.technical.9025"
    }
}
1 Like

Yes the 429 http code weā€™ve known about, itā€™s common for apis to use it.
The X-RateLimit-Remaining is great to know about! If a check is implemented then a potential automatic refresh can be deactivated so at least a few requests remain.

I successfully sent 15-ish refresh requests over a period of 1.5 hours until I got throttled.
Did you keep count?
Itā€™s harder to keep track in the app since one action doesnā€™t necessarily wake up the car.

Created a pull request for both fixes.

Thank you @tanelv - pull request merged, new plugin version released :slight_smile:

3 Likes

I just tried with the following and it works:

name:
  !secret Skoda_VIN: 'Skoda'

Odd, it didnā€™t work for me. Maybe I got the syntax wrong somehowā€¦ Anyway, thanks for letting me know - Iā€™ll try again.