Closed Mariusthvdb closed 8 months ago
Hi @Mariusthvdb,
Can you please enable the debug logging as mentioned here and share the logs? VW's backend returns something strange. I need to see what exactly.
I already checked that but nothing special really. I'll drop it when at the desk
Something is wrong with the oilServiceDue_days
value in the backend response.
this would be it, repeating every 5 minutes
btw, clicking that error in HA Log, navigates to the HA sensor documentation or issues, and not to your Custom Component. it made me look in HA issues first before I noticed that
also, when I check the Volkswagen app, there is much more to see and even control. I can beep the horn ;-)
are those not all available in the CC? or, put differently, how can we see what is exposed by the API, and what not?
Enable the debugging the way I explained in the wiki page I've shared above. Currently your logs are missing requests and responses from the API.
regarding Horn & Turn Signals, I don't remember somebody asking for it. So it was never implemented.
Enable the debugging the way I explained in the wiki page I've shared above. Currently your logs are missing requests and responses from the API.
I had that:
and this:
so figured that to be the correct settings for debugging.. sorry if that wasnt the case. now restarting, ill be back
regarding Horn & Turn Signals, I don't remember somebody asking for it. So it was never implemented.
can this be considered the ask, or do you need a specific FR for it
oil is mentioned in:
2024-03-15 12:27:00.810 DEBUG (MainThread) [volkswagencarnet.vw_connection] Request for "https://emea.bff.cariad.digital/vehicle/v1/vehicles/Wredfacted5/capabilities" returned with status code [200], headers: <CIMultiDictProxy('Date': 'Fri, 15 Mar 2024 11:27:00 GMT', 'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '1166', 'Connection': 'keep-alive', 'Bff-Trace-Id': 'ca08redacted6439af', 'Content-Encoding': 'gzip', 'Content-Security-Policy': "default-src 'self'", 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'Vary': 'Accept-Encoding', 'X-Content-Type-Options': 'nosniff', 'X-Dns-Prefetch-Control': 'off', 'X-Download-Options': 'noopen', 'X-Frame-Options': 'DENY', 'X-Xss-Protection': '1; mode=block')>, response: {'vin': 'Wredfacted5', 'capabilities': {'honkAndFlash': {'id': 'honkAndFlash', 'expirationDate': datetime.datetime(2027, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'postHonkandflash': {'id': 'postHonkandflash', 'scopes': ['honk']}, 'getHonkandflashRequestsByID': {'id': 'getHonkandflashRequestsByID', 'scopes': ['honk']}}, 'parameters': []}, 'oilLevelStatus': {'id': 'oilLevelStatus', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getStates': {'id': 'getStates', 'scopes': ['parkingBrakeStatus', 'ignitionStatus', 'oilLevels']}}, 'parameters': []}, 'vehicleWakeUp': {'id': 'vehicleWakeUp', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'postVehiclewakeup': {'id': 'postVehiclewakeup', 'scopes': []}, 'getVehiclewakeupRequestsByID': {'id': 'getVehiclewakeupRequestsByID', 'scopes': []}}, 'parameters': []}, 'access': {'id': 'access', 'expirationDate': datetime.datetime(2027, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': False, 'status': ['InsufficientRights', 'InsufficientSecurityLevel'], 'operations': {'postAccessLockwithoutspin': {'id': 'postAccessLockwithoutspin', 'scopes': ['lock_unlock']}, 'getAccessRequestsByID': {'id': 'getAccessRequestsByID', 'scopes': ['lock_unlock']}, 'postAccessUnlock': {'id': 'postAccessUnlock', 'scopes': ['lock_unlock']}, 'postAccessUnlockwithoutspin': {'id': 'postAccessUnlockwithoutspin', 'scopes': ['lock_unlock']}, 'postAccessLock': {'id': 'postAccessLock', 'scopes': ['lock_unlock']}}, 'parameters': []}, 'personalizationOnline': {'id': 'personalizationOnline', 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {}, 'parameters': []}, 'vehicleHealthWarnings': {'id': 'vehicleHealthWarnings', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getWarninglightsLast': {'id': 'getWarninglightsLast', 'scopes': ['warning_lights']}}, 'parameters': []}, 'vehicleLights': {'id': 'vehicleLights', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getLightsStatus': {'id': 'getLightsStatus', 'scopes': ['vehicleLights']}}, 'parameters': []}, 'vehicleWakeUpTrigger': {'id': 'vehicleWakeUpTrigger', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'postVehiclewakeupUpdate': {'id': 'postVehiclewakeupUpdate', 'scopes': []}}, 'parameters': []}, 'dealerAppointment': {'id': 'dealerAppointment', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': True, 'endpoint': 'vs', 'isEnabled': False, 'status': ['InitiallyDisabled', 'DisabledByUser'], 'operations': {'getPredictivemaintenanceDealerappointment': {'id': 'getPredictivemaintenanceDealerappointment', 'scopes': ['serviceInterval']}, 'getWarninglightsLast': {'id': 'getWarninglightsLast', 'scopes': ['warning_lights']}, 'getMaintenanceStatus': {'id': 'getMaintenanceStatus', 'scopes': ['serviceInterval']}}, 'parameters': []}, 'measurements': {'id': 'measurements', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getMeasurements': {'id': 'getMeasurements', 'scopes': ['range', 'mileage']}}, 'parameters': []}, 'parkingPosition': {'id': 'parkingPosition', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getParkingposition': {'id': 'getParkingposition', 'scopes': ['parking_position']}}, 'parameters': []}, 'transactionHistoryAntiTheftAlert': {'id': 'transactionHistoryAntiTheftAlert', 'expirationDate': datetime.datetime(2027, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getTransactionhistoryAntitheftalarm': {'id': 'getTransactionhistoryAntitheftalarm', 'scopes': ['messageCenter']}}, 'parameters': []}, 'tripStatistics': {'id': 'tripStatistics', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getTripdataCyclicLast': {'id': 'getTripdataCyclicLast', 'scopes': ['tripStatistics']}, 'deleteTripdataCyclicByID': {'id': 'deleteTripdataCyclicByID', 'scopes': ['tripStatistics']}, 'deleteTripdataLongterm': {'id': 'deleteTripdataLongterm', 'scopes': ['tripStatistics']}, 'getTripdataLongterm': {'id': 'getTripdataLongterm', 'scopes': ['tripStatistics']}, 'deleteTripdataShortterm': {'id': 'deleteTripdataShortterm', 'scopes': ['tripStatistics']}, 'getTripdataShorttermLast': {'id': 'getTripdataShorttermLast', 'scopes': ['tripStatistics']}, 'deleteTripdataShorttermByID': {'id': 'deleteTripdataShorttermByID', 'scopes': ['tripStatistics']}, 'getTripdataCyclic': {'id': 'getTripdataCyclic', 'scopes': ['tripStatistics']}, 'getTripdataLongtermLast': {'id': 'getTripdataLongtermLast', 'scopes': ['tripStatistics']}, 'deleteTripdataLongtermByID': {'id': 'deleteTripdataLongtermByID', 'scopes': ['tripStatistics']}, 'getTripdataShortterm': {'id': 'getTripdataShortterm', 'scopes': ['tripStatistics']}, 'deleteTripdataCyclic': {'id': 'deleteTripdataCyclic', 'scopes': ['tripStatistics']}}, 'parameters': []}, 'vehicleHealth': {'id': 'vehicleHealth', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {}, 'parameters': []}, 'state': {'id': 'state', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getAccessStatus': {'id': 'getAccessStatus', 'scopes': ['doors_windows']}}, 'parameters': []}, 'transactionHistoryAntiTheftAlertDelete': {'id': 'transactionHistoryAntiTheftAlertDelete', 'expirationDate': datetime.datetime(2027, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'deleteTransactionhistoryAntitheftalarm': {'id': 'deleteTransactionhistoryAntitheftalarm', 'scopes': ['messageCenter']}}, 'parameters': []}, 'transactionHistoryLockUnlock': {'id': 'transactionHistoryLockUnlock', 'expirationDate': datetime.datetime(2027, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': False, 'status': ['InsufficientRights', 'InsufficientSecurityLevel'], 'operations': {'getTransactionhistoryAccess': {'id': 'getTransactionhistoryAccess', 'scopes': ['messageCenter']}}, 'parameters': []}, 'destinations': {'id': 'destinations', 'expirationDate': datetime.datetime(2027, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getDestinations': {'id': 'getDestinations', 'scopes': ['navigation']}, 'postDestinations': {'id': 'postDestinations', 'scopes': ['navigation']}, 'putDestinations': {'id': 'putDestinations', 'scopes': ['navigation']}, 'deleteDestinationsByID': {'id': 'deleteDestinationsByID', 'scopes': ['navigation']}}, 'parameters': [{'key': 'chargingStationsForEVTourImport', 'value': ''}]}, 'vehicleHealthInspection': {'id': 'vehicleHealthInspection', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getMaintenanceStatus': {'id': 'getMaintenanceStatus', 'scopes': ['serviceInterval']}}, 'parameters': []}, 'fuelStatus': {'id': 'fuelStatus', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {'getFuelStatus': {'id': 'getFuelStatus', 'scopes': ['fuelLevels']}}, 'parameters': []}, 'roadsideAssistant': {'id': 'roadsideAssistant', 'expirationDate': datetime.datetime(2054, 3, 13, 15, 1, tzinfo=datetime.timezone.utc), 'userDisablingAllowed': False, 'endpoint': 'vs', 'isEnabled': True, 'status': [], 'operations': {}, 'parameters': []}}, 'parameters': {}}
and
2024-03-15 12:27:12.956 DEBUG (MainThread) [custom_components.volkswagencarnet.sensor] Getting state of oil_inspection
2024-03-15 12:27:12.956 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.golf_oil_inspection_days for domain sensor with platform volkswagencarnet
File "/config/custom_components/volkswagencarnet/__init__.py", line 302, in async_write_ha_state
File "/config/custom_components/volkswagencarnet/sensor.py", line 60, in native_value
File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_dashboard.py", line 181, in state
File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_dashboard.py", line 88, in state
File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_vehicle.py", line 891, in oil_inspection
File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_utilities.py", line 72, in find_path
File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_utilities.py", line 72, in find_path
File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_utilities.py", line 72, in find_path
and
2024-03-15 12:27:10.136 DEBUG (MainThread) [volkswagencarnet.vw_dashboard] Wredfacted5 Oil inspection days is supported
2024-03-15 12:27:10.142 DEBUG (MainThread) [volkswagencarnet.vw_dashboard] Wredfacted5 Oil inspection distance (Sensor:oil_inspection_distance) is not supported
Honk and Flash is enabled ;-) so hope that can be added indeed
2024-03-15 12:27:00.810 DEBUG (MainThread) [volkswagencarnet.vw_vehicle] Discovered enabled service: honkAndFlash```
you should have a request towards selectivestatus
API in the logs, I need a response from there. :)
right... like this?
yes! thanks. :) found a bug. will push the fix soon.
Btw, your vehicle don't have this data for whatever reason (VW Bug? Not set by the VW in the infotainment system?):
"vehicleHealthInspection": {
"maintenanceStatus": {
"value": {
"carCapturedTimestamp": "datetime.datetime(2024, 3, 15, 13, 27, 9, tzinfo=datetime.timezone.utc)",
"inspectionDue_days": 723,
"inspectionDue_km": 30000,
"mileage_km": 112
}
}
}
Btw, your vehicle don't have this data for whatever reason (VW Bug? Not set by the VW in the infotainment system?):
could be, only second day we have it parked ;-)
I did activate the lock toggles just now, but can not seem to get the Locks to be open-end/closed
also, seems there is an omission in the car type, and we have an eTSi, supposed top be Hybrid, and no secondary car type is registered?
showing this Golf/None on all more-info
Nor do we have any light entity, and those seem supported too (left/right) in the debug logs
This is not how VW exposes this vehicle:
"fuelStatus": {
"rangeStatus": {
"value": {
"carCapturedTimestamp": "datetime.datetime(2024, 3, 15, 13, 27, 9, tzinfo=datetime.timezone.utc)",
"carType": "gasoline",
"primaryEngine": {
"type": "gasoline",
"currentSOC_pct": 93,
"remainingRange_km": 710,
"currentFuelLevel_pct": 93
},
"totalRange_km": 710
}
}
},
"carType": "gasoline",
and there is no secondary engine as well.
regarding light entities, you should have parking_light
sensor, which represents the light entities.
correct, there's a binary for the lights. I was hoping for light entities and control....
odd that VW doesnt expose the car as Hybrid. But, since you're correct there, why show the /None
, seems ugly and no additional value there?
Last question: the system obviously is aware of the chassis number (its in all log lines...), why is there no entity for it?
what do you mean by chassis number? VIN? I can expose it, just don't understand what for. :)
odd that VW doesnt expose the car as Hybrid. But, since you're correct there, why show the
/None
, seems ugly and no additional value there?
yes, because the manufacturing year is no longer present in the response. there is a way to catch it, but I don't want to add this complexity only because of this. So currently it's None
. :)
what do you mean by chassis number? VIN? I can expose it, just don't understand what for. :)
Yes , vehicle identification number . It’s Chassi number in NL.
unique identifier on the device ;-)
What for? Well because every now and then we need to look it up…. And having it in an entity would be cool then. Maybe an attribute on the tracker. Or single it out in an entity yes
odd that VW doesnt expose the car as Hybrid.
A eTSI Golf is not "hybrid" in the sense that VW means, so it's correct that it is not exposed as Hybrid. Hybrid means a plug-in vehicle which has batteries that can be charged externally; eTSI is a mild-hybrid vehicle where you cannot control the charging. Hence, no data is available (neither in the VW app).
Yes , vehicle identification number . It’s Chassi number in NL. What for? Well because every now and then we need to look it up…. And having it in an entity would be cool then.
Personally, I wouldn't like to have an entity with the VIN as it doesn't change.
It would be better having it in the integration device info: if I remember well, it was there some years ago (or was it in another integration?). I mean here (Settings > Device & services > Volkswagen We Connect > 1 DEVICE):
Maybe by changing: https://github.com/robinostlund/homeassistant-volkswagencarnet/blob/e2973002c06f76e1b65ff53eaffff22613bf370b/custom_components/volkswagencarnet/__init__.py#L399 to:
"model": f"{self.vehicle.model} ({self.vin})",
@virtualdj I agree. If I have some free time during the weekend, I will add VIN and I will try to return manufacturing year as well.
wow, thanks! really appreciated. for a newcomer to this integration this feels really welcoming.
maybe not the place to keep going here (Ill gladly open a discussion), but would the update interval of 5 minutes keep the toggles from showing 'real time'....? I can see the 5 minute being important, but those toggles are rendered useless because of that really.
btw, on that Vin:
it is used in the app as 'Name' for the card by default, and listed on the opening screen. However, as we can change that into something nicer, like My car ( ;-) ) there seems to be no other spot in the app we can find the VIN anymore?? It's also under 'settings' but changing that only changes the displayed name..
would the update interval of 5 minutes keep the toggles from showing 'real time'....? I can see the 5 minute being important, but those toggles are rendered useless because of that really.
As far as I understand, when toggling a switch (for example "charging") the integration sends the REST command to the VW servers. If they reply with the new status, the switch state is updated immediately.
But if the VW servers are slow to answer (and normally they are!) the switch keeps its state until the answer arrives and you can get something like the animations below, with switch "bouncing".
Changing from maximum to reduced charging current:
Changing from reduced to maximum charging current:
Previously, @oliverrahner has discovered that the VW app was using sort of subscription model to update its controls, but I'm not sure if this method has eventually been implemented here in this integration (and also if it is worth implementing).
btw, on that Vin it is used in the app as 'Name' for the card by default
With "app" do you mean Home Assistant? The VIN is used as the name only if you do not supply a customized one during configuration.
there seems to be no other spot in the app we can find the VIN anymore
Of course, because it is a personal ID so it's better for it to stay hidden.
Personally, I wouldn't like to have an entity with the VIN as it doesn't change.
That would probably be the same for the type...
With "app" do you mean Home Assistant?
No, I meant the landing page in the VW app.
But if the VW servers are slow to answer (and normally they are!)
Yes, I can confirm that even the toggle in the VW app doesnt change state and shows the 'updating...' state, though the locks seem to toggle quite directly.
Previously, @oliverrahner has discovered that the VW app was using sort of subscription model to update its controls, but I'm not sure if this method has eventually been implemented here in this integration (and also if it is worth implementing).
The official app and the integration both work in the same way, both polling pendingrequests
to check the status of the request. This API was reintroduced by VW about a month ago and I've added it in the version 4.5.3. This API also seems to be outside of the rate limit, so can be called as much as the app or the integration need.
As far as I understand, when toggling a switch (for example "charging") the integration sends the REST command to the VW servers. If they reply with the new status, the switch state is updated immediately.
But if the VW servers are slow to answer (and normally they are!) the switch keeps its state until the answer arrives and you can get something like the animations below, with switch "bouncing".
The operation is asynchronous, the request is sent to the VW backend, and the backend needs to reach out to the vehicle/wake up the vehicle, the vehicle should process the request and reply with the status. All this process can sometimes take a few minutes and sometimes it might fail as well if the vehicle is unreachable or failed to process the request.
Personally, I wouldn't like to have an entity with the VIN as it doesn't change.
That would probably be the same for the type...
Yes, that doesn't change too, but I think it was meant to help automations based on this integration (such as blueprints) to check if they are dealing with the correct electric / hybrid / petrol vehicle.
The VIN, instead, is specific for a single vehicle and apart from using it for copying and pasting it would not be useful.
With "app" do you mean Home Assistant?
No, I meant the landing page in the VW app.
Yep, in the app you can view the VIN using the + icon in the upper right part of the screen.
Yes, I can confirm that even the toggle in the VW app doesnt change state and shows the 'updating...' state, though the locks seem to toggle quite directly.
Me too with the lock!
ok, so I installed the update, restarted, cleared cache etc, but still the same issue with the oil sensor not being available...
Ive now deleted it via the UI, and gave it a restart to see if a new entity is created. That didnt happen.
I believe I did see in the car dashboard itself that on the oil service indication ------
was shown, so maybe that could be the issue at hand, it simply isnt set?
Iguess, in that case the entity shouldnt be unavailable, but unknown
Before you post a new issue - you must first check the following (and check the boxes with an "X" below)
Environment
Describe the bug
As in log, a single (of the 39 entities)
sensor.golf_oil_inspection_days
is unavailable,Steps to Reproduce
nothing special, simply connected the app with the VW service, all went well, integration setup correctly and complete.
Expected behavior
see sensor be available
Screenshots
Traceback/Error logs
Debug information - all JSON responses from logfile
Additional context
the entity Is enabled....