ConnectedCar Binding myAudi, Volkswagen, VW ID, Skoda, Enyaq, Seat, Ford, WeCharge

Hey,
i have openhab 3.4 and use the 3.2 Binding.

I have a VW E-Up an wanted to create a VW-ID Bridge, but i get the folliwing error:

2023-03-01 08:56:19.071 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'connectedcar:vwid:525672e573' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): API call failed!

If i create a CarConnect Account i get the following error:

2023-03-01 08:58:52.392 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'connectedcar:volkswagen:bb7cec1821' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Forbidden

Do you have any idea whats going wrong?

First question is: Which type of account do you have?

As listed in the docs, I think you should try CarNet:

BUT: As said in

it’s not fully functional yet again.

And of course you have to use the latest version (see second link)

Hi,
i tried installing the Snapshot 3.4.2. but it woulden’t show when i add a Thing. I then tried adding Snapshot 3.3 and that worked straight out of the Box. Am I missing something. My Openhab Version is 3.3.0. Could that already be the problem?

Hi @jan_cologne,
maybe it is a comparible topic as @Jens: I had the same behaviour like you with my Skoda Enyaq (which happened after ME3 update). I had to enable in the cars menue the data sharing. In Skoda menu you had to go to “user”, therein “setup”, then “privacy settings”, then “vehicle/using data”.
I hope this helps.
Regards
Christian

I can confirm,

The binding has been very helpful, as it is much easier to use than the much more complex MQTT integration - question therefore: any ideas if an updated version incorporating the URL changes is planned?
Thanks to everybody in this topic who contributes and got the binding working in the past!

Today I start integration for my Tiguan 2018 and Carnet. Bridge is online and for example the last online date is also visible in openhab. I enter the SPin for pre-heating. If I want start it I get an error message :

WVGxxxxxxxxxxxxx: Status from service rheating_v1.P_QSACT: API call failed POST https://msg.volkswagen.de/fs-car/bs/rs/v1/VW/DE/vehicles/WVGxxxxxxxxxxxxx/climater/actions (HTTP 400 null), result = {“error”:{“errorCode”:“gw.error.parameter”,“description”:“Disallowed query parameters”}}

Looks like it’s also a problem of a changed URL - or has someone another idea ?

The URL has not changed, but the Parameters and the ContentType has changed. I have changed the Parameters in my Test Addon. I will test the addon the next week if the rheating is working.

Changed the contentType and body from the controlClimater Function:

// json format, e.g. VW
contentType = "application/json; charset=UTF-8";
body = "{\"action\": {\"settings\": {\"climatisationWithoutHVpower\": True, \"heaterSource\": \""
            + heaterSource + "\"}, \"type\": \"startClimatisation\"}}";

Full Function:

    public String controlClimater(boolean start, String heaterSource) throws ApiException {
        String contentType = "application/vnd.vwg.mbb.ClimaterAction_v1_0_0+xml;charset=utf-8";
        String body = "", action = "";
        boolean secToken = !CNAPI_HEATER_SOURCE_ELECTRIC.equals(heaterSource);
        if (start) {
            if ((config.account.apiLevelClimatisation == 1) || heaterSource.isEmpty()) {
                // simplified format without header source, Skoda?
                body = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><action><type>startClimatisation</type></action>";
            } else if (config.account.apiLevelClimatisation == 3) {
                // standard format with header source, e.g. E-Tron
                body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><action><type>startClimatisation</type>"
                        + "<settings><heaterSource>" + heaterSource + "</heaterSource></settings></action>";
            } else {
                // json format, e.g. VW
                contentType = "application/json; charset=UTF-8";
                body = "{\"action\": {\"settings\": {\"climatisationWithoutHVpower\": True, \"heaterSource\": \""
                        + heaterSource + "\"}, \"type\": \"startClimatisation\"}}";
            }
            action = CNAPI_HEATER_SOURCE_ELECTRIC.equalsIgnoreCase(heaterSource)
                    ? CNAPI_ACTION_REMOTE_PRETRIP_CLIMATISATION_START_ELECTRIC
                    : CNAPI_ACTION_REMOTE_PRETRIP_CLIMATISATION_START_AUX_OR_AUTO;
        } else {
            // stop climater
            body = "<action><type>stopClimatisation</type></action>";
        }
        return sendAction("bs/climatisation/v1/{0}/{1}/vehicles/{2}/climater/actions",
                CNAPI_SERVICE_REMOTE_PRETRIP_CLIMATISATION, start ? action : CNAPI_ACTION_REMOTE_HEATING_QUICK_STOP,
                secToken, contentType, body);
    }

I also found my problem with the preheater. VW has two “preheater” ?!?. The Preheater Channel is for “Diesel PreHeaters or ParkHeaters” and the petrol preheater is controlled with the controlClimater Function. I have to choose the correct HeatSource (electric,auxiliary).

But the HeatSource has also problems with the right Thing-Channel-Group. Don´t know if i can fix this with my knowlege about openhab addons and java…

i had to edit the sendAction function also because of a typo. otherwise the SPin or the token for it is not transferred correctly

changed form " X-securityToken" to “X-securityToken”

    private String sendAction(String uri, String service, String action, boolean reqSecToken, String contentType,
            String body) throws ApiException {
        String message = "";
        try {
            if (reqSecToken && config.vehicle.pin.isEmpty()) {
                message = "Action " + service + "." + action + " requires the SPIN, but it's not configured!";
            } else if (isRequestPending(service)) {
                message = "Request " + service + "." + action
                        + " is rejected, there is already a request pending for this service!";
            } else {
                logger.debug("{}: Sending action request for {}.{}, reqSecToken={}, contentType={}", config.vehicle.vin,
                        service, action, reqSecToken, contentType);
                Map<String, String> headers = fillActionHeaders(contentType, createAccessToken(),
                        CNAPI_ACTION_REMOTE_PRETRIP_CLIMATISATION_START_AUX_OR_AUTO.equals(action) ? "X-securityToken"
                                : "x-mbbSecToken",
                        reqSecToken ? createSecurityToken(service, action) : "");
                String json = http.post(uri, headers, body).response;
                return queuePendingAction(service, action, json);
            }
        } catch (ApiException e) {
            message = e.toString();
        }
        if (eventListener != null) {
            eventListener.onActionNotification(service, action, message);
        }
        return API_REQUEST_REJECTED;
    }

Thanks Michi, I can find the source place to change but no clue how to compile a binding. I know thats to much but it would help if you can share a link. Java is new for me and no real clue how it works.

Many Thanks, Christian

Hi Michi,

first thanks again - for me it works now. The switch is control_Ventilation for VW Carnet - this works.

I’m wrong - control_Ventilation startet the preheating in ventilation mode - controlClimater is not there. Will check.

Very cool. An interesting thing is that it works much more faster like the carnet app.

bests, Christian