grimmpp / home-assistant-eltako

Integration for Eltako 14 series in Home Assistant
MIT License
36 stars 7 forks source link

Setup failed for custom integration 'eltako' after Update 2024.09 #129

Closed kimzeuner closed 3 weeks ago

kimzeuner commented 4 weeks ago

Today i had a problem after i updated HAOS to 2024.09. After the restart my HA reported "Setup failed for custom integration 'eltako': Requirements for eltako not found: ['esp2-gateway-adapter==0.2.6]." and the integration didn`t start. What i have done was

  1. Update the esp2-gateway-adapter to newest version 0.2.10 and changed the requirements in the manifest.json to esp2-gateway-adapter==0.2.10. The result was the same failure "Setup failed for custom integration 'eltako': Requirements for eltako not found: ['esp2-gateway-adapter==0.2.10."
  2. Then changed the requirement to esp2-gateway-adapter>=0.2.6. Still the same issue.
  3. Finally changed the requirement to esp2-gateway-adapter without any version. After a restart everything seems to work again.

Don`t know if it is an integration or HA issue but maybe it helps if anyone has the same issue and is searching for a solution.

Stroett commented 4 weeks ago

At least same issue. After updating HA to 2024.09 and HACS to 2.0.1. So far no recovery found.

kimzeuner commented 4 weeks ago

Oh you are right, i have also updated HACS before and made the restart after the HAOS update so not sure if it came from the HACS or HAOS update. Did you already try to go to custom_components/eltako and make the described changes (delete "==0.2.6" behind esp2-gateway-adapter) in the line requirements ?

Stroett commented 4 weeks ago

No. I will check it tonight when my kids are sleeping. -> just checked and it's working again! Thanks for the intermediate solution.

kimzeuner commented 4 weeks ago

Sure, you will need visual studio code or file editor addon for this (file editor is easier for the start i think). So after you have installed the File Editor addon start and open it. In the upper left corner you find a folder symbol. Here you go to custom_components/eltako and look for the manifest.json file. Open it and you will find a line with "requirements: ..." there you have to make the changes. Save the file with the red symbol (i think its a floppy disk) in the top bar and restart Homeassistant.

FMDHET commented 4 weeks ago

By removing the version in the manifest.json, the integration is installing the old version 0.1 instead of 0.2.10 esp2-gateway-adapter_0 1

only for homeassistant docker-version with root access:

  1. To fix this bug, you can enter via putty into your homeassistant docker ("docker exec -it homeassistant bash").
  2. Than install esp2-gateway-adapter with "pip3 install esp2-gateway-adapter==0.2.10"
  3. check the installed version with "pip3 list | grep esp2"
kimzeuner commented 4 weeks ago

I am using HAOS as a Virtual Machine in Proxmox. I have just checked the version of the esp2-gateway-adapter: image When i just use the Terminal Addon and check the version it says it is 0.2.10 but when i first use "docker exec -it homeassistant bash" and then check the version it says it is 0.1 so i'm not sure what is correct now. After using your mentioned command "pip3 install esp2-gateway-adapter==0.2.10" and a HA restart it stays in version 0.2.10 in both variants and the integration seems to work fine too. Would you suggest to change the requirements back to "esp2-gateway-adapter>=0.2.6" or "esp2-gateway-adapter==0.2.10" or is that not relevant ?

schlegel commented 3 weeks ago
Screenshot 2024-09-07 at 13 23 05

So I'm not alone with the problem after updating home assistant? Can I somehow solve the issue without going back in the version?

schlegel commented 3 weeks ago

@grimmpp Would it be possible that you release a new version of esp2-gateway-adapter which resolve the dependency issue? I would be extremely grateful :)

schlegel commented 3 weeks ago

dirty workaround:

  1. copy the 2 source files from the gateway adapter into the eltako component (https://github.com/grimmpp/esp2_gateway_adapter/tree/main/src)
  2. in the component, edit the imports in gateway.py (has to be "from .esp3_tcp_com import TCP2SerialCommunicator" and "from .esp3_serial_com import ESP3SerialCommunicator")
  3. in the manifest json, include the requirements from the gateway adapter and set no version to PyYAML and zeroconf (those seem to be the problem) --> "requirements": ["eltako14bus==0.0.59", "enocean==0.60.1", "StrEnum", "aiocoap==0.4.7", "pyserial==3.5", "pyserial-asyncio==0.6", "PyYAML", "zeroconf"]
grimmpp commented 3 weeks ago

Currently looking into it but haven't found the root cause. Leaving the Version unspecified would cause other problems. Will Take some time because i'm currently in vacation travelling.

chef2gare commented 3 weeks ago

hello guys,

I think it comes from this : https://www.home-assistant.io/changelogs/core-2024.9 -> Bump zeroconf to 0.133.0

esp2-gateway-adapter requires zeroconf==0.132.2

here is what is happenning in my container if I install it :

ccbd01c6ed38:~# pip install esp2-gateway-adapter==0.2.6
Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting esp2-gateway-adapter==0.2.6
  Downloading esp2_gateway_adapter-0.2.6-py3-none-any.whl.metadata (2.2 kB)
Requirement already satisfied: eltako14bus>=0.0.46 in /usr/local/lib/python3.12/site-packages (from esp2-gateway-adapter==0.2.6) (0.0.53)
Requirement already satisfied: enocean>=0.60.1 in /usr/local/lib/python3.12/site-packages (from esp2-gateway-adapter==0.2.6) (0.60.1)
Requirement already satisfied: pyserial in /usr/local/lib/python3.12/site-packages (from esp2-gateway-adapter==0.2.6) (3.5)
Requirement already satisfied: pyserial-asyncio in /usr/local/lib/python3.12/site-packages (from esp2-gateway-adapter==0.2.6) (0.6)
Requirement already satisfied: aiocoap in /usr/local/lib/python3.12/site-packages (from esp2-gateway-adapter==0.2.6) (0.4.11)
Collecting zeroconf==0.132.2 (from esp2-gateway-adapter==0.2.6)
  Downloading https://wheels.home-assistant.io/musllinux-index/zeroconf-0.132.2-cp312-cp312-musllinux_1_2_aarch64.whl (2.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 24.1 MB/s eta 0:00:00
Requirement already satisfied: ifaddr>=0.1.7 in /usr/local/lib/python3.12/site-packages (from zeroconf==0.132.2->esp2-gateway-adapter==0.2.6) (0.2.0)
Requirement already satisfied: enum-compat>=0.0.2 in /usr/local/lib/python3.12/site-packages (from enocean>=0.60.1->esp2-gateway-adapter==0.2.6) (0.0.3)
Requirement already satisfied: beautifulsoup4>=4.3.2 in /usr/local/lib/python3.12/site-packages (from enocean>=0.60.1->esp2-gateway-adapter==0.2.6) (4.12.3)
Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.12/site-packages (from beautifulsoup4>=4.3.2->enocean>=0.60.1->esp2-gateway-adapter==0.2.6) (2.6)
Downloading esp2_gateway_adapter-0.2.6-py3-none-any.whl (9.3 kB)
Installing collected packages: zeroconf, esp2-gateway-adapter
  Attempting uninstall: zeroconf
    Found existing installation: zeroconf 0.133.0
    Uninstalling zeroconf-0.133.0:
      Successfully uninstalled zeroconf-0.133.0
Successfully installed esp2-gateway-adapter-0.2.6 zeroconf-0.132.2

If you do not use the gateway devices that need this lib (This component is mainly required to support USB300, USB400 and USB515 (Wireless EnOcean USB stick/transceiver) which is using ESP3 protocol unlike all other Eltako devices which are using ESP2.), you could remove the requirement from the file HACONFIGDIR/custom_components/eltako/manifest.json

{
  "domain": "eltako",
  "name": "Eltako",
  "codeowners": ["@grimmpp"],
  "config_flow": true,
  "dependencies": [],
  "documentation": "https://github.com/grimmpp/home-assistant-eltako",
  "integration_type": "hub",
  "iot_class": "local_push",
  "issue_tracker": "https://github.com/grimmpp/home-assistant-eltako/issues",
  "loggers": ["eltako"],
  "requirements": ["eltako14bus==0.0.53", "enocean==0.60.1", "StrEnum"],
  "version": "1.5.1" 
}

at least, it works for me :)

grimmpp commented 3 weeks ago

I've created a new release containing all other changes made in between as well. Can you please test version 1.5.8

kimzeuner commented 3 weeks ago

For me everything seems to work fine with this version. No error on installation and the esp2-gateway-adapter was updated to 0.2.11. image

ceeekar commented 3 weeks ago

I also can confirm that everything is running.

I'm not sure if this is related to the update or has been an issue before that: In the logs I get an error at startup concerning the gateway as well as every cover and an error in the UI when trying to set a specific position if the shutter has not been moved to fully open or fully closed. The position on all shutters is unknown at startup but gets updated once a shutter has been closed or opened. After that the positioning of a shutter seems to work and no error is presented in the UI.

eltako_error.txt note: addresses have been redacted

chef2gare commented 3 weeks ago

Same here, everything alright with your 1.5.8 version. Thanks for all your work.

schlegel commented 3 weeks ago

I've created a new release containing all other changes made in between as well. Can you please test version 1.5.8

thanks!

grimmpp commented 3 weeks ago

I also can confirm that everything is running.

I'm not sure if this is related to the update or has been an issue before that: In the logs I get an error at startup concerning the gateway as well as every cover and an error in the UI when trying to set a specific position if the shutter has not been moved to fully open or fully closed. The position on all shutters is unknown at startup but gets updated once a shutter has been closed or opened. After that the positioning of a shutter seems to work and no error is presented in the UI.

eltako_error.txt note: addresses have been redacted

That comes with new feature because the variable was not known before. It should only appear once after the update.