robinostlund / homeassistant-volkswagencarnet

Volkswagen Carnet Component for home assistant
GNU General Public License v3.0
327 stars 60 forks source link

[BUG] oil_inspection_days is created but remains unavailable #602

Closed Mariusthvdb closed 6 months ago

Mariusthvdb commented 6 months ago

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

Scherm­afbeelding 2024-03-14 om 21 14 52 Scherm­afbeelding 2024-03-14 om 21 15 00

Traceback/Error logs

Logger: homeassistant.components.sensor
Bron: helpers/entity_platform.py:577
integratie: Sensor (documentation, issues)
First occurred: 20:15:27 (1 gebeurtenissen)
Laatst gelogd: 20:15:27

Error adding entity sensor.golf_oil_inspection_days for domain sensor with platform volkswagencarnet
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 577, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 878, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1334, in add_to_platform_finish
    self.async_write_ha_state()
  File "/config/custom_components/volkswagencarnet/__init__.py", line 302, in async_write_ha_state
    super().async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1056, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 549, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/volkswagencarnet/sensor.py", line 60, in native_value
    return self.instrument.state
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_dashboard.py", line 181, in state
    val = super().state
          ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_dashboard.py", line 88, in state
    if hasattr(self.vehicle, self.attr):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_vehicle.py", line 891, in oil_inspection
    find_path(self.attrs, f"{Services.VEHICLE_HEALTH_INSPECTION}.maintenanceStatus.value.oilServiceDue_days")
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_utilities.py", line 72, in find_path
    return find_path(src[path[0]], path[1:])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_utilities.py", line 72, in find_path
    return find_path(src[path[0]], path[1:])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/volkswagencarnet/vw_utilities.py", line 72, in find_path
    return find_path(src[path[0]], path[1:])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 1 more time]
KeyError: 'oilServiceDue_days'

Debug information - all JSON responses from logfile

Additional context

the entity Is enabled....

Scherm­afbeelding 2024-03-14 om 21 45 30
stickpin commented 6 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.

Mariusthvdb commented 6 months ago

I already checked that but nothing special really. I'll drop it when at the desk

stickpin commented 6 months ago

Something is wrong with the oilServiceDue_days value in the backend response.

Mariusthvdb commented 6 months ago

this would be it, repeating every 5 minutes

volkswagen log.txt

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?

stickpin commented 6 months ago

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.

stickpin commented 6 months ago

regarding Horn & Turn Signals, I don't remember somebody asking for it. So it was never implemented.

Mariusthvdb commented 6 months ago

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:

Scherm­afbeelding 2024-03-15 om 12 23 16

and this:

Scherm­afbeelding 2024-03-15 om 12 24 34

so figured that to be the correct settings for debugging.. sorry if that wasnt the case. now restarting, ill be back

Mariusthvdb commented 6 months ago

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

Mariusthvdb commented 6 months ago

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```
stickpin commented 6 months ago

you should have a request towards selectivestatus API in the logs, I need a response from there. :)

Mariusthvdb commented 6 months ago

right... like this?

selectivestatus.txt

stickpin commented 6 months ago

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
      }
    }
  }
Mariusthvdb commented 6 months ago

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

Scherm­afbeelding 2024-03-15 om 15 07 36

Nor do we have any light entity, and those seem supported too (left/right) in the debug logs

stickpin commented 6 months ago

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.

stickpin commented 6 months ago

regarding light entities, you should have parking_light sensor, which represents the light entities.

Mariusthvdb commented 6 months ago

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?

stickpin commented 6 months ago

what do you mean by chassis number? VIN? I can expose it, just don't understand what for. :)

stickpin commented 6 months ago

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. :)

Mariusthvdb commented 6 months ago

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

virtualdj commented 6 months ago

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):

Integration device info

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})",

Result

stickpin commented 6 months ago

@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.

Mariusthvdb commented 6 months ago

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..

virtualdj commented 6 months ago

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:

Delay max to reduced current

Changing from reduced to maximum charging current:

Delay and bounce reduced to max 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.

Mariusthvdb commented 6 months ago

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.

stickpin commented 6 months ago

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.

virtualdj commented 6 months ago

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.

VIN

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!

Mariusthvdb commented 6 months ago

ok, so I installed the update, restarted, cleared cache etc, but still the same issue with the oil sensor not being available...

Scherm­afbeelding 2024-03-16 om 23 05 46

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

stickpin commented 6 months ago

I already explained above why it's not available for your vehicle. The difference is that the new version will not produce an error anymore for your vehicle.