Closed WeirdSience closed 2 years ago
Can you try to update to the latest version?
Should be fixed in latest versions!
Tested latest version, HA crashes and re-boots until integration is de-activated and no fault log this time. Sorry for not having more info for fault finding.
Do you have non-id cars in the same account?
No other cars in the account. Will try a new installation of HA to see if it fixes the problem.
Tried a new HA installation on a WM and it crashed first time installing the integration due to lack of memory. Increased from 1GB-2GB and now the integration is running OK. Could be that my RP 3B+ with 1GB RAM can´t handle the integration as it seems to use a lot of memory.
I'm also experiencing this. In superviser I can see the mem use of the core increase, then the system becomes unresponsive until a watchdog triggers or I manually reset my RP. Looks like some sort of memory leak...
I did a clean install and can confirm. See attached memory usage graph. At 16:55 I restarted HASS after installing the files in custom_components and a few minutes later I added the integration. That's when the memory usage goes up. HASS then becomes slower and then it reboots. At 18:01 I disabled the integration and at 18:20 I manually restarted HASS. @mitch-dc Please let me know if I can support you with any other logs.
Do you have the same logs as the reporter?
No I don't think so. Not very skilled but i changed logging level for this integration to debug, re-activated it and while the memory quickly went up, this is what the log looked like:
2022-02-08 19:41:47 INFO (MainThread) [homeassistant.setup] Setting up volkswagen_we_connect_id 2022-02-08 19:41:47 INFO (MainThread) [homeassistant.setup] Setup of domain volkswagen_we_connect_id took 0.0 seconds 2022-02-08 19:41:49 INFO (SyncWorker_7) [weconnect] Login successful 2022-02-08 19:41:49 INFO (SyncWorker_7) [weconnect] Token refreshed 2022-02-08 19:42:03 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.volkswagen_we_connect_id 2022-02-08 19:42:03 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.volkswagen_we_connect_id 2022-02-08 19:42:03 INFO (SyncWorker_3) [homeassistant.loader] Loaded button from homeassistant.components.button 2022-02-08 19:42:03 INFO (MainThread) [homeassistant.setup] Setting up button 2022-02-08 19:42:03 INFO (MainThread) [homeassistant.setup] Setup of domain button took 0.0 seconds 2022-02-08 19:42:03 INFO (MainThread) [homeassistant.components.button] Setting up button.volkswagen_we_connect_id 2022-02-08 19:42:27 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id.sensor] Finished fetching volkswagen_we_connect_id_sensors data in 14.334 seconds (success: True) 2022-02-08 19:42:50 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id.sensor] Finished fetching volkswagen_we_connect_id_sensors data in 13.051 seconds (success: True) 2022-02-08 19:43:13 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id.sensor] Finished fetching volkswagen_we_connect_id_sensors data in 13.801 seconds (success: True) 2022-02-08 19:43:36 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id.sensor] Finished fetching volkswagen_we_connect_id_sensors data in 13.261 seconds (success: True) 2022-02-08 19:44:00 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id.sensor] Finished fetching volkswagen_we_connect_id_sensors data in 14.276 seconds (success: True) 2022-02-08 19:44:23 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id.sensor] Finished fetching volkswagen_we_connect_id_sensors data in 13.515 seconds (success: True) 2022-02-08 19:44:46 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id.sensor] Finished fetching volkswagen_we_connect_id_sensors data in 13.330 seconds (success: True) 2022-02-08 19:45:09 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id.sensor] Finished fetching volkswagen_we_connect_id_sensors data in 13.975 seconds (success: True) 2022-02-08 19:45:32 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id.sensor] Finished fetching volkswagen_we_connect_id_sensors data in 13.616 seconds (success: True)
Think i have an idea what goes wrong. Will take a look tomorrow!
Working on changing from polling to push (listing to events on de VW Api) but the API has some issues this morning for me (and other dutchies)
Should be fixed in https://github.com/mitch-dc/volkswagen_we_connect_id/releases/tag/v0.0.8
Didn't work for me. Current logs (after updating to v0.0.8 and activating the integration in the integration view):
2022-02-10 12:30:28 INFO (MainThread) [custom_components.hacs] Loading known repositories 2022-02-10 12:49:41 INFO (SyncWorker_6) [homeassistant.util.package] Attempting install of weconnect==0.36 2022-02-10 12:50:53 INFO (SyncWorker_7) [homeassistant.util.package] Attempting install of ascii_magic==1.6 2022-02-10 12:51:54 INFO (MainThread) [homeassistant.setup] Setting up volkswagen_we_connect_id 2022-02-10 12:51:54 INFO (MainThread) [homeassistant.setup] Setup of domain volkswagen_we_connect_id took 0.0 seconds 2022-02-10 12:52:24 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id] Finished fetching volkswagen_we_connect_id data in 13.469 seconds (success: True) 2022-02-10 12:52:24 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.volkswagen_we_connect_id 2022-02-10 12:52:24 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.volkswagen_we_connect_id 2022-02-10 12:52:24 INFO (SyncWorker_4) [homeassistant.loader] Loaded button from homeassistant.components.button 2022-02-10 12:52:24 INFO (MainThread) [homeassistant.setup] Setting up button 2022-02-10 12:52:24 INFO (MainThread) [homeassistant.setup] Setup of domain button took 0.0 seconds 2022-02-10 12:52:24 INFO (MainThread) [homeassistant.components.button] Setting up button.volkswagen_we_connect_id 2022-02-10 12:52:34 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of binary_sensor platform volkswagen_we_connect_id is taking over 10 seconds. 2022-02-10 12:52:34 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform volkswagen_we_connect_id is taking over 10 seconds. 2022-02-10 12:52:38 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id] Finished fetching volkswagen_we_connect_id data in 14.039 seconds (success: True) 2022-02-10 12:52:39 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id] Finished fetching volkswagen_we_connect_id data in 14.174 seconds (success: True) 2022-02-10 12:53:01 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id] Finished fetching volkswagen_we_connect_id data in 12.918 seconds (success: True) 2022-02-10 12:53:24 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id] Finished fetching volkswagen_we_connect_id data in 13.187 seconds (success: True) 2022-02-10 12:53:47 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id] Finished fetching volkswagen_we_connect_id data in 13.042 seconds (success: True) 2022-02-10 12:54:10 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id] Finished fetching volkswagen_we_connect_id data in 13.134 seconds (success: True) 2022-02-10 12:54:32 DEBUG (MainThread) [custom_components.volkswagen_we_connect_id] Finished fetching volkswagen_we_connect_id data in 12.324 seconds (success: True)
Memory still spikes. After deactivating the integration the memory doesn't drop, but flattens.
Same behaviour in v0.0.8.1 too.
Hmm don't know what this is, are you using a RPi?
Got exactly the same behaviour with v0.0.85 on a RPi (3B+) Except I have less loaded and start from about 45% mem usage, it still spikes to 95%+ where it stops working. Nothing in the logs
This is my setup (this integration currently not installed):
version | core-2022.2.9 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.9.7 |
os_name | Linux |
os_version | 5.10.92-v7 |
arch | armv7l |
timezone | Europe/Stockholm |
Edit: And this is the log file when I run Profiler while installing and activating the integration.
Corresponding memory graph:
Changed from Raspberry Pi 3B+ to a Raspberry Pi 4 (4GB) and the problem is gone. Stable memory usage when the integration is activated.
Not the fix I was hoping for, but I want this so bad... I may have to upgrade.
Changed from Raspberry Pi 3B+ to a Raspberry Pi 4 (4GB) and the problem is gone. Stable memory usage when the integration is activated.
Tried that and while it works then it's only because it has the free memory for it. The integration still allocates 300-400M ram and that works on a pi4 4GB but it won't on a pi3 1GB.
Somethin new here? Have a Pi 3B too and it crashes after a few minutes after activating this integration.
Tried v0.0.8.7 and it seems like the high mem usage has dissapeared. Looking at the change log I can't really see why, but tbh I don't really care. I just saw a short spike in RAM (like 10%, 100M) on init, but after that it dropped and my Pi3 is now running smoothly.
Broken again with 0.9.0 for me.
Affirm. Didn't notice this as I have moved to a VM setup, but the integration uses 150-200 MB RAM. My total is exceeding 1GB which it wasn't the other day.
Version of the custom_component
Installation method (hacs / manual)
Hacs
Installation method of hass (venv, docker, hassio,...)
Configuration
Describe the bug
When login information is entered and correct car vin is presented HA restarts and keps restarting with 2min interval until integration is inactivated.
Debug log
Logger: homeassistant.components.binary_sensor Source: custom_components/volkswagen_we_connect_id/binary_sensor.py:163 Integration: Binär sensor (documentation, issues) First occurred: 19:56:14 (2 occurrences) Last logged: 19:56:14
Error adding entities for domain binary_sensor with platform volkswagen_we_connect_id Error while setting up volkswagen_we_connect_id platform for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 748, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 511, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/binary_sensor/init.py", line 205, in state return STATE_ON if self.is_on else STATE_OFF File "/config/custom_components/volkswagen_we_connect_id/binary_sensor.py", line 163, in is_on return state == self.entity_description.on_value.value File "/usr/local/lib/python3.9/enum.py", line 429, in getattr raise AttributeError(name) from None AttributeError: value
Add your logs here.