core: QNAP QSW integration set-up failed

The problem

I tried to set up the QNAP QSW integration, my switch is a QSW-M2116P-2T2S.

It seems that the access to the api is not authorized, and I don’t see any parameter on the switch UI which can authorize it.

I don’t know if this model is really compatible with this integration.

image

What version of Home Assistant Core has the issue?

2022.5.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

QNAP QSW

Link to integration documentation on our website

https://www.home-assistant.io/integrations/qnap_qsw/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2022-05-06 09:47:51 ERROR (MainThread) [aioqsw.localapi] aiohttp GET /api/live: 401 {'message': 'Unauthorized'}

image

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

I have just tested, visibly there is more difference than expected between the 2 switches :

Processing /root/aioqsw
Requirement already satisfied: aiohttp in /usr/local/lib/python3.9/dist-packages (from aioqsw==0.0.7) (3.8.1)
Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.9/dist-packages (from aiohttp->aioqsw==0.0.7) (1.7.2)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.9/dist-packages (from aiohttp->aioqsw==0.0.7) (4.0.2)
Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.9/dist-packages (from aiohttp->aioqsw==0.0.7) (21.4.0)
Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.9/dist-packages (from aiohttp->aioqsw==0.0.7) (6.0.2)
Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.9/dist-packages (from aiohttp->aioqsw==0.0.7) (1.3.0)
Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.9/dist-packages (from aiohttp->aioqsw==0.0.7) (1.2.0)
Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.9/dist-packages (from aiohttp->aioqsw==0.0.7) (2.0.12)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl<2.0,>=1.0->aiohttp->aioqsw==0.0.7) (2.10)
Building wheels for collected packages: aioqsw
  Building wheel for aioqsw (setup.py) ... done
  Created wheel for aioqsw: filename=aioqsw-0.0.7-py3-none-any.whl size=12335 sha256=755be65d13c92ff4394fb36dfada91bf9234a9bb2d1c834d7f522a5f9b6c4241
  Stored in directory: /tmp/pip-ephem-wheel-cache-bet5__fq/wheels/9d/59/69/8bf42a52c4bcb13f51da5f1f28ca8d3e4fae5e6c7b0237c291
Successfully built aioqsw
Installing collected packages: aioqsw
  Attempting uninstall: aioqsw
    Found existing installation: aioqsw 0.0.7
    Uninstalling aioqsw-0.0.7:
      Successfully uninstalled aioqsw-0.0.7
Successfully installed aioqsw-0.0.7
aiohttp POST /api/v1/users/login: 401 {'message': 'Unauthorized'}
Traceback (most recent call last):
  File "/root/aioqsw/examples/basic.py", line 29, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/root/aioqsw/examples/basic.py", line 18, in main
    system_board = await qsw.validate()
  File "/usr/local/lib/python3.9/dist-packages/aioqsw/localapi.py", line 241, in validate
    await self._login()
  File "/usr/local/lib/python3.9/dist-packages/aioqsw/localapi.py", line 306, in _login
    login = await self.post_users_login(params)
  File "/usr/local/lib/python3.9/dist-packages/aioqsw/localapi.py", line 208, in post_users_login
    return await self.http_request("POST", f"{API_PATH_V1}/users/login", params)
  File "/usr/local/lib/python3.9/dist-packages/aioqsw/localapi.py", line 134, in http_request
    raise LoginError
aioqsw.exceptions.LoginError