fuatakgun / eufy_security

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

Eufy S120 Livestream Fails and crashes Eufy Add-On #1148

Open kmil4 opened 1 month ago

kmil4 commented 1 month ago

Describe the bug

FYI: I have a Eufy doorbell and multiple pan/tilt cameras that work flawlessly with this integration (Thank you!!). I've been using this integration for quite a while so I have a decent understanding.

The problem is with a new Eufy S120 when attempting to livestream to my HA dashboard. I encounter this error:

Failed to call service camera/turn_on. {'type': 'result', 'success': False, 'messageId': 'device.stop_livestream.c42ea6d5c7f742d0a678cc8f883e539e', 'errorCode': 'device_livestream_not_running}`

Around 20% of the time, I can get the feed to appear without issue from this camera (it's on the list of supported devices). The rest of the time, the stream will throw an error within about 10 seconds after clicking "Start Stream." But even if I'm able to get the stream running, most of the time it will be live for about 30 seconds before suddenly stopping, and throwing the same error above. Once the error appears, the Eufy Add-On hangs, and must be manually restarted or it will chew up CPU.

To reproduce

Assume Eufy Add-On + Integration are installed and configured, with other camera streams already working.

Assuming the root cause is related this bug reproes in two ways: First Repro

  1. Set Eufy S120 video and recording settings to low
  2. Copy the WebRTC dashboard card from the dev docs, replacing entity ID with camera.garage_camera and save
  3. Press "Start Stream"
  4. See error

Second Repro

  1. Set Eufy S120 video and recording settings to low
  2. Copy the WebRTC dashboard card from the dev docs, replacing entity ID with camera.garage_camera and save
  3. Press "Start Stream"
  4. Live stream will begin. Wait at least 60 seconds. Do not interact with the page or navigate away.
  5. Wait for livestream to disappear, observe error

Expected behavior

A livestream of the camera feed should start within 10 seconds of pressing "Start stream"

Additional information

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

Hardware Information:

Additional context

Add any other context about the problem goes here. Mainly, share everything as log files and use screenshots as last resort.

A few things I've tried without notable changes in behavior: