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

Are the sources of this addon available? is it open source?

Of course, like all openHAB addons, licensed under EPL2.0.
There is a pending Pull Request and sources can be found in Markus‘ repository.

ah, found it thanks

Be carefull, this is the openHAB 2.5 branch, there is also an openHAB 3.3 one, which contains latest code.

Support for OH 2.5 has been dropped, requires at least 3.2
@tknaller has forked my repo and did the last changes
we need to merge those, but I’m still buys with the Shelly binding

It appears that some values were dropped by mid June, probably by the API/vendor. While I earlier had channels for windows’ status (open|closed) and position (%), I now only get statuses. TRACE log doesn’t carry window positions. Same for totalRange (now only PrimaryRange and SecondaryRange), fuelMethod and tempOutside. Missing those is not harming, but worth mentioning here, to see if other values were dropped similarly.
In log I found a value I didn’t see before: status#carMoving, but not exposed in MainUI or accessible via text config.

WVWZZZxxxxxxxxxx: Channel status#carMoving updated with OFF (type class org.openhab.core.library.types.OnOffType)

Since the Fiat 500e was the best selling eCar in 2021 in Germany I would appreciate it if it could be implemented here. At the moment I am using ioBroker solely for this purpose.

1 Like

HI,

tried to get the connected car binding with my ID3 working on OH 3.3 today, but after installing the binding, redefining the things for the bridge and the car, there are no channels shown for the car thing.

I took this snapshot release:

Opening the channels of the “connectedcar:idvehichle” thing there is only this message: “This thing has no channels. Either the thing type doesn’t define channels, or they may be detected and appear later.

I had no problems in 3.2. and there is nothing in openhab.log

Are there any ideas?

Hello @kuczerek,
I am also using new OH 3.3, still successful with no changes compared to 3.2.
BUT: I had a same issue in a totally different binding, also from a separate .jar in addons folder.
What helped: I misconfigured the Thing intentionally by mistyping the Thing type, here e.g. “idvecle”, see it disappearing from Things list, and re-created by correcting that back to “idvehicle”.

Despite of the missing channels and to exclude the typo in your description “idvehichle”, is the car thing marked green/online? Is there a message under the “Status”? Do you use text file config or through MainUI? Does the Bridge present the car thing in Inbox before you create it?

As I found out, the Github user andig has implemented the Cupra Born into evcc.io and the user TA2k into ioBroker.vw-connect. The code is openly available on Github.

As far as I have read, it is quite comparable to the VW ID.

Unfortunately, I don´t have the capability to code it into the ConnectedCar Binding. Is anybody interested in having a look to it and integrating the Cupra Born? I would of course highly appreciate to support the development by testing.

hi,

after upgrading to OH3.3 i am receiving the following error in the logs.

2022-06-29 13:51:27.000 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'connectedcar:volkswagen:f845fd705e' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): API call failed

2022-06-29 13:51:27.001 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'connectedcar:cnvehicle:f845fd705e:WVW12346789087645' changed from UNKNOWN: Initializing to OFFLINE (BRIDGE_OFFLINE)

i am using the latest snapshot from github

281 │ Active │  80 │ 3.2.0.202110251157     │ openHAB Add-ons :: Bundles :: ConnectedCar Binding

can someome help me to get the bridge and things back online?

Hi @philf90,

I suggest you update the binding to the even newer one, as promoted in this thread from time to time:
https://github.com/tknaller/openhab-addons/releases/tag/connectedcar_snapshot_20220225.

1 Like

Hello @markus7017 – I am using latest snapshot 20220225 with Ford and when I enter my credentials I am getting an “API call failed” status. Has there been an update to the FordPass API that hasn’t been updated in the binding? Thanks!

Hi @cwi,

thanks for the advice. In my case I didn’t change the spelling of any thing. I just upgrade the core and left all configurations untouched.

Anyway - I tried again today and everything is fine. Don’t know why it didn’t work some days ago.

Thanks for your support!

I have an Cupra Leon and try to use the Seat Connection Thing. But I am receiving the following exception after entering my credentials.

17:21:11.425 [WARN ] [edcar.internal.handler.AccountHandler] - message.init-fialed: e2e6e96dba
org.openhab.binding.connectedcar.internal.api.ApiException: API call failed
	at org.openhab.binding.connectedcar.internal.api.ApiHttpClient.request(ApiHttpClient.java:200) ~[?:?]
	at org.openhab.binding.connectedcar.internal.api.ApiHttpClient.post(ApiHttpClient.java:111) ~[?:?]
	at org.openhab.binding.connectedcar.internal.api.IdentityOAuthFlow.post(IdentityOAuthFlow.java:121) ~[?:?]
	at org.openhab.binding.connectedcar.internal.api.ApiWithOAuth.login(ApiWithOAuth.java:95) ~[?:?]
	at org.openhab.binding.connectedcar.internal.api.IdentityManager.createAccessToken(IdentityManager.java:103) ~[?:?]
	at org.openhab.binding.connectedcar.internal.api.ApiBase.createAccessToken(ApiBase.java:204) ~[?:?]
	at org.openhab.binding.connectedcar.internal.api.ApiBase.fillAppHeaders(ApiBase.java:200) ~[?:?]
	at org.openhab.binding.connectedcar.internal.api.ApiBase.callApi(ApiBase.java:130) ~[?:?]
	at org.openhab.binding.connectedcar.internal.api.carnet.CarNetApi.getVehicles(CarNetApi.java:199) ~[?:?]
	at org.openhab.binding.connectedcar.internal.handler.AccountHandler.initializeThing(AccountHandler.java:173) ~[?:?]
	at org.openhab.binding.connectedcar.internal.handler.AccountHandler.handleConfigurationUpdate(AccountHandler.java:199) ~[?:?]
	at org.openhab.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:94) ~[?:?]
	at org.openhab.core.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:498) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[bundleFile:3.4.5]
	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[bundleFile:3.4.5]
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) ~[bundleFile:3.4.5]
	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) ~[bundleFile:3.4.5]
	at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) ~[bundleFile:3.4.5]
	at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) ~[bundleFile:3.4.5]
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[bundleFile:3.4.5]
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) ~[bundleFile:3.4.5]
	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) ~[bundleFile:3.4.5]
	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) ~[bundleFile:3.4.5]
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) ~[bundleFile:3.4.5]
	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) ~[bundleFile:3.4.5]
	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225) ~[bundleFile:3.4.5]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298) ~[bundleFile:3.4.5]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPut(AbstractHTTPServlet.java:234) ~[bundleFile:3.4.5]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) ~[bundleFile:3.1.0]
	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273) ~[bundleFile:3.4.5]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) ~[bundleFile:9.4.43.v20210629]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) ~[bundleFile:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) ~[bundleFile:9.4.43.v20210629]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:294) ~[bundleFile:?]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[bundleFile:9.4.43.v20210629]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:82) ~[bundleFile:?]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388) ~[bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:386) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.43.v20210629]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.43.v20210629]
	at java.lang.Thread.run(Thread.java:829) [?:?]

Hi,
If you plan to add Fiat (and Jeep) I have found this api at evcc/vehicle/fiat at master · evcc-io/evcc · GitHub for the recharger but it is too complicate for me.
My wife have a Jeep Renegate Phev and I can help you in testing the Binding if you like

Regards
Lorenzo

2 Likes

i am currently implementing a charging controller with equivalent mode as [evcc-project] .
In the PVMin the loading with minimum current and when PV excess available and in PV only with PV excess.
I do have the situation that the charger is switched off because there is not PV excess available.
In case there is again PV excess the charger is switched on.
That’s the theory.
Unfortunately the my Skoda Superb IV falls into a sleep mode (charging done) and does not start charging again even if the charger would allow it.
I see also that the charger indicated 0.4-0.5 A during the switching on but then the car stops the charging after few seconds.
In the skoda connect app i do get some warning that the charging was interrupted before it falls to sleep.

Has somebody faced similar issues here with the cars?
Is there a mode in the car the prevents it from falling into sleep?

here the current status of my code in javascript JSrule

'use strict';

let me = '[evcc]';
// required to check online state of things
let chargerThing = "goecharger:goe:garage";
let pvThing = 'modbus:data:slave100:slave105holding:Active_power';
let gridMeterThing = 'shelly:shellyem3:zaehlerkeller';

let gridPower = 'EnergiemessungDeviceAccumulatedWatts';
let pvPower = 'sunActive_power';
let consumption = 'AktuellerVerbrauch';
let minimalChargerCurrent = 6;
let powermargin = 'PowerMarge';
let targetBatteryChargeLevelItemName = 'CarTargetChargingLevel';
let maxChargingCurrentItemName ='GoEChargerMaxCurrent';
let actualBatterLevelItemName = 'Superb_ChargerChargingLevel';
let targetBatterLevelItemName = 'CarTargetChargingLevel';
let actualChargePhasesItemName = 'GoEChargerPhases';
let voltageItemName = 'GoEChargerVoltageL1';
let actualChargingPowerItemName = 'GoEChargerPowerSum';
let actualChargingCurrentL1ItemName = 'GoEChargerCurrentL1';
let actualChargerStateItemName = 'GoEChargerAllowCharging';
let socStateItemName = 'GoEChargerPwmSignal';
let evccModeItemName = 'ChargerMode';
let maxChargerCurrentSetpointItemName = 'GoEChargerMaxCurrent';

rules.JSRule({
 name: "ElecticalVehicalChargerControl",
 description: "evcc",
 triggers:[triggers.ItemStateUpdateTrigger('EnergiemessungDeviceAccumulatedWatts')],
 execute: (event) => {
   if (things.getThing(gridMeterThing).status !== 'ONLINE'){
     console.warn(me,'Meter is not online!');
     return;
   }
   if (things.getThing(pvThing).status !== 'ONLINE'){
     console.warn(me,'PV is not online!');
     return;
   }
   if (things.getThing(chargerThing).status !== 'ONLINE'){
     console.warn(me,'Charger is not online!');
     return;
   }

   var actualEnergyAtGrid = items.getItem(gridPower).rawState.floatValue();
   var actualPVProduction = items.getItem(pvPower).rawState.floatValue();
   // calculate the current consumption
   var currentConsumption = 0
   if (actualEnergyAtGrid <= 0){
     currentConsumption = actualEnergyAtGrid + actualPVProduction;
   }else {
     currentConsumption = actualEnergyAtGrid + actualPVProduction;
   }
   items.getItem(consumption).postUpdate(parseInt(currentConsumption));
   
   //calculate the available excess
   var powerMarginValue = items.getItem(powermargin).rawState.floatValue();
   var availableExcess  = 0;
   if (actualEnergyAtGrid < 0){
     availableExcess = -actualEnergyAtGrid + powerMarginValue;
   }

   //check if car is connected
   var chargerPWM = items.getItem(socStateItemName).rawState;
   if (chargerPWM.toString() == 'READY_NO_CAR'){
     console.info(me,'Charger not connected to car:',chargerPWM);
     return;
   }

   // charge with the actual current limit set 
   // verify if the charger is in connect state, else message and exit
   var targetBatteryChargeLevel = items.getItem(targetBatteryChargeLevelItemName).rawState;
   var maxChargingCurrent = items.getItem(maxChargingCurrentItemName).rawState;
   var actualBatterLevel = items.getItem(actualBatterLevelItemName).rawState.intValue();
   var targetBatterLevel = items.getItem(targetBatterLevelItemName).rawState.intValue();
   var differenceChargeLevels = targetBatterLevel - actualBatterLevel;
   var phases = items.getItem(actualChargePhasesItemName).rawState.floatValue();
   if(phases==0){
     // if no charging is happening then phases on charger indicates 0 , override with 1 to make estimate
     phases = 1;
   }
   var voltage = items.getItem(voltageItemName).rawState.floatValue();
   var actualChargingPower = items.getItem(actualChargingPowerItemName).rawState.floatValue();
   var maxAdditionalCurrent = availableExcess / phases / voltage;
   var actualChargingCurrentL1 = items.getItem(actualChargingCurrentL1ItemName).rawState.floatValue();
   var estimmatedTotalChargeCurrent = (maxAdditionalCurrent + actualChargingCurrentL1).toFixed(1);
//    var cableCurrent = items.getItem("GoEChargerCableCurrent").rawState.floatValue();
   var cableCurrent = 16;
   var estimatedMinimalPower = minimalChargerCurrent * voltage;
   if (0 > cableCurrent - estimmatedTotalChargeCurrent ) {
     // cap the current to cable capabilities  
     console.info(me,'Loading with',actualChargingPower.toFixed(0),', maximal addition current:', maxAdditionalCurrent.toFixed(1) , ', capped to max allowed cable current :', cableCurrent);
     estimmatedTotalChargeCurrent = cableCurrent;
   }
   var actualChargerState = items.getItem(actualChargerStateItemName).state;
   console.info(me,'Target battery charge level is:',targetBatteryChargeLevel +'%', 'Current battery level is:',actualBatterLevel, 'delta :',differenceChargeLevels );
   console.info(me,'Grid:',actualEnergyAtGrid.toFixed(1),'PV:',actualPVProduction,'Consumption:' ,currentConsumption.toFixed(1),'Actual charging:',actualChargingPower,'PV Excess:',availableExcess.toFixed(1));

   if (differenceChargeLevels == 0 ) {
     // battery is loaded to target level 
     if (actualChargerState == 'ON'){
       console.info(me,'Target charging reached, stop charging !');
       items.getItem(actualChargerStateItemName).sendCommand('OFF');
     }
     return;
   }

   // possibe charger modes : Off,Now,MinPV,PV
   switch (items.getItem(evccModeItemName).state) {
     case 'Off':
       // update the charger control of this is not yet set
       console.info(me,'mode is [Off]');
       items.getItem(actualChargerStateItemName).sendCommandIfDifferent('OFF');
       break;
     case 'Now':
       // charge with the actual current setting
       items.getItem(actualChargerStateItemName).sendCommandIfDifferent('ON');
       console.info(me,'[NOW]Charging with',maxChargingCurrent,'not yet done, still to go :', differenceChargeLevels, '%');         
       break;
     case 'MinPV':
       // charge with technical minimum current available , e.g. 6 A
       // in case the PV excess is availabel the the load current is adjusted
       // charge with the actual current limit set if the target charge level is not yet reached
       console.info(me,'[MinPV] Charging not yet done, still to go :', differenceChargeLevels, '%');
       items.getItem(actualChargerStateItemName).sendCommandIfDifferent('ON');
       if (minimalChargerCurrent > estimmatedTotalChargeCurrent){
         // cap to minimal current for charging in case lower current is calculated
         items.getItem(maxChargerCurrentSetpointItemName).sendCommandIfDifferent(minimalChargerCurrent);
       } else{
         // set calculated current betwenn min and max 
         items.getItem(maxChargerCurrentSetpointItemName).sendCommandIfDifferent(estimmatedTotalChargeCurrent);
       }
       break;
     case 'PV':
       // charge only when PV exceed is available with technical minimal current
       // if exceed is below technical minimal that op charging
       if (availableExcess == 0){
         console.info(me,'No excess available !');
         items.getItem(actualChargerStateItemName).sendCommandIfDifferent('OFF');
         return;
       }
       console.info(me,'[PV] minimal load', estimatedMinimalPower, 'W / available excess', availableExcess.toFixed(1),'W');  
       if (minimalChargerCurrent > estimmatedTotalChargeCurrent){
         // cap to minimal current for charging in case lower current is calculated
         items.getItem(maxChargerCurrentSetpointItemName).sendCommandIfDifferent(minimalChargerCurrent);
         console.info(me,'[PV] Minimal Current',minimalChargerCurrent, 'reached, switch charging off!');
         items.getItem(actualChargerStateItemName).sendCommandIfDifferent('OFF');
       } else{
         // set calculated current betwenn min and max 
         items.getItem(maxChargerCurrentSetpointItemName).sendCommandIfDifferent(estimmatedTotalChargeCurrent);
         items.getItem(actualChargerStateItemName).sendCommandIfDifferent('ON');
       }
       break;
       } 
 },
 tags: ['Garage', 'Car'],
 id: 'evcc_script'
});

I do the same, controlling the charger over power on/off wallswitch if PV excess is available. Works fine with my VW e-up. However, my wife’s BMW i3 gets all stressed out when i cut the power (OMG I have no power) and refuses to resume charging when i switch the power on again unless I first unplug and reconnect the typ2 plug to the car. Very annoying. I guess you could try start/stop charging via the car’s software, over the binding. I did not try that yet.

Thanks for confirming that this is also happening to you BMW i3.
I tried to start the charging from the app but that was not successful.
I can only get charging working again when i open the car and reconnect the charger cable.
Actually the car with that behavior does not allow to implement a fully PV excess charging mode.
Really annoying.
I will to send feedback to skoda to better understand the reason behind the behavior.
I guess the best would be that the sleep timer in the car should be longer when connection to charger is detected.

If you ask me this is a serious flaw in the car’s software design. Theoretically this would also mean that, when charging at a public charger, you would have the same problem when the public charger loses power for a short period of time for whatever reason. Happened to me once with the i3, had to walk ten minutes to reconnect the damn plug…