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

RTSP streams no longer starting #39

Closed ronaldt80 closed 3 years ago

ronaldt80 commented 3 years ago

Please check Services, Known Bug / Issues and Troubleshooting over here first: https://github.com/fuatakgun/eufy_security/blob/master/README.md

Describe the bug RTSP camera's (Eufycam 2C) are no longer working (prior versions of this integration did work). Battery powered doorbell (P2P) is working without problems.

To Reproduce Steps to reproduce the behavior:

  1. Initiate service call (Eufy Security: Start Live Stream over RTSP)
  2. No image
  3. See error message:
2021-08-07 22:44:26 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 380, in create_stream
source = await self.stream_source()
File "/config/custom_components/eufy_security/camera.py", line 279, in stream_source
await self.initiate_turn_on()
File "/config/custom_components/eufy_security/camera.py", line 274, in initiate_turn_on
return await wait_for_value(self.__dict__, "is_streaming", False, interval=0.5)
File "/config/custom_components/eufy_security/const.py", line 231, in wait_for_value
await asyncio.sleep(interval)
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 654, in sleep
return await future
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 269, in preload_stream
stream = await camera.create_stream()
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 380, in create_stream
source = await self.stream_source()
File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 55, in __aexit__
self._do_exit(exc_type)
File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 92, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

Expected behavior Expected video to start in line with previous version

Screenshots N/A

**Hardware Information about Home Assistant

**Hardware Information about Cameras

Additional context Previous versions worked

ronaldt80 commented 3 years ago

For the avoidance of doubt - P2P streaming on both camera's is still working without issue

fuatakgun commented 3 years ago

Thanks for detailed description. I believe you have enabled stream preloading, if that is the case, can you disable it? It doesn't add any benefit in eufy use case.

Screenshot_2021-08-07-23-20-05-036_io.homeassistant.companion.android~2.jpg

fuatakgun commented 3 years ago

It is late in EU timezone but if you can share one of these 2c cameras and i can deep dive tomorrow. I have 4 pieces of 2c cameras and all is working fine (sometimes i need to call turn on twice, still investigating)

ronaldt80 commented 3 years ago

That did the trick! Oddly enough I could not disable it on the laptop, on the phone/companion app I could. Once restarted everything was back to normal. Great work by the way - I have been struggling with all sorts of eufy addons for the past year and this is the first one that give a sense of control.

fuatakgun commented 3 years ago

That little bastard checkbox is trying to enable rtsp stream all the time (it is like clicking on camera image to initiate as a user) and it is not patient :-)

I should update readme with this information.

Happy to see that issue is resolved and you are happy overall