Custom Integration: Volkswagen WeConnect ID (Europe)

Awesome integration - using it with an ID.7 without issues. Or, well, there’s the same issue as when using the official app: When the car has two users whoever drove the car last is the one who has access to it from the app/their ID account.

So when my partner was the last one to use the car the integration (authenticating with my id) can’t get any data (due to GDPR/privacy). I’ve been thinking to maybe add both our id:s to the integration and detect when it’s time to switch from the responses - but maybe this has been discussed already?

1 Like

I wish that would be the case! I have the same situation with my ID5 and my wife drives it more than I. There are some data points that show up regardless of who drives, but the important ones like range and time to complete charge, climatization etc don’t show.

This appears to be a problem with the way VW has implemented privacy (possibly for regulatory reasons, I know that even within the EU Germany is particularly strict on privacy).

I ‘solved’ it by only using one profile in the car, but thats kind of annoying (and probably a real pain if you have electrically operated seats with positions linked to each profile, which we don’t).

Yes that is an issue but as the owner, regardless of privacy, certain metrics related charge and vehicle statistics should be made available. Personalised info should not.

It looks as if I only get the following warning when the ID account used by the integration is not the one logged into the vehicle. That could be used to trigger a switch to another configured profile.


[weconnect] /vehicles/*/domains/chargingProfiles/chargingProfilesStatus: Unknown attribute vehiclePositionedInProfileID with value 1

Seems slightly shaky as a general rule though, it would be better if there was something specific returned that clearly indicated this being the case. I’m sure there is since the app states that the current information shown is limited due to privacy reasons.

I receive a “too many requests” error. Is there any way to rate-limit the integration? It has become unusable because of this.

raise TooManyRequestsError('Could not fetch data due to too many requests from your account. '
weconnect.errors.TooManyRequestsError: Could not fetch data due to too many requests from your account. Status Code was: 429

Hi, I have two cars/devices registered under this integration but one got sold. Did someone knows a procedure to delete one of the devices -if you have multiple under this integration- for good? Many thanks!

@RoSche

I think you have to log into your VW account on the web and remove the car there.

Many thanks. I did remove it there already. My challenge is rather that it is still listed as one device under the HA integration and I fail to get it removed there.

Every couple of days its the same pattern, it works for a day or too and then stops, logs show only

[custom_components.volkswagen_we_connect_id] Unexpected error fetching volkswagen_we_connect_id data

Running HA 2024.6.1 and v0.2.3 but the problem has been ongoing for months on many differing versions. It’s got to the point that I feel like giving up on the integration

I have to restart HA to resolve

I am new to this integration. I see that it offers many sensors. However, I mainly hoped to use it to balance the electricity load. From HA, does this integration allow me to:

  • switch on/off the charging activity?

  • configure the charging speed?

You can by calling a service in automation

Volkswagen We Connect ID: Volkswagen ID Set AC Charge speed
Volkswagen We Connect ID: Volkswagen ID Set Target SoC
Volkswagen We Connect ID: Volkswagen ID Start or Stop Charging

Personally I found it too unreliable, though your mileage may vary

1 Like

Hi,

This plugin worked for a long time but since a couple of weeks it is no longer updating.

Under integrations I see the following error:

I don’t know how to solve this. I was looking for a way to check where to configure the login details but can’t seem to find it.

The documentation page is giving an error.

Thanks for any tips.

1 Like

The integration is acting up for me as well. It freezes. It may show e.g. the same battery charge level for hours even though the battery is being charged.

I have to manually restart the integration, it usually helps.

Sometimes the sensors go to “unavailable“ state. I think I could make an automation to reload the integration should this happen.

Very nice work @mitchztm!

Unfortunately it did not work für my e-Up, but with small changes I got it work for most of the sensors:

You may try what I did today:

volkswagen_we_connect_id # diff -u __init__.py.old __init__.py
--- __init__.py.old	2024-08-17 12:51:01.000000000 +0200
+++ __init__.py	2024-08-17 17:03:49.029374797 +0200
@@ -33,7 +33,7 @@
 
 _LOGGER = logging.getLogger(__name__)
 
-SUPPORTED_VEHICLES = ["ID.3", "ID.4", "ID.5", "ID. Buzz", "ID.7 Limousine"]
+SUPPORTED_VEHICLES = ["ID.3", "ID.4", "ID.5", "ID. Buzz", "ID.7 Limousine", "e-up!"]
 
 
 @dataclass
@@ -67,6 +67,8 @@
         for vin, vehicle in _we_connect.vehicles.items():
             if vehicle.model.value in SUPPORTED_VEHICLES:
                 vehicles.append(vehicle)
+            else:
+                _LOGGER.error("UNSUPPORTED vehicle '%s'. Skipped ", vehicle.model.value)
 
         domain_entry: DomainEntry = hass.data[DOMAIN][entry.entry_id]
         domain_entry.vehicles = vehicles
volkswagen_we_connect_id # diff -u number.py.old number.py
--- number.py.old	2024-08-17 12:51:01.000000000 +0200
+++ number.py	2024-08-17 14:03:03.521105950 +0200
@@ -77,7 +77,7 @@
         return int(
             get_object_value(
                 self.data.domains["charging"]["chargingSettings"].targetSOC_pct.value
-            )
+            ) or 0
         )
 
     async def async_set_native_value(self, value: float) -> None:

Problem was that e-Up does not support self.data.domains[“charging”][“chargingSettings”].targetSOC_pct.value .

Right now many of the sensors seem to work:


Not all Sensors are supported by the e-Up. I did test the buttons start-charging and stop-charging. This works. Great! Very nice for automation!

image
image

My dashboard

And yes. It is just a quick hack. No warranty! And just done some hours ago.

But for me it seems sufficient.

Only drawback is that logging shows some sensor that the integration does not know:

2024-08-17 19:02:53.197 WARNING (SyncWorker_15) [weconnect] /vehicles/WVWremoved/domains/charging/chargingSettings: Unknown attribute maxChargeCurrentAC_A with value 10
2024-08-17 19:03:43.702 WARNING (SyncWorker_35) [weconnect] /vehicles/WVWremoved/domains/charging/chargingSettings: Unknown attribute maxChargeCurrentAC_A with value 10
2024-08-17 19:04:30.230 WARNING (SyncWorker_61) [weconnect] /vehicles/WVWremoved/domains/charging/chargingSettings: Unknown attribute maxChargeCurrentAC_A with value 10

But this will not break my homeassistant…

Hmm. After some hours the integration can no longer request from the volkswagen server.

Logging shows

raise TooManyRequestsError('Could not fetch data due to too many requests from your account. ’

It is also no longer possible to access the data via Web:

What ist the recommended polling interval?

With Polling Interval 600 = 10 Minutes everything now works without Problems:

And yes. The unit of consumption should be “kWh/100km”. Seems that homeassistant does not have this unit.

1 Like

@wil what entity are you using for last consumption?

Ah, there is still someone here listening? Thought I am alone here as there have been not feedback to my questions. :wink:

“Last Trip Average Electric consumption” is already supported. What I added is:

  • “Last Trip distance”
  • “Long Term Average Electric consumption”
  • “Long Term distance”

If you enable debugging, you will see that there lots of new SENSORS and VEHICLE_SENSORS that are not in the code. On the other hand there are lots of sensors already in the code that do not have defined values. Maybe they are not for electric vehicles.

This is what I have changed to sensors.py:

olkswagen_we_connect_id # diff -u sensor.py.old sensor.py
--- sensor.py.old	2024-08-21 07:07:05.225946180 +0200
+++ sensor.py	2024-08-17 19:39:53.703055466 +0200
@@ -440,6 +440,30 @@
         native_unit_of_measurement="l/100km",
         value=lambda vehicle: vehicle.trips["shortTerm"].averageFuelConsumption.value,
     ),
+    VolkswagenIdEntityDescription(
+        name="Last Trip distance",
+        key="lastTripmileage_km",
+        icon="mdi:car-arrow-right",
+        device_class=SensorDeviceClass.DISTANCE,
+        native_unit_of_measurement=UnitOfLength.KILOMETERS,
+        value=lambda vehicle: vehicle.trips["shortTerm"].mileage_km.value,
+    ),
+    # long term
+    VolkswagenIdEntityDescription(
+        key="longTermAverageElectricConsumption",
+        name="Long Term Average Electric consumption",
+        native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
+        device_class=SensorDeviceClass.ENERGY,
+        value=lambda vehicle: vehicle.trips["longTerm"].averageElectricConsumption.value,
+    ),
+    VolkswagenIdEntityDescription(
+        name="Long Term distance",
+        key="longTermmileage_km",
+        icon="mdi:car-arrow-right",
+        device_class=SensorDeviceClass.DISTANCE,
+        native_unit_of_measurement=UnitOfLength.KILOMETERS,
+        value=lambda vehicle: vehicle.trips["longTerm"].mileage_km.value,
+    ),
 
 )

The long term ist not really long term. It seems to be 31 days.

Just modify, restart and test if this also works for the ID family.

1 Like

Also enable debugging, There are lots of other sensors not used in the code that could be useful. I just added the LongTerm and also distance which is useful for me but did not look in detail to the other sensor reported back from the VW We connect server.

Please look and report back here if there are other useful sensors. Once done and tested we could ask to enhance the code on github.

Also adding my code für e-Up could be useful. I guess that adding support for e-Golf should be easy. Unfortunately I do not have it.

What I do not understand with the current code is why “lastTripAverageFuelConsumption”, “Fuel Level”, “Oil Inspection days” and others are supported, and other sensors without values but the ID family does not have an combustion engine. Only electric only vehicles are in the SUPPORTED_VEHICLES,
Is this code from a different project?

1 Like