alryaz / hass-hekr-component

Hekr integration using python-hekr
Other
35 stars 11 forks source link

Cant connect local device #15

Open trecords opened 2 years ago

trecords commented 2 years ago

Hello,

Hekr setup as component into home assistant have been done corectly and all device id and control keys are correctly copied to integrations page but I am getting below error. x.x.x.91 is my local static IP assigned for smart meter and it is also correct as I see it in mikrotik router with hostname ESP...

Please Advise.

This error originated from a custom integration.

Logger: custom_components.hekr
Source: custom_components/hekr/__init__.py:220
Integration: Hekr (documentation, issues)
First occurred: 17:45:55 (1 occurrences)
Last logged: 17:45:55

API exception while setting up config entry b1a337b1d4f903efc55ce03d37702224
Traceback (most recent call last):
  File "/config/custom_components/hekr/__init__.py", line 220, in async_setup_entry
    await device.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 694, in open_connection
    await connector.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 341, in open_connection
    raise ConnectionTimeoutException('Connector on %s timed out (waited for %d seconds to establish '
hekrapi.exceptions.ConnectionTimeoutException: Connector on <HekrApi:LocalConnector(192.162.1.91:10000)> timed out (waited for 10 seconds to establish connection with the host)

King Regards and thanks for contribution, Turkel.

trecords commented 2 years ago

Full Logs are below, I am n ot sure what is config entry but it is suerly not my control key:

Full logs
    await device.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 694, in open_connection
    await connector.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 341, in open_connection
    raise ConnectionTimeoutException('Connector on %s timed out (waited for %d seconds to establish '
hekrapi.exceptions.ConnectionTimeoutException: Connector on <HekrApi:LocalConnector(192.162.1.91:10000)> timed out (waited for 5 seconds to establish connection with the host)
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
2022-05-15 17:19:41 ERROR (MainThread) [homeassistant.components.hassio.handler] Client error on /homeassistant/restart request Server disconnected
[finish] process exit code 0
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-05-15 17:19:48 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hekr which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-05-15 17:19:48 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-05-15 17:19:58 ERROR (MainThread) [custom_components.hekr] API exception while setting up config entry f0c5bb8990b93073b591ab7cf1048785
Traceback (most recent call last):
  File "/config/custom_components/hekr/__init__.py", line 220, in async_setup_entry
    await device.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 694, in open_connection
    await connector.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 341, in open_connection
    raise ConnectionTimeoutException('Connector on %s timed out (waited for %d seconds to establish '
hekrapi.exceptions.ConnectionTimeoutException: Connector on <HekrApi:LocalConnector(192.162.1.91:10000)> timed out (waited for 5 seconds to establish connection with the host)
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
2022-05-15 17:31:33 ERROR (MainThread) [homeassistant.components.hassio.handler] Client error on /homeassistant/restart request Server disconnected
[finish] process exit code 0
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-05-15 17:31:40 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-05-15 17:31:40 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hekr which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-05-15 17:31:43 ERROR (MainThread) [homeassistant.components.hassio.handler] /addons return code 500
2022-05-15 17:31:43 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /addons - 
2022-05-15 17:31:43 ERROR (MainThread) [homeassistant.components.hassio.handler] /store return code 500
2022-05-15 17:31:43 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /store - 
2022-05-15 17:31:50 ERROR (MainThread) [custom_components.hekr] API exception while setting up config entry f0c5bb8990b93073b591ab7cf1048785
Traceback (most recent call last):
  File "/config/custom_components/hekr/__init__.py", line 220, in async_setup_entry
    await device.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 694, in open_connection
    await connector.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 341, in open_connection
    raise ConnectionTimeoutException('Connector on %s timed out (waited for %d seconds to establish '
hekrapi.exceptions.ConnectionTimeoutException: Connector on <HekrApi:LocalConnector(192.162.1.91:10000)> timed out (waited for 5 seconds to establish connection with the host)
2022-05-15 17:45:55 ERROR (MainThread) [custom_components.hekr] API exception while setting up config entry b1a337b1d4f903efc55ce03d37702224
Traceback (most recent call last):
  File "/config/custom_components/hekr/__init__.py", line 220, in async_setup_entry
    await device.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 694, in open_connection
    await connector.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 341, in open_connection
    raise ConnectionTimeoutException('Connector on %s timed out (waited for %d seconds to establish '
hekrapi.exceptions.ConnectionTimeoutException: Connector on <HekrApi:LocalConnector(192.162.1.91:10000)> timed out (waited for 10 seconds to establish connection with the host)
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
2022-05-15 17:55:28 ERROR (MainThread) [homeassistant.components.hassio.handler] Client error on /homeassistant/restart request Server disconnected
[finish] process exit code 0
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-05-15 17:55:34 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-05-15 17:55:34 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hekr which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-05-15 17:55:50 ERROR (MainThread) [custom_components.hekr] API exception while setting up config entry b1a337b1d4f903efc55ce03d37702224
Traceback (most recent call last):
  File "/config/custom_components/hekr/__init__.py", line 220, in async_setup_entry
    await device.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 694, in open_connection
    await connector.open_connection()
  File "/usr/local/lib/python3.9/site-packages/hekrapi/device.py", line 341, in open_connection
    raise ConnectionTimeoutException('Connector on %s timed out (waited for %d seconds to establish '
hekrapi.exceptions.ConnectionTimeoutException: Connector on <HekrApi:LocalConnector(192.162.1.91:10000)> timed out (waited for 10 seconds to establish connection with the host)
gbisheimer commented 2 years ago

I had the same issue after update to version v0.2.14.

I fixed the problem by adding this to configuration.yaml

hekr:
  accounts:
    - username: [USERNAME]
      password: [PASSWORD]

while leaving the devices configuration. Restarted the server and the integration started working (but renamed all my entities). Then I removed the accounts configuration and it started working as expected, using only LAN for device access.

Hope it helps.