filipvh / hass-nhc2

Niko Home Control II Home Assistant Integration
MIT License
36 stars 26 forks source link

Could not find a version that satisfies the requirement paho-mqtt==1.4.0 (from nhc2-coco) #13

Closed pbackx closed 3 years ago

pbackx commented 3 years ago

I have the latest Home Assistant Core (2020.12.1) and just added HACS and your custom integration (the released 1.5.0 version). When I try to add it, I see the following error in the logs.

I tried to manually install the requirement in the homeassistant, but that didn't help. I'm also not sure if that's the right way to do it (I'm pretty new to Home Assistant and the integrations)

Let me know if I can help with additional debugging or logs.

2020-12-29 09:49:04 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package nhc2-coco==1.3.3: ERROR: Could not find a version that satisfies the requirement paho-mqtt==1.4.0 (from nhc2-coco)
ERROR: No matching distribution found for paho-mqtt==1.4.0
2020-12-29 09:49:04 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 118, in impl
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/ban.py", line 72, in ban_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/config/config_entries.py", line 136, in post
    return await super().post(request)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/components/http/data_validator.py", line 60, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/data_entry_flow.py", line 69, in post
    result = await self._flow_mgr.async_init(
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/data_entry_flow.py", line 119, in async_init
    flow = await self.async_create_flow(handler, context=context, data=data)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/config_entries.py", line 532, in async_create_flow
    await async_process_deps_reqs(self.hass, self._hass_config, integration)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/setup.py", line 343, in async_process_deps_reqs
    await requirements.async_get_integration_with_requirements(
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/requirements.py", line 74, in async_get_integration_with_requirements
    await async_process_requirements(
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/requirements.py", line 131, in async_process_requirements
    raise RequirementsNotFound(name, [req])
homeassistant.requirements.RequirementsNotFound: Requirements for nhc2 not found: ['nhc2-coco==1.3.3'].
pbackx commented 3 years ago

I did a tiny bit of extra investigation and I think I have located the source of the issue.

I tried to install the requirement manually, but on each restart of home assistant, it is installing paho-mqtt version 1.5.1.

It appears the library was upgraded in the latest home assistant.

pbackx commented 3 years ago

As a follow-up. I manually installed nhc2-coco and that fixed it. I wasn't able to make things work through the hobby API (for some reason, it kept giving an unauthorized error with the token). But it's now working via the touchscreen interface. It also looks like dimmers are missing.

I'll see if I can test and debug some things later on and maybe come back with a pull request.

Thanks for the project! 💯

MirandaPoth commented 3 years ago

@packx Thanks for your posts above. I'm very new to this, please can you tell me how to manually installed nhc2-coco?

pbackx commented 3 years ago

It depends on how your Home Assistant is set up. I have the "core" version and there it is a matter of becoming the home assistant user, activating the virtual environment and running "pip install nhc2-coco==1.3.3". If you are not sure how to do these steps, you probably don't have the core version.

If you have a different setup, I'm not sure how to do it, but it's always a matter of activating the right environment and doing a pip install.

filipvh commented 3 years ago

@pbackx can I close this issue?

pbackx commented 3 years ago

It's hard for me to reproduce and there is an easy workaround, so I would close it.

NickInManchester commented 2 years ago

This or a similar issue seems to have happened again. Can anybody help fix this?

The March 2022 update to Home Assistant now fails to load the Niko integration:

https://github.com/home-assistant/core/issues/67794

It is clear the dependencies are a bit out of date. Whether this matters or not I cannot curently determine as I use Home Assistant OS so cannot simply try loading alternative packages of playing with the dependency constraints. Its the same or a very similar error report:

Unable to install package nhc2-coco==1.3.3

I note that nhc2-coco is now on version 1.4.1 since 24th June 2021 - https://pypi.org/project/nhc2-coco/#history

williammorren commented 2 years ago

This or a similar issue seems to have happened again. Can anybody help fix this?

The March 2022 update to Home Assistant now fails to load the Niko integration:

home-assistant/core#67794

It is clear the dependencies are a bit out of date. Whether this matters or not I cannot curently determine as I use Home Assistant OS so cannot simply try loading alternative packages of playing with the dependency constraints. Its the same or a very similar error report:

Unable to install package nhc2-coco==1.3.3

I note that nhc2-coco is now on version 1.4.1 since 24th June 2021 - https://pypi.org/project/nhc2-coco/#history

same issue here

NickInManchester commented 2 years ago

The work around from boced66 and instructions from Sharnobile, efiten, et al has worked for me.

Midway down: https://github.com/filipvh/hass-nhc2/issues/38 . Remove the HACS Niko Hobby integration, reboot. Involved download of a minor variant of the nh2 repository which replaces the official repository in custom_components. It seems to just modify the dependency. Then reboot picks up the variant repository instead of the real one.

On Sun, 3 Apr 2022 at 16:28, williammorren @.***> wrote:

This or a similar issue seems to have happened again. Can anybody help fix this?

The March 2022 update to Home Assistant now fails to load the Niko integration:

home-assistant/core#67794 https://github.com/home-assistant/core/issues/67794

It is clear the dependencies are a bit out of date. Whether this matters or not I cannot curently determine as I use Home Assistant OS so cannot simply try loading alternative packages of playing with the dependency constraints. Its the same or a very similar error report:

Unable to install package nhc2-coco==1.3.3

I note that nhc2-coco is now on version 1.4.1 since 24th June 2021 - https://pypi.org/project/nhc2-coco/#history

same issue here

— Reply to this email directly, view it on GitHub https://github.com/filipvh/hass-nhc2/issues/13#issuecomment-1086891661, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6CDDYTIPWV6YJ7D27SQFLVDG2ITANCNFSM4VM7MYNQ . You are receiving this because you commented.Message ID: @.***>

-- Nick Filer 15 Ravensway Prestwich Manchester M25 0EU Email: @.***