Eufy Camera Integration

Just some potentially useful set-up info for people using @anon63427907 & @bropat 's integration/docker container.

I’ve got my doorbell live stream down to about 2-4 second delay using WebRTC to display the RTSP camera feed using this integration: GitHub - AlexxIT/WebRTC: Home Assistant custom component for viewing IP cameras RTSP stream in real ti

The lovelace card:

I added the additional command mse: false because quite often it would load the MSE stream then stutter for another second before loading WebRTC but your results may vary, anywho - this is my card:

type: custom:webrtc-camera
entity: camera.doorbell
mse: false

I’ve also utilized the lovelace conditional card so the WebRTC feed only displays on the dashboard when the camera is actually streaming. Eg:

type: conditional
conditions:
  - entity: camera.doorbell
    state: Streaming - p2p
card:
  type: custom:webrtc-camera
  entity: camera.doorbell
  mse: false

and I’ve set-up another card which displays the last event detected by the doorbell (this still image is coming from this integration for now: matijse/eufy-ha-mqtt-bridge). This is also a conditional card and this displays when the camera is NOT streaming video. To activate video, I simply click on the pic which triggers script.eufy_doorbell_rtsp_reload that I’ve created that calls the eufy_security.stop_livestream & eufy_security.start_livestream service.

Conditional card with script call:

type: conditional
conditions:
  - entity: camera.doorbell
    state: Idle
card:
  type: picture-glance
  entities: []
  camera_image: camera.doorbell_last_event
  tap_action:
    action: call-service
    service: script.eufy_doorbell_rtsp_reload
    service_data: {}
    target: {}

Script:

alias: Eufy Doorbell RTSP Reload
sequence:
  - service: eufy_security.stop_livestream
    target:
      entity_id: camera.doorbell
  - service: eufy_security.start_livestream
    target:
      entity_id:
        - camera.doorbell
mode: single
2 Likes

Thanks for sharing, one improvement, you do not need eufy ha mqtt integration for your picture-glance card. You can give camera entity name as picture url like below;

type: picture-glance
entities: []
camera_image: camera.entrance_camera

Can you create a PR to include this improvement into README section?

One call-out here, i encapsulated @bropat’s docker as home assistant add on, without adding any value and I would be happy to handover the add-on to him :slight_smile:

I am too lazy to integrate this into core system, moreover this integration is still in very early stage, not ready yet in terms of stability. If i have built this into core, you needed to wait for next release to get fixes. on the other hand, someone might claim that if it was part of core, the issues wouldn’t exist at all.

1 Like

Also, we can’t use the same integration unfortunately. The underlying library for the Eufy component only supports lights/switches. It would require a major rework to get it to support all the Eufy Security does. Blame Eufy for their segmentation of all their apps/protocols.

1 Like

Ah yes, I tried the picture-glance option for ‘last event’ image yesterday and it seemed to just display a still from the last video capture, with the time stamp up in the top right corner. But I’ve tried again tonight and it’s working perfectly :smiley: Time to decommission the eufy mqtt container!

I’ll get the PR submitted and will exclude the mqtt mention :wink:

One thing that’s still not working great; when I first start @Bropat 's docker container the livestream seems to work fine. I have a Home Assistant automation to stop the stream after 2.50 mins (I read about 3 min hard limit somewhere a while back…)

However when I attempt to start the stream again a few minutes/hours later, I get the below error:

2021-08-11 20:19:10.471  ERROR Message error 
 LivestreamAlreadyRunningError  Livestream for device T8200N00XXXXXXX is already running
details:
{
  name: 'LivestreamAlreadyRunningError'

Sometimes the stream will work but mostly it doesn’t until I perform a restart of the docker container.

I’ve also noticed that motion detection from the doorbell via the Eufy app stops working when the container is running. (I’m using a seperate eufy account exclusively for the docker container)
eg. I don’t get any motion detection notifications to my phone when someone is standing by my door.

Unfortunately it’s stuck with the still image from last video capture again instead of last ‘event’. It only goes back to ‘last event’ when Home Assistant is restarted. Should I submit an issue for this on @anon63427907 or @bropat 's github?

No that is a feature, if there is no live event, you will see latest capture image but when live stream starts, it will update itself from video. Until a new event arrives, it will stay there.

So, even though you are receiving a new event (notification) is not it updated?

I think it does update when new event detected yeah.

I can see the upside to having the last video image, I think I prefer the ‘last event’ so will stick with mqtt part to cover that for now :slight_smile:

in the meantime, you can create a feature request in the integration to enable this as an option :slight_smile:

  • when live stream is off, show picture of last event
1 Like

Hi @anon63427907

I’ve been away for 15 days (vacation)
I can see progress hasnt stand still, which is good :slight_smile:
However i’m not sure what my next steps are…
Whats this about webrtc
It’s another addon?
Is your 2 addons still the way to go?
Or is the official one out yet?

Does anyone know of any way what so ever to have HA, or Alexa react to the Homebase 2 Alarm being triggered? The alarm on it is pitifully low so I want to have something else trigger when the alarm goes off (and then stops when its deactivated)

Ive been looking for some kind of state or event but I just dont know python to try more.

Hi Guys,
is there any way to have HA snooze the motion sensor on the door camera without going down the route of adding ioBroker

I am away for 2-3 weeks for vacation, please hold on :slight_smile:

3 Likes

Fuatakgun/bropat thanks! This integration setup is much better. Cameras are much faster. Just wondering if anyone has gotten any automations to work based on this integration.

I set up a simple automation to toggle a light when the doorbell is rang as a simple test but I can’t get it to work. I see the state changes in the logbook and if I manually trigger the automation the light toggles so I can’t figure it out.

My ultimate plan is to have the P2P stream start on motion or person detection in order to have the stream already on before the doorbell push. Once the doorbell is pushed I will push the stream to my TV or another device and stop the P2P stream after a certain time.

I’m a HA rookie so my automation is built from the visual editor.

- id: '1630010474591'
  alias: DB
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.front_door_ringing_sensor
    to: 'true'
    attribute: ringing
  condition: []
  action:
  - type: toggle
    device_id: d83a9a6428931a9817859a10d2501335
    entity_id: light.center
    domain: light
  mode: single

a binary_sensor’s state is on or off, not true of false :wink:

Also I’m not sure your action is right, mines look something like:

  - service: light.toggle
    data:
      entity_id: light.center

Thanks I did have on/off originally but changed it how it was being reported in the integration. I’ll try it along with your toggle suggestion.

In case anyone else is having the same struggle as me with setting up eufy security in ioBroker…

Firstly, username and password is your email and password for eufy. If you then get a fail on “Connected to device or service”, have a look in the logs. If it says “Two factor authentication request received…”, go to Objects > “eufy-security.0.verify_code” and double-click the “(null)” value to enter the code that was emailed to you (don’t click the pencil to edit; don’t know wtf that is).You might see the value update for a second, but when it works it resets back to null. However, you should then have other properties under “eufy-security.0”.

Also, I have eufy cameras that connect to a base station. The setup guide is for a camera doorbell, which might be different, and lists the REST sensor resource as:

http://IOBROKER_SERVER_IP:8087/getPlainValue/eufy-security.0.CAMERA_SERIAL_NUMBER.station.guard_mode

However, in cases like mine, under Objects you can see this value is under the serial number for the base station, so you should use that instead.

I am trying to create some automation to allow me to automatically set the guard mode on my Eufy doorbell and spotlight when I leave the house. I have followed the excellent guide by @fuzzymistborn but the end result is none of the commands seem to be received by the Eufy devices. I think there may be something amiss with my Simple Restful API configuration. Once I install the adapter and try to go to http://<IOBROKER_IP>:8087/get/system.adapter.simple-api.0.uptime?prettyPrint I get a connection refused error, and the same if I try and hit the rest command URL: http://IOBROKER_IP:8087/set/eufy-security.0.<camera_serial>.station.guard_mode?value=Away&ack=false. In the list of instances the simple-api.0 is running and showing green. Is there a config step I have missed?

Assuming you’re running via docker. Did you make sure to map the 8087 port in your docker run command/docker-compose file?

Nope, I am running via HassOS and MaxW’s HassOS add-on