Eufy Security Integration

Big thanks to @bropat who made this possible. Please consider buying a coffee for him over here: https://ko-fi.com/bropat

Announcements;

  • Master branch has the latest changes regarding relying on go2rtc for streaming (and possible with audio, who knows)
  • I have stopped publishing new release versions until master branch becomes reliable.
    I have come up with a custom integration here. It is far from perfect but it is working for me, so if you are interested you can install following readme instructions from github. Mainly, it requires you need to setup an addon and an integration.

Instructions: GitHub - fuatakgun/eufy_security: Home Assistant integration to manage Eufy Security devices as cameras, home base stations, doorbells, motion and contact sensors.

27 Likes

Amazing that I was looking for exactly what you’ve put together here. Gonna try get it working now, but for some reason despite it being in my custom components profile, your integration isn’t showing up. Time for a container restart! holds thumbs

Right! Seems to be up and running after a shutdown of the docker container that I had my home assistant setup running in. The cam stream isn’t starting, I’m getting this:

Logger: homeassistant.components.camera
Source: components/camera/init.py:608
Integration: Camera (documentation, issues)
First occurred: 22:37:13 (16 occurrences)
Last logged: 22:46:14
Error requesting stream: camera.front_door does not support play stream service

Will carry on kicking it about, but good to see it’s fixed some of the issues I had with the other integrations I was using. :slight_smile:
Thanks for your efforts on this!

To enable streaming, you need to call ‘camera.turn_on’ service as security camera is turned off by default. I have this as setup in frontend. One option can be to enable live stream when user clicks on image probably.

These buttons below will enable live stream when you click on them and long press will disable live stream. To conserve battery, this is required.

type: grid
cards:
  - type: button
    tap_action:
      action: call-service
      service: camera.turn_on
      service_data: {}
      target:
        entity_id: camera.entrance
    entity: camera.entrance
    show_state: true
    show_icon: false
    name: toogle entrance
    hold_action:
      action: call-service
      service: camera.turn_off
      service_data: {}
      target:
        entity_id: camera.entrance
  - type: button
    tap_action:
      action: call-service
      service: camera.turn_on
      service_data: {}
      target:
        entity_id: camera.garage
    entity: camera.garage
    show_state: true
    show_icon: false
    name: toogle garage
    hold_action:
      action: call-service
      service: camera.turn_off
      service_data: {}
      target:
        entity_id: camera.garage
columns: 2
square: false

2 Likes

I had a script do exactly what you are suggesting on the previous component I had. Alas, I think it’s something to do with my setup. LIkely I’m running things in docker and not directly a direct install.

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/eufy_security/websocket.py:78
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 22:56:45 (16 occurrences)
Last logged: 23:11:37
[547820338048] Cannot write to closing transport
[547819487968] Cannot write to closing transport
[547819487968] Error handling message: Unknown error
[547977507216] Cannot write to closing transport

Somehow, node server is closing connection, rather than keeping it alive. Can you see the logs on eufy-security-ws server?

yup, looks like some feature isn’t supported??

name: ‘NotSupportedFeatureError’,
2021-06-26T22:19:57.938781994Z node_modules/ws/lib/receiver.js:367:17,
2021-06-26T22:19:57.938720217Z • receiver.js:367 getData,
2021-06-26T22:19:57.938462682Z node_modules/ws/lib/receiver.js:437:14,
2021-06-26T22:19:57.938413516Z • receiver.js:437 dataMessage,
2021-06-26T22:19:57.938228295Z events.js:376:20,
2021-06-26T22:19:57.938169647Z • events.js:376 emit,
2021-06-26T22:19:57.937957630Z node_modules/ws/lib/websocket.js:834:20,
2021-06-26T22:19:57.937907668Z • websocket.js:834 receiverOnMessage,
2021-06-26T22:19:57.937704151Z events.js:376:20,
2021-06-26T22:19:57.937627985Z • events.js:376 emit,
2021-06-26T22:19:57.937477319Z src/lib/server.ts:57:53,
2021-06-26T22:19:57.937402301Z • server.ts:57 ,
2021-06-26T22:19:57.937215858Z src/lib/server.ts:98:58,
2021-06-26T22:19:57.937119230Z • server.ts:98 receiveMessage,
2021-06-26T22:19:57.936938009Z src/lib/server.ts:46:34,
2021-06-26T22:19:57.936857232Z • server.ts:46 device,
2021-06-26T22:19:57.936700548Z src/lib/device/message_handler.ts:35:31,
2021-06-26T22:19:57.936616734Z • message_handler.ts:35 handle,
2021-06-26T22:19:57.936418643Z node_modules/eufy-security-client/src/http/station.ts:815:19,
2021-06-26T22:19:57.936334921Z • station.ts:815 setRTSPStream,
2021-06-26T22:19:57.936212644Z error stack:,
2021-06-26T22:19:57.936191644Z },
2021-06-26T22:19:57.936099404Z name: ‘NotSupportedFeatureError’,
2021-06-26T22:19:57.936045720Z {,
2021-06-26T22:19:57.936011905Z details:,
2021-06-26T22:19:57.935813721Z NotSupportedFeatureError This functionality is not implemented or supported by T8210P00xxxxxxE,
2021-06-26T22:19:57.935625445Z 2021-06-26 22:19:57.935 ERROR Message error

Yes, apparently, specifically this line says that This functionality is not implemented or supported by T8210P00xxxxxxE. Can you reach out node owner’s to include support for this model?

So I’m using this Eufy Security WS docker image, which is a wrapper for his security client which specifically says it supports my model.

It may be that it’s nearly midnight and I was out drinking in the sun afternoon that I’m struggling more than normal. It may be quicker to solve tomorrow… but for the hell of it, tonight I’ll go back to a previous version of his docker image and see what happens.

Can you confirm your docker image includes latest version of client code? Maybe some version issue?

Yup, was running latest. I rolled back to his previous version, and same story, so back to new version. It’s making me wonder if I need to check home assistant versions (which usually ends up with me fixing things for days gah!).

But. Maybe this is also a clue - whenever I call the camera to turn on, I get a login error showing up in my HA notifications from the IP of the PC I am on.

That error is normal because ha is trying to generate a url to stream camera view and it throws an error because stream address is missing. So, error is coming because you ended up in this popup. You can check the url generated, token parameter is unauthorized.

I did some work on using automations to cast the picture to a TV.
This uses the mqtt work others have done.
Scripts in the post if they are of use to anyone.
https://plugmeinnow.com/post/655148518056624128/ding-dong

3 Likes

hey, just as a headsup, Bropats library auto generates a docker container, so you can bypass steps 1-8 on your github by just running

docker run -it
-e USERNAME=user
-e PASSWORD=pw
-v "$(PWD)"/data:/data
-p 3000:3000
bropat/eufy-security-ws:latest
2 Likes

I will modify integration a bit, rather than starting rtsp, i will call live stream command, apparently it is working for doorbells.

1 Like

Sounds good, let me know when you’ve modified it, I’ll pull down a new image from your github repo and try it out. Any chance you are going to integrate it with HACS?

please check over here: wireless doorbell camera feed · Issue #6 · fuatakgun/eufy_security · GitHub
I was able to use @bropat 's solution (Controlling Eufy Security Devices with ioBroker)

when i added it as a custom repository in HACS it loaded just fine

existing repository does not support non-rtsp cameras as doorbells. so, using websocket, trying to get video stream and convert it on home assistant as streaming video. I will release new version to support these cameras soon.

1 Like

When I try to add the custom repo to HACS I am getting:

image