Eufy Camera Integration

There you go! I extracted @bachya’s PR into a separate repo (I hope @bachya doesn’t mind) and added some instructions here: https://github.com/nonsleepr/ha-eufy-security

4 Likes

Hello everyone,

I have been monitoring this thread for a week or so and today I finally got my setup completed and installed the Eufy Security integration with the help of my friend.

I have a Eufy Doorbell and seven EufyCam 2 installed and running. The cameras are already added to HomeKit via beta program, but I wanted to add the doorbell to at least be able to view live streams within HomeKit.

The HASSIO is running on Synology NAS and this is what I have done so far:

  1. Created a second Eufy account and logged in with that in HA.
  2. I managed to load all the cams into Home Assistant.
  3. I am able to see the most recent snapshots of all cameras.
  4. I was able to manually live stream the camera feed via Dev Tools > Services > camera.turn_on.

Is it possible to automatically live stream cameras’ feeds when selected? Also, there are several errors in the logs. Is there anything I can do to fix? And please let me know what can I test and be more helpful.

Log Details (ERROR)
Sun Dec 08 2019 16:12:23 GMT-0800 (PST)
Error requesting stream:
camera.cam_3 does not support play stream service
Log Details (WARNING)
FFmpeg is already running!
Log Details (ERROR)
Sun Dec 08 2019 16:31:31 GMT-0800 (PST)
Log Details (ERROR)
Sun Dec 08 2019 16:31:31 GMT-0800 (PST)

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/camera/__init__.py", line 496, in get
    return await self.handle(request, camera)
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 531, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/config/custom_components/eufy_security/camera.py", line 133, in handle_async_mjpeg_stream
    stream_reader = await self._ffmpeg_stream.get_reader()
  File "/usr/local/lib/python3.7/site-packages/haffmpeg/core.py", line 181, in get_reader
    lambda: reader_protocol, self._proc.stdout
  File "uvloop/loop.pyx", line 2775, in connect_read_pipe
  File "uvloop/loop.pyx", line 2768, in uvloop.loop.Loop.connect_read_pipe
  File "uvloop/handles/pipe.pyx", line 120, in uvloop.loop.ReadUnixTransport._open
  File "uvloop/handles/pipe.pyx", line 28, in uvloop.loop.__pipe_open
FileExistsError: [Errno 17] File exists
1 Like

Hello,

Are you able to load the cam feed from the doorbell?

Only through Dev Tools. I’ll double-check, but I am pretty sure it was the doorbell.

I just got this doorbell and want to integrate this.

When creating a second account, do you create a Guest account or and Admin?

I made it an admin user.

Do you know when this integration will be integrated for every one in Home Assistant ?

We’re still working to fully flesh out the API. The repo that’s available via HACS works well enough for basic use and is easy to install. Give it a try.

1 Like

Everything works good thanks for what you have do so far. I can see the doorbell in Hass I can see new updated pictures w when someone walks in front of the camera. However I want to use the doorbell or motion in automatons. Currently it always shows idle no matter if I press the button walk in front of the camera . I used HACS to setup the integration to make the door bell button press show in HASS?

That feature is not yet supported, though I think it’s being worked on.

Thanks all for your work on this!

I think I must be doing something wrong.

Followed @nonsleepr’s great intructions.

Set up some picture entity cards to view them (is that the right kind of card?)

I see the latest image. However, when I click on it, it still only shows the latest image.

Here’s the log:

Unable to process parameter "1145", value "10"
9:49 PM custom_components/eufy_security/camera.py (WARNING) - message first occurred at 6:59 PM and shows up 35 times
Unable to process parameter "1246", value "11"
9:49 PM custom_components/eufy_security/camera.py (WARNING) - message first occurred at 6:59 PM and shows up 35 times
Unable to process parameter "1101", value "29"
9:49 PM custom_components/eufy_security/camera.py (WARNING)
Unable to process parameter "1015", value "21"
9:49 PM custom_components/eufy_security/camera.py (WARNING) - message first occurred at 6:59 PM and shows up 35 times
Error requesting stream: camera.hall does not support play stream service
9:49 PM components/camera/__init__.py (ERROR) - message first occurred at 9:43 PM and shows up 6 times
Unable to process parameter "1142", value "46"
9:44 PM custom_components/eufy_security/camera.py (WARNING) - message first occurred at 6:59 PM and shows up 34 times
Unable to process parameter "1141", value "27"
9:44 PM custom_components/eufy_security/camera.py (WARNING) - message first occurred at 6:59 PM and shows up 34 times
Unable to process parameter "1101", value "53"
9:44 PM custom_components/eufy_security/camera.py (WARNING) - message first occurred at 6:59 PM and shows up 34 times
Error requesting stream: camera.garage does not support play stream service
9:44 PM components/camera/__init__.py (ERROR) - message first occurred at 9:38 PM and shows up 9 times

There are a ton more unable to process parameter... errors.

Do I need a cloud subscription?

The eufy account I’m using is one where the cameras are “shared” from my main eufy security account.

I have rtsp set up in the Eufy app.

Any suggestions?

You do not need a cloud subscription. To get the camera to steam you need to turn on the stream and off, otherwise it will just show the last image.

And the parameter bit is something I logged on nosleeprs GitHub.

Thanks! How do I turn the stream on and off?

camera.turn_on and camera.turn_off services, plus the entity_id of the camera.

Sorry, I meant where do I put those? Forgive my ignorance…
Is it possible to view the stream in the picture card, or only in the pop-up window?
Is there a clever way to turn the stream on when opening the pop-up, and off again when closing?
Thank you for your help!

I have been tinkering with this while you continue work on the integration. Thought i would share my experience:

I have Eufycam 2s set up using the custom component on HACS from @nonsleepr (thank you). I also have them set up in HomeKit (which works, but is kind of a square peg in a round hole) and connected to Surveillance Station via RSTP (works great, and better than i expected).

I created a script to popup a more-info dialog using browser mod. This runs off an automation using a separate motion detector. When the script executes, the pop up is presented on the specified browsers. However, what i have observed is that the live stream is only played on one of the browsers, the other two do not show the stream. Perhaps this is the limitation on stream to a single account? When sending to a single browser, this method has been reliable.

@tttt I don’t know if this helps you, but I execute the turn_on/off in my script. You would need some mechanism like a script to add this in order to get the live stream at the moment.

I would be interested in hearing experience with the doorbell. I am very interested in the Eufy version to replace my ring. The lack of RTSP support is the only thing holding me back (or the maturation of this integration :wink:

BTW, if there is any way i can help, please let me know. My skills are somewhat limited, but I am certainly an enthusiastic supporter of your efforts

You’d need to create an input_boolean or some kind of other means for calling the service. Or you can turn the stream on in the services tab and then go back to the picture card and click to watch the stream. It won’t show the stream in the picture card, you have to click. The functionality used to be when you clicked it would turn on the stream but 1) it was buggy and 2) i personally find seeing a larger image to be preferred.

@chasut feel free to look through either my repo or @nonsleepr’s and submit a pull request if you see something you want to improve/contribute. In terms of the doorbell i find it to be fantastic. Run into a small issue where it isn’t picking up faces when the person is wearing a hat/sunglasses but that’s just a training the AI issue, i’m sure it’ll get worked out.

@nonsleepr just installed your integration, it was easy, thanks!

@fuzzymistborn @nonsleepr is there a way to add a toggle to the card or image to turn on/off the stream?

You could add an input_boolean with an automation that turns the stream on/off and add that to the picture card. Maybe with a custom card of some type when you click on it it turns on the stream, i don’t know.

Thanks for the recommendation on the doorbell. I picked one up to test it against the ring. I dont like that it doesn’t use the existing chime, but everything else is much better. The motion detection/AI is somewhat finicky compared to the eufycam 2 which is really really good.

I have discovered that if i turn on the video stream based on a different PIR sensor, it will not detect motion or record the video. It does appear to handle both on a doorbell ding. So i think that i will need to wait until you guys figure out how to capture the motion/doorbell.

Anyway, wanted to send my thanks