Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DCH-S220 no devices or entities #8

Open
utente-spam opened this issue Jan 21, 2024 · 1 comment
Open

DCH-S220 no devices or entities #8

utente-spam opened this issue Jan 21, 2024 · 1 comment

Comments

@utente-spam
Copy link

Hi,
When trying to register DCH-220, after entering host, user and password, I have the error "no devices or entities".
The integration recognises it's a DCH-220.

In the log I find:

2024-01-21 18:41:07.144 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry DCH-S220 for hnap_device
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hnap_device/__init__.py", line 62, in async_setup_entry
    hass.config_entries.async_setup_platforms(entry, entry.data[CONF_PLATFORMS])
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

On the net, the same error was found in case of incorrect credentials: https://community.home-assistant.io/t/custom-component-for-hnap-devices-motion-sensors-sirens-etc/383923/3

In this case, host, user and password look correct, as they lead to the device data in the browser:
Firmware External Version: V1.23 Firmware Internal Version: V1.23b03 Date: Thu, 30 Nov 2017 2.4GHz regulation domain: EU 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 Firmware Query: http://wrpd.dlink.com/router/firmware/query.aspx?model=DCH-S220 Kernel: 2.6.31, B0018, Date=Fri, 17 Nov, 2017

@utente-spam
Copy link
Author

Additional information: my homeassistance instance runs in a docker container on a NAS.
The siren has a static IP assigned through DHCP 192.168.1.182.

Logs show a connection error:
`2024-01-27 06:31:48.072 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry DCH-S220 for hnap_device
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/usr/local/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
OSError: [Errno 113] Host is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 416, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 244, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.11/http/client.py", line 1286, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.11/http/client.py", line 1332, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.11/http/client.py", line 1281, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.11/http/client.py", line 1041, in _send_output
self.send(msg)
File "/usr/local/lib/python3.11/http/client.py", line 979, in send
self.connect()
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 205, in connect
conn = self._new_conn()
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fa6c82e6c90>: Failed to establish a new connection: [Errno 113] Host is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 799, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.1.182', port=80): Max retries exceeded with url: /HNAP1/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa6c82e6c90>: Failed to establish a new connection: [Errno 113] Host is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 402, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hnap_device/init.py", line 56, in async_setup_entry
await hass.async_add_executor_job(client.authenticate)
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/hnap/soapclient.py", line 204, in authenticate
resp = requests.request(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)`

Still from within the container the siren is accessible on port 80.
This is the result of the command
wget 192.168.1.182
Connecting to 192.168.1.182 (192.168.1.182:80) saving to 'index.html' index.html 100% |********************************| 148 0:00:00 ETA 'index.html' saved
And this is the content of the content retrieved in index.html
`

<title></title> <script type="text/javascript"> location.href = "Login.html"; </script> `

I'm going to dig deeper in the debug and keep this thread up to date.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant