fuatakgun / eufy_security

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

Config flow chokes on reconfigure (v 8.0) #1049

Closed ronaldt80 closed 5 months ago

ronaldt80 commented 6 months ago

Describe the bug

When attempting to reconfigure the integration there is an error message (server error 500) on the config flow

To reproduce

Steps to reproduce the behavior:

  1. Go to integrations
  2. Click on eufy security
  3. Scroll down to configure
  4. See error

Expected behavior

The normal config flow

Additional information

Go to Settings -> System -> Repairs -> Click on 3 dots (...) -> System Information and get Version and Installation Type to below fields;

Hardware Information;

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, 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 233, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle result = await handler(request, request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 213, in post return await super().post(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 71, in post result = await self._flow_mgr.async_init( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 255, in async_init flow = await self.async_create_flow(handler, context=context, data=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1868, in async_create_flow return handler.async_get_options_flow(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/eufy_security/config_flow.py", line 62, in async_get_options_flow return EufySecurityOptionFlowHandler(config_entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/eufy_security/config_flow.py", line 33, in init vol.Optional(ConfigField.rtsp_server_port.name, default=self.config.rtsp_server_port): cv.port, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/enum.py", line 784, in getattr raise AttributeError(name) from None AttributeError: rtsp_server_port



- Logs from Eufy Security Add-on (either from Add-ons page of Home Assistant or Docker output):
N/A
- Would you share your device with me in case further debugging required? (Yes/No):
Not device related

**Additional context**

Add any other context about the problem goes here. Mainly, share everything as log files and use screenshots as last resort.
![Screenshot_20231224-094228](https://github.com/fuatakgun/eufy_security/assets/53364332/f07ff917-ffa5-462a-bf12-ee771234c959)
V4ler1an commented 6 months ago

I came to report the same issue. Had to restore from backup to roll back after installing v8. In addition, I noticed my P2P > RTSP streaming failed on all cameras. Clicking the link to start stream would go to PREPARING for a few seconds then back to IDLE. Due to a port conflict I setup my RTSP Simple Server add-on with port 8558 instead of 8554. I wondered if this had created a problem with this update?

kmil4 commented 6 months ago

Same issue.

chris173972 commented 6 months ago

Screenshot 2023-12-25 013642

When I updated the HACS Eufy version to 8.0.0. Now unable to configure the integration

fuatakgun commented 6 months ago

Uninstalling and installing back should fix it until i can fix the issue.

braddunlap commented 6 months ago

Uninstalling and installing back should fix it until i can fix the issue.

Thanks, but unfortunately this did not work for me.

Has anyone else got this workaround to work?

csese0701 commented 6 months ago

Not working for me by uninstalling and installing again.

davmantor commented 6 months ago

Same issue and uninstalling and reinstalling didn't fix it for me either. Stream is working just fine but can't open the config to expose things like battery %

V4ler1an commented 6 months ago

Uninstalling and installing back should fix it until i can fix the issue.

I too had a problem rolling back. Thought I must have done something wrong. At first I tried a partial restore of just the Eufy Security add-on using the default HA built in backup but the add-on still said v8. I restored a full VM backup in the end.

fuatakgun commented 6 months ago

If you want to rollback, do it via hacs, v8 is about custom integration not add-on.

Restore/backup effects add-on and core installation.

V4ler1an commented 6 months ago

Ok thanks, doesn't look like HACS custom integrations are available for partial backup restore so I'll try the integration uninstall reinstall in future.

tne7laa commented 6 months ago

+1 Got the same problem. What solved for me is:

mhl66 commented 6 months ago

Sorry, 7.7.4 to 7.7.1 have the same problem. For my EUFY Homebase with four cameras (eufyCam 2C), all the buttons are broken (24 Entities are not available ("Reset Alarm", "Start P2P Stream" ... "RTSP Stream URL"...) in the integration, they are hidden.

4webat commented 6 months ago

Hello same problem here, version 7.7.4 doesnt work! And version 8.0 doesnt work :(

ronaldt80 commented 6 months ago

Sorry, 7.7.4 to 7.7.1 have the same problem. For my EUFY Homebase with four cameras (eufyCam 2C), all the buttons are broken (24 Entities are not available ("Reset Alarm", "Start P2P Stream" ... "RTSP Stream URL"...) in the integration, they are hidden.

You can enable them easily

mhl66 commented 6 months ago

Sorry, 7.7.4 to 7.7.1 have the same problem. For my EUFY Homebase with four cameras (eufyCam 2C), all the buttons are broken (24 Entities are not available ("Reset Alarm", "Start P2P Stream" ... "RTSP Stream URL"...) in the integration, they are hidden.

You can enable them easily

No, unfortunately not - they are hidden, simply enabling does not work (remains in stream status "PREPARING"), maybe that is the reason why those functions are disabled...

EDIT: Sorry for the confusion - this was my solution: https://github.com/AlexxIT/WebRTC/issues/509#issuecomment-1788636894

fuatakgun commented 6 months ago

@ronaldt80 , I am banned from home assistant community for a month for some other irrelevant point, so please expect no response from me over the forum :-)

I will work on fixing these stuff

V4ler1an commented 6 months ago

Thank you Fuat, we are most grateful. Happy New Year to you :)

ronaldt80 commented 6 months ago

@ronaldt80 , I am banned from home assistant community for a month for some other irrelevant point, so please expect no response from me over the forum :-)

I will work on fixing these stuff

A one month ban? Sounds a bit harsh, take it that's why you packed your bags? Anyway, didn't see this response until now but dropped you an email with a big thanks for all your efforts and support over the years. Hope we can continue to benefit from your drive on GitHub.

hillshome commented 5 months ago

Same issue here rolling back doesn't work. Any update on the fix?

fuatakgun commented 5 months ago

get v8.0.1, it is finally fixed

ronaldt80 commented 5 months ago

Brilliant! It works. Finally able to turn of the native streaming again!

V4ler1an commented 5 months ago

get v8.0.1, it is finally fixed

Sorry but this didn't go well for me Fuat. None of my streams work now and I can see it's because the 'Stream URL' has returned to the default port of 8554 when I was using 8558 to avoid a port conflict: image

My RTSP Simple Server add-on is configured as this. Yet you can see from the logs when I restart it, it ignores it and still starts up running on 8554: I've tried to change the port to something different then back to 8558 but no change. Also tried full HASSIO restarts. image image

I tried adding the port to the end of the IP address in eufy security hub configuration but it just appends 8554 to the URL: image image

Also my web sockets add-on still says 1.7.1, am I missing something or is that expected? image

I'm going to roll back, any suggestions?

fuatakgun commented 5 months ago

@V4ler1an , you are not supposed to use rtsp add-on anymore, check readme

hankfic commented 5 months ago

Having the same problem as V4ler1an. I'm using the RTSP add-on as per the readme suggests due to the wired doorbell cam being P2P only.

V4ler1an commented 5 months ago

My Eufy P2P cameras are now back working through my WebRTC lovelace cards. This time, out of caution I uninstalled the RTSP Simple Server add-on before running the update.

What was a little frustrating... I didn't pick up on the fact RTSP Simple Server was no longer a requirement because when originally clicking on the Eufy Security integration in HACS, where it says 'Pending update' highlighted in blue. The readme still says v7.7.4 at the top and still references the requirement for the RTSP Simple Server. None of the v8.0.1 changes are in those notes.

V4ler1an commented 5 months ago

@V4ler1an , you are not supposed to use rtsp add-on anymore, check readme

One useability issue I would like to highlight at least where using the WebRTC cards is concerned (through P2P > gotortc). Previously if I had just opened a dashboard page with a WebRTC card on it and clicked 'Start P2P Stream' the feed would come up on the card fairly quickly with no further input, as long as I didn't wait to long after first opening the dashboard page. Now I notice that after starting the stream I must also click the 'error' link in the top right of the WebRTC card or I wait quite a long time for the stream to display. This threw me at first, making me think it wasn't working. Is there any way this behaviour could be improved? E.g... open dashboard page, click start stream, no further input needed.