frenck / spook

A scary 👻 powerful toolbox 🧰 for Home Assistant 🏡
https://spook.boo
MIT License
381 stars 36 forks source link

Add integration fails with “Failed to setup” #570

Closed tobbensoft closed 3 months ago

tobbensoft commented 3 months ago

What version of Spook are you using?

2.1.1

What version of Home Assistant are you using?

2024.1.3

The problem

Trying to setup the integration, but it fails with “Failed to setup”

image

Tried to remove and reinstall with same results.

Attaching logs.

Any tips on what to check? Or is it a bug?

Anything in the logs? Paste it here!

Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 15:54:25 (1 occurrences)
Last logged: 15:54:25

Error setting up entry Not your homie for spook
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spook/__init__.py", line 90, in async_setup_entry
    await services.async_setup()
  File "/config/custom_components/spook/services.py", line 288, in async_setup
    self.async_register_service(service)
  File "/config/custom_components/spook/services.py", line 293, in async_register_service
    service.async_register()
  File "/config/custom_components/spook/services.py", line 168, in async_register
    for platform in self.hass.data[DATA_ENTITY_PLATFORM][self.domain]
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'timer'
schford commented 3 months ago

Same issue for me.

manonstreet commented 3 months ago

Same here. I added timer: to my configuration.yaml, restarted HA and the issue resolved.

tobbensoft commented 3 months ago

@manonstreet, that worked here as well. Thanks!

lacrima08 commented 3 months ago

@manonstreet Thank you ! It's working !

frenck commented 3 months ago

This has been fixed with the release of Home Assistant 2024.2, which now always loads up the timer.

../Frenck

heibertelf commented 3 months ago

This has been fixed with the release of Home Assistant 2024.2, which now always loads up the timer.

../Frenck

Hi! I'm not very advanced, so I'm not sure what to do next yet. Here's what I have: image image

Logger: homeassistant.config_entries
Source: config_entries.py:444
First occurred: 5:42:37 PM (1 occurrences)
Last logged: 5:42:37 PM

Error setting up entry Not your homie for spook
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spook/__init__.py", line 38, in async_setup_entry
    if await hass.async_add_executor_job(link_sub_integrations, hass):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spook/util.py", line 75, in link_sub_integrations
    dest.symlink_to(src)
  File "/usr/local/lib/python3.12/pathlib.py", line 1386, in symlink_to
    os.symlink(target, self, target_is_directory)
FileExistsError: [Errno 17] File exists: '/config/custom_components/spook/integrations/spook_inverse' -> '/config/custom_components/spook_inverse'
diplix commented 2 months ago

config/custom_components/spook/integrations/spook_inverse

i had this problem after moving my installation to docker. there was an old symlink in /config/custom_components with a wrong path which i needed to delete. spook then creates a new symling called spook_inverse from the custom_components root directory into the integrations folder.

tl;dr: remove the symlink called spook_inverse in your custom_components folder and reload the integration.