It sounds like this might be the same thing @p0lar was reporting earlier in the year.
Devices that have been in place for a long time are working fine. New devices I’ve added lately (within last few months, after upgrade to HA v.111) are responding to the Insteon app but not to HA. They work once. Then on next HA reboot the devices become ‘unavailable’.
For a while, I could kick them back into operation by adding them in Insteon app. Since they already existed both in Insteon app and HA, they would keep their settings. It seemed like the process of adding the device would cause HA to see them again. But after most recent HA update (I’m on v.117.6 now), that stopped working and I can’t get them to be detected by HA at all now.
When I went through the ALDB, I found 6 devices not listed in the db that are in HA. Of those 6, 3 work and 3 are ‘unavailable’. All of them are new devices added after v.111 upgrade. All 6 work perfectly in Insteon iPhone app. All 6 are the devices added most recently. The 3 that work but are missing were
For one of the ‘unavailable’ devices, when I just tried (unsuccessfully) to add it in Insteon app, I get this in logs:
2020-11-13 16:03:01 INFO (MainThread) [pyinsteon.managers.device_manager] Adding device to INSTEON devices list: 536530
2020-11-13 16:03:01 DEBUG (MainThread) [homeassistant.components.insteon.utils] Adding new INSTEON device to Home Assistant with address 536530
2020-11-13 16:03:04 DEBUG (MainThread) [homeassistant.components.insteon.utils] Registering on/off event for 53.65.30 1 on_event
2020-11-13 16:03:04 DEBUG (MainThread) [homeassistant.components.insteon.utils] Registering on/off event for 53.65.30 1 off_event
2020-11-13 16:03:04 DEBUG (MainThread) [homeassistant.components.insteon.utils] Registering on/off event for 53.65.30 1 on_fast_event
2020-11-13 16:03:04 DEBUG (MainThread) [homeassistant.components.insteon.utils] Registering on/off event for 53.65.30 1 off_fast_event
2020-11-13 16:03:04 ERROR (MainThread) [homeassistant.components.switch] Error adding entities for domain switch with platform insteon
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 314, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in _async_add_entity
device_info = entity.device_info
File "/usr/src/homeassistant/homeassistant/components/insteon/insteon_entity.py", line 87, in device_info
"model": f"{self._insteon_device.model} (0x{self._insteon_device.cat:02x}, 0x{self._insteon_device.subcat:02x})",
File "/usr/local/lib/python3.8/enum.py", line 669, in __format__
return cls.__format__(val, format_spec)
ValueError: Unknown format code 'x' for object of type 'str'
2020-11-13 16:03:08 INFO (MainThread) [pyinsteon.managers.device_manager] Adding device to INSTEON devices list: 536530
2020-11-13 16:03:08 DEBUG (MainThread) [homeassistant.components.insteon.utils] Adding new INSTEON device to Home Assistant with address 536530
2020-11-13 16:03:25 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyinsteon/managers/device_manager.py", line 222, in async_setup_device
await device.async_add_default_links()
File "/usr/local/lib/python3.8/site-packages/pyinsteon/device_types/device_base.py", line 224, in async_add_default_links
return await async_add_default_links(self)
File "/usr/local/lib/python3.8/site-packages/pyinsteon/managers/link_manager/default_links.py", line 39, in async_add_default_links
result = await async_link_devices(
File "/usr/local/lib/python3.8/site-packages/pyinsteon/managers/link_manager/__init__.py", line 52, in async_link_devices
_, failed_1 = await controller.aldb.async_write()
File "/usr/local/lib/python3.8/site-packages/pyinsteon/aldb/aldb_base.py", line 272, in async_write
for mem_addr in self._dirty_records:
RuntimeError: dictionary changed size during iteration
So, it feels like two different problems.
- whatever those python errors are.
- why are new devices not persisting in the aldb?