distwave / volkswagen_we_connect_id

custom code from original repo https://github.com/mitch-dc/volkswagen_we_connect_id
Apache License 2.0
4 stars 0 forks source link

General feedback #1

Open distwave opened 9 months ago

distwave commented 9 months ago

Just opening this to get feedback about the modifications

maceace commented 9 months ago

Hi. Will a custom car name option be implemented in the foreseeable future, which will create entity names according to it and provide only those entities that my VW actually supports? Thank you.

danielszilagyi commented 9 months ago

Hi,

Thank you for your efforts to make this better.

The setup goes through, in the logs I can see exceptions around device_tracker but the entity is created and has value.

2023-11-26 19:24:45.702 ERROR (MainThread) [homeassistant.components.number] Error adding entities for domain number with platform volkswagen_we_connect_id
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 743, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 749, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 336, in state
    return self.value
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 375, in value
    if (native_value := self.native_value) is None:
                        ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/volkswagen_we_connect_id/number.py", line 68, in native_value
    return int(
           ^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
2023-11-26 19:24:45.711 ERROR (MainThread) [homeassistant.components.number] Error while setting up volkswagen_we_connect_id platform for number
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 367, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 743, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 749, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 336, in state
    return self.value
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 375, in value
    if (native_value := self.native_value) is None:
                        ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/volkswagen_we_connect_id/number.py", line 68, in native_value
    return int(
           ^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
2023-11-26 19:24:46.755 WARNING (SyncWorker_5) [weconnect] /vehicles/MYVIN/domains/measurements/rangeStatus: Unknown attribute totalRange_km with value 163
2023-11-26 19:24:46.756 WARNING (SyncWorker_5) [weconnect] /vehicles/MYVIN: Unknown attribute fuelLevelStatus with value {'value': {'carCapturedTimestamp': '2023-11-26T16:57:56Z', 'currentSOC_pct': 95, 'primaryEngineType': 'electric', 'carType': 'electric'}} in domain measurements
2023-11-26 19:24:46.830 WARNING (MainThread) [homeassistant.components.device_tracker] Setup of device_tracker platform volkswagen_we_connect_id is taking over 10 seconds.
2023-11-26 19:24:47.804 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up volkswagen_we_connect_id platform for device_tracker
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/volkswagen_we_connect_id/device_tracker.py", line 29, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 255, in async_config_entry_first_refresh
    await self._async_refresh(
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 389, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 172, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 469, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 743, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 843, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 749, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 336, in state
    return self.value
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 375, in value
    if (native_value := self.native_value) is None:
                        ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/volkswagen_we_connect_id/number.py", line 68, in native_value
    return int(
           ^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
chrisandsally commented 9 months ago

Hi. Loaded and signed in all ok, however most are with a status of unknown. VW Tiguan 2022 Hybrid. What info is helpful to you in order to update the libraries.

gmp91 commented 9 months ago

I see you added a "last connected" entity. What is the purpose? Because right now it shows me "last connected 2 hours ago" but the entity "remaining charging time" was updatet 27 minutes ago. So it cannot be the last time the integration connected with the VW servers. But I like the idea of the "last connected" entity and I would really like it to work. So I can see if for example my climatisation started when I press the button. Because it is not "live" I can see later if it worked.

EDIT: btw the integration is running without errors for 12 hours on my both of my home assistant installations. Not blocked in volkswagen app yeah

distwave commented 9 months ago

Hi. Will a custom car name option be implemented in the foreseeable future, which will create entity names according to it and provide only those entities that my VW actually supports? Thank you.

I'll see what I can do, but for now I'm focusing on getting all the information reported by the library into the integration

distwave commented 9 months ago

The setup goes through, in the logs I can see exceptions around device_tracker but the entity is created and has value.

That issue should be solved in current release

distwave commented 9 months ago

Hi. Loaded and signed in all ok, however most are with a status of unknown. VW Tiguan 2022 Hybrid. What info is helpful to you in order to update the libraries.

Having access to an account with the car, but first I'm focusing in adding all the entities my car reports.

distwave commented 9 months ago

I see you added a "last connected" entity. What is the purpose? Because right now it shows me "last connected 2 hours ago" but the entity "remaining charging time" was updatet 27 minutes ago. So it cannot be the last time the integration connected with the VW servers. But I like the idea of the "last connected" entity and I would really like it to work. So I can see if for example my climatisation started when I press the button. Because it is not "live" I can see later if it worked.

The purpose of "last connected" is to know the last time that the car connected to the VW servers but it's just a test for now, it doesn't seem very reliable.

FedeL16 commented 9 months ago

My problem:

login is good, but I have not entities of my t roc 2020…

sunnyd24 commented 9 months ago

@distwave This seems to be working for now, thanks. for taking the time to get this working. The integration imported two cars (UK), Tiguan and T-Cross. I will let you know if I see any issues or bugs as I start using it more.