fuatakgun / eufy_security

Home Assistant integration to manage Eufy Security devices as cameras, home base stations, doorbells, motion and contact sensors.
877 stars 73 forks source link

'Unknown error occured' while setting up Eufy Security Integration #861

Closed randy993 closed 1 year ago

randy993 commented 1 year ago

Describe the bug

I'm trying to install the Eufy Security Integration as described in the manual, but I run into an unknown error when submitting my IP and port information.

To reproduce

Steps to reproduce the behavior:

  1. Install Eufy Security Add-on
  2. Verify Eufy Security Add-on running (port 3000) with configuration
  3. Install RTSP Simple Server Add-on
  4. InstallEufy Security Integration
  5. Fill in host/port and submit

Expected behavior

Expect the integration to be configured.

Additional information

Hardware Information;

No errors in Eufy Security Add-on. However I did notice the add-on was started on 0.0.0.0. So I tried this IP as well in the config.

sesardelaisla commented 1 year ago

+1, although I have a HomeBridge 2 instead of 3 and I have the following SyntaxError errors in the addon upon restarting. The addon stays up and running though:

2023-07-30 14:51:54.496  INFO  Eufy Security server listening on host 0.0.0.0, port 3000:
[...]
SyntaxError  Unexpected end of JSON input
error stack:
• utils.ts:151 parseJSON
    usr/src/app/node_modules/eufy-security-client/src/utils.ts:151:21
• parameter.ts:45 readValue
    usr/src/app/node_modules/eufy-security-client/src/http/parameter.ts:45:41
• device.ts:132 updateRawProperty
    usr/src/app/node_modules/eufy-security-client/src/http/device.ts:132:45
• device.ts:64 <anonymous>
    usr/src/app/node_modules/eufy-security-client/src/http/device.ts:64:22
• device.ts:63 update
    usr/src/app/node_modules/eufy-security-client/src/http/device.ts:63:35
• device.ts:37 initializeState
    usr/src/app/node_modules/eufy-security-client/src/http/device.ts:37:14
• device.ts:45 initialize
    usr/src/app/node_modules/eufy-security-client/src/http/device.ts:45:14
• eufysecurity.ts:625 <anonymous>
    usr/src/app/node_modules/eufy-security-client/src/eufysecurity.ts:625:32
2023-07-30 14:52:10.561  INFO  Connected to station T8010T********** on host 192.168.*.* and port 26641 
2023-07-30 14:52:10.690  INFO  Push notification connection successfully established 

I will be happy to open a different issue if necessary so I can provide full specs and logs. I am not doing it already because I read somewhere that developers suggest not to do it if the issue is very similar. Please, advise.

sesardelaisla commented 1 year ago

FYI, just noticed that installing previous version (6.3.1) instead of latest one (6.3.2) fixes the issue, although I still have the SyntaxError in the addon. Are they expected?

randy993 commented 1 year ago

Just tried it with 6.3.1, but does not work for me either.

sesardelaisla commented 1 year ago

Just tried it with 6.3.1, but does not work for me either.

There are some differences between the devices you and I have. The only thing I can say is that 6.3.1 works for me. After setting up, I tried to upgrade to 6.3.2 again. Apparently, the integration worked. Tried to add another camera that I had not configured yet and integration detected it. However, when starting to play around with options, camera entities didn't update the thumbnail and some switches did not sync with Eufy app changes. Rolled back again to 6.3.1, reloaded the integration and things seem to be normal now.

aymant commented 1 year ago

Same problem here.

`This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/eufy_security/config_flow.py:112 Integration: eufy_security (documentation, issues) First occurred: 13:18:26 (8 occurrences) Last logged: 13:26:11

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle result = await handler(request, *request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 181, in post return await super().post(request, flow_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 297, in async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 393, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/eufy_security/config_flow.py", line 89, in async_step_user valid = await self._test_credentials(user_input[ConfigField.host.name], user_input[ConfigField.port.name]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/eufy_security/config_flow.py", line 112, in _test_credentials api_client: ApiClient = ApiClient(config, aiohttp_client.async_get_clientsession(self.hass)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: ApiClient.init() missing 1 required positional argument: 'on_error_callback' `

FredDuk commented 1 year ago

+1 , same error return as aymant

Blaylock1988 commented 1 year ago

+1 exact same error here.

phoenix-blue commented 1 year ago

+1 same error, add-on is working without any issue but when install the integration I get an "Unknown error occurred"

Sandman4050 commented 1 year ago

+1 here, just adding the custom Eufy Security integration from HACS gives the following errors:

Error during setup of component eufy Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 288, in _async_setup_component result = await task ^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/eufy/init.py", line 61, in setup data = lakeside.get_devices( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/lakeside/init.py", line 39, in get_devices token = r.json()['access_token']


KeyError: 'access_token'
fuatakgun commented 1 year ago

https://github.com/fuatakgun/eufy_security/issues/863

@Sandman4050 , you are in wrong repository

Sandman4050 commented 1 year ago

863

@Sandman4050 , you are in wrong repository

How am I in the wrong repository? This is the error log I got from this integration? And have the exact same issues as OP and every other poster?

fuatakgun commented 1 year ago

:) I do not know @Sandman4050 but error is not coming from eufy_security, it is from core eufy component.

If you still think that this is right place, I do not have anything to contribute

ile "/usr/src/homeassistant/homeassistant/components/eufy/init.py", line 61, in setup
data = lakeside.get_devices(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/lakeside/init.py", line 39, in get_devices
Sandman4050 commented 1 year ago

:) I do not know @Sandman4050 but error is not coming from eufy_security, it is from core eufy component.

If you still think that this is right place, I do not have anything to contribute

ile "/usr/src/homeassistant/homeassistant/components/eufy/init.py", line 61, in setup
data = lakeside.get_devices(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/lakeside/init.py", line 39, in get_devices

Okay, I'm not sure which repository then. This is the only thing I had downloaded.

fuatakgun commented 1 year ago

your error is coming from here: https://www.home-assistant.io/integrations/eufy/

randy993 commented 1 year ago

@fuatakgun Could you reopen this ticket? Since @Sandman4050 was not the starter of this ticket?

fuatakgun commented 1 year ago

@randy993 you also have to follow bug template, i dont want to guess what could be the problem by just looking at random messages.

I have spent time on creating guides for you to share debug logs, just follow it

Blaylock1988 commented 1 year ago

He filled out the template, and he clearly pulled the log to get the error trace. If you wanted the whole log file you should have asked before closing the issue without a resolution. The bug is real and at least 5 of us have here have it not including sandman or sesardelaisla.

fuatakgun commented 1 year ago

@Blaylock1988 where is the log here?

And it is clearly asked on the bug template, logs are needed and i even prepared a guide on this.

Anyone is free to stop using this. You have to understand that this is a free time activity and i don't want to lose time on vain discussion. If i would spare time on this, i need everything.

And you lastly touched a nice point, many people is having the issue but no one is sharing the debug logs.

randy993 commented 1 year ago

@fuatakgun I understand, I think I misread the guide. Hereby the additional logging.

This is in the eufy-security-ws logs: image

And this in the HA logs.

This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/eufy_security/config_flow.py:112
Integration: Eufy Security (documentation, issues)
First occurred: 7:03:16 PM (2 occurrences)
Last logged: 7:03:21 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 181, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 297, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 393, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eufy_security/config_flow.py", line 89, in async_step_user
    valid = await self._test_credentials(user_input[ConfigField.host.name], user_input[ConfigField.port.name])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eufy_security/config_flow.py", line 112, in _test_credentials
    api_client: ApiClient = ApiClient(config, aiohttp_client.async_get_clientsession(self.hass))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ApiClient.__init__() missing 1 required positional argument: 'on_error_callback'