nonsleepr / ha-eufy-security

Custom integration of Home Assistant with EufySecurity
168 stars 44 forks source link

Login #2

Open alesoft73 opened 4 years ago

alesoft73 commented 4 years ago

Hi, i have intall your component with HACS but when i insert login e password in integration don't login. Is possible ?? i receive "Unknown error occurred" Many thanks!

nonsleepr commented 4 years ago

Do you have any relevant info in the logs?

alesoft73 commented 4 years ago

I have this... (HA Version 0.102.2)

2019-12-10 22:26:00 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 163, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 48, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 90, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 89, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 132, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/config/custom_components/eufy_security/config_flow.py", line 56, in async_step_user
    user_input[CONF_USERNAME], user_input[CONF_PASSWORD], session
  File "/usr/local/lib/python3.7/site-packages/eufy_security/api.py", line 122, in async_login
    await api.async_update_device_info()
  File "/usr/local/lib/python3.7/site-packages/eufy_security/api.py", line 54, in async_update_device_info
    for device_info in devices_resp["data"]:
KeyError: 'data'
nonsleepr commented 4 years ago

It looks like there are no cameras linked to the account and the integration isn't handling it properly. Have you tried to use the same credentials to login from the phone and see if you see the cameras there?

alesoft73 commented 4 years ago

Yes, i use 2 account. I have created a second account for login in integration. But don't connect. Don't work any account

alesoft73 commented 4 years ago

IMAGE 2019-12-10 22:33:32 IN the app i see 2 cam

nonsleepr commented 4 years ago

I will try to fix the "Unexpected error" in python-eufy-security to at least properly handle the issue.

What country are you from? Right now the package uses hardcoded endpoint, which, I think, is for the US. Might be that's the reason why the cameras are not seen.

alesoft73 commented 4 years ago

I leave in taly .... ;) Many thanks...

nonsleepr commented 4 years ago

Do you have Pi-Hole installed? If so, can you check what host your phone tries to connect to? (Simply search for "eufy").

alesoft73 commented 4 years ago

yes...

ipcheck.eufylife.com

alesoft73 commented 4 years ago

Schermata 2019-12-10 alle 23 41 27 This is internet connection

nonsleepr commented 4 years ago

Confirmed that the cameras wouldn't be shown when regional endpoints are used. That's fixable. If you're able to manually install python-eufy-security into your HA instance, you can try replacing mysecurity.eufylife.com in eufy_security/api.py to security-app-eu.eufylife.com.

Long term fix is coming.

alesoft73 commented 4 years ago

the modify is in specific file?

alesoft73 commented 4 years ago

Ok i attend the fix. Many thanks!!!!

nonsleepr commented 4 years ago

Please confirm that helped.

alesoft73 commented 4 years ago

confirmed ;)

MaxCere commented 4 years ago

same happen to me from italy. I don't understand where I can find api.py....

alesoft73 commented 4 years ago

same happen to me from italy. I don't understand where I can find api.py....

If you wont to access the file, connect with port 2222 with Hassio. https://developers.home-assistant.io/docs/en/hassio_debugging.html

bachya commented 4 years ago

@alesoft73 @MaxCere We just released version 0.3.0 of python-eufy-security that should address international addresses dynamically; could you help us test?

MaxCere commented 4 years ago

It works. No more error and I can se my camera and the entry sensor. Thanks!

alesoft73 commented 4 years ago

Confirmed, now work. I test and send a feedback. For donation? For your work!

alesoft73 commented 4 years ago

Login ok... I have 2 cam. when i press the cam don't show the streaming. why?

nonsleepr commented 4 years ago

For now you have to manually fire an event camera.turn_on in Dev Tools -> Services.

alesoft73 commented 4 years ago

Ahh ok for start streaming and stop?

nonsleepr commented 4 years ago

I think this was discussed in HA thread. IIRC it would stop the steam itself in 3 minutes.

alesoft73 commented 4 years ago

Default streaming 3 minutes ?? Ok , i have created a script to start and stop after 5 minutes... is the same. Many thanks another. Work perfect!

alesoft73 commented 4 years ago

If you wont i have a warnig about component.... This :

2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1225", value "9" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1146", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1240", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1013", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1011", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1239", value "11" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "99904", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1015", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1141", value "-58" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1243", value "2" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1229", value "100" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1142", value "-41" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1145", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1101", value "99" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1273", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "99901", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1230", value "100" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1246", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1204", value "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1138", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "2111", value "2" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1241", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1131", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1045", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1210", value "180" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1225", value "9" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1146", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1240", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1011", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1013", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "99904", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1239", value "13" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1015", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1141", value "-72" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1243", value "2" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1229", value "100" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1142", value "-62" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1145", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1101", value "99" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1273", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1230", value "100" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "99901", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1246", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1204", value "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1138", value "5" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "2111", value "2" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1131", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1045", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1210", value "122"

nonsleepr commented 4 years ago

What kind of cameras/bases do you have?

alesoft73 commented 4 years ago

This EUFYCAM

MaxCere commented 4 years ago

If you wont i have a warnig about component.... This :

2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1225", value "9" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1146", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1240", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1013", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1011", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1239", value "11" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "99904", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1015", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1141", value "-58" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1243", value "2" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1229", value "100" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1142", value "-41" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1145", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1101", value "99" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1273", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "99901", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1230", value "100" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1246", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1204", value "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1138", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "2111", value "2" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1241", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1131", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1045", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1210", value "180" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1225", value "9" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1146", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1240", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1011", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1013", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "99904", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1239", value "13" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1015", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1141", value "-72" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1243", value "2" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1229", value "100" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1142", value "-62" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1145", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1101", value "99" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1273", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1230", value "100" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "99901", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1246", value "0" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1204", value "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1138", value "5" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "2111", value "2" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1131", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1045", value "1" 2019-12-16 01:07:52 WARNING (MainThread) [eufy_security.camera] Unable to process parameter "1210", value "122"

Same warinng to me.

MaxCere commented 4 years ago

What kind of cameras/bases do you have?

I have: HomeBase (v1) Camera (v1) 2x door sensor.

Purchased from kickstarter. They are the first released version of HW by Eufy.