nielsfaber / alarmo

Easy to use alarm system integration for Home Assistant
1.24k stars 117 forks source link

Failed to set up #944

Closed vejadutoo closed 1 month ago

vejadutoo commented 1 month ago

Alarmo Version

v1.10.1

HA Version

2024.5.4

Bug description

Alarmo gives error: image After updating to HA Core 2024.5.4 and Operating System 12.3.

Steps to reproduce

Relevant log output

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/alarmo/__init__.py", line 57, in async_setup_entry
    store = await async_get_registry(hass)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/alarmo/store.py", line 689, in async_get_registry
    return cast(AlarmoStorage, await task)
                               ^^^^^^^^^^
  File "/config/custom_components/alarmo/store.py", line 684, in _load_reg
    await registry.async_load()
  File "/config/custom_components/alarmo/store.py", line 314, in async_load
    data = await self._store.async_load()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 287, in async_load
    return await load_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 296, in _async_load
    return await self._async_load_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/storage.py", line 401, in _async_load_data
    stored = await self._async_migrate_func(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/alarmo/store.py", line 292, in _async_migrate_func
    for sensorGroup in data["sensor_groups"]
                       ~~~~^^^^^^^^^^^^^^^^^
KeyError: 'sensor_groups'
nielsfaber commented 1 month ago

This seems caused by having a very old installation of Alarmo (more than 2 years old without making any changes) and trying to upgrade. You should consider removing alarmo from the integrations page (should be possible by clicking on the 3 dots) and re-installing.

vejadutoo commented 1 month ago

Hey @nielsfaber, thanks for taking the time to reply.

This seems caused by having a very old installation of Alarmo (more than 2 years old without making any changes) and trying to upgrade.

This is correct. I did try to upgrade a very old version in place initially. Unfortunately, I have no clue which one it was.

You should consider removing alarmo from the integrations page (should be possible by clicking on the 3 dots) and re-installing.

I did, I even did it multiple ways before I opened the issue.

There are also no references to Alarmo in my configuration.yaml and I removed all automation that referenced it.

Based on your note about upgrading from an old version, I did some more troubleshooting. I installed (and uninstalled) older versions of Alarmo from HACS and found the following:

nielsfaber commented 1 month ago

Uninstalling should remove the alarmo.storage file which is in the .storage subfolder in the HA directory. The files in the custom_components folder do not contain your installation files, so removing these files is not sufficient for removing the integration from HA. If 1.9.13 works OK for you, I suggest to click the delete button under that version. image Afterwards you can update to the latest Alarmo version via HACS and add the integration again via HA. I hope that works.

vejadutoo commented 1 month ago

Well, I guess that was the one permutation I didn't try. That worked. Thank you!