Eufy Security Integration

Yes the camera has RTSP but it is not enabled as connected to a HomeBase 3. But it is also not enabled on any other of my cameras (except one) and they all show okay in default tiles added to dashboard.

Now trying to make my own dashboard and struggling to find best way to add a live stream to my Eufy cameras, I can get it working, but often after pressing the play button icon I have to refresh the page to see it streaming, this is annoying especially on tablet where I can’t just hit F5

Try webrtc and the relevant cards. You can add icons in the still with among others a play/pause button.

My experience though is that rtsp results in a more responsive behaviour - irrespective of the homebase

It will never be ideal, welcome to the Eufy customer experience.

Okay, any guides as to the YAML I need to add to configure the WebRTC Camera Card please? I am new to this, so looking for some useful resources to control / display my eufy devices etc

Can someone help me get this (e.g. popup window when doorbell motion activated) working with a Eufy E340 doorbell? Followed steps, but get error as below about webrtc codecs not matched

image

Many thanks

Would start with the basics, eg. See if you can implement the webrtc card and get it working. Once that works it will be easier to debug more complicated stuff.

When further exploring good to provide additional background. Eg. Whats the source? And what is included in your script?

There are by the way known conflicts with for instance frigate which has webrtc/gortc baked in. In order to get to the bottom please share more info and logs etc about your setup.

Hi Ronald, thank you very much for your reply, and I fully appreciate what you are saying and think I need to start afresh and do the basics first. Think I got too involved in trying to follow various articles online to achieve my final goals without looking at the basics first.

One initial question, some guides indicate to install WebRTC via HACS, others seem to say to install go2rtc AND webRTC, but I thought just installng WebRTC also includes go2rtc? Think this may not be helping me as I have RTSPtoWebRTC and WebRTC Camera showing in integrations? so are the better steps to follow the ones here (GitHub - fuatakgun/eufy_security: Home Assistant integration to manage Eufy Security devices as cameras, home base stations, doorbells, motion and contact sensors.) and just install webRTC via HACS?

Thank you - I can then test basics and come back with more details of any issues I face.

P.S. I don’t think I have frigate installed, certainly not chosen to do so and can’t see it anywhere

Would for now follow the steps outlined - there are more up to date versions available but at least the route on Fuatakgun’s repo is proven to work. From there provided it works you could use newer versions. Indeed gortc is integrated in this version.

Embedding Eufy within home assistant is not for the faint of heart… if i would invest again for sure the choice of product would be different…

Okay will work through it tomorrow and see how I get on.

Yes I may choose differently another time, but unfortunately for now I am too far invested in eufy having 7 or 8 cameras now.

Thank you

First, Thanks @bropat and @anon63427907 for the Eufy integration work!

I have a Eufy C120 T8400 indoor 2K camera that can integrate, stream, and get event image notification in HA.

However, is there a way to get hourly snapshots and store in the /media directory?

My current setup:

  • Eufy cam: C120 T8400
  • HA (docker): 2024.7.3
  • bropat/eufy-security-ws (docker): 1.9.1
  • AlexxIT/WebRTC (HACS): 3.6.0
  • fuatakgun/eufy_security (HACS): 8.0.4

Thanks in advance!

Try an automation which starts a stream, takes a snapshot (built in functionality in ha) and stop the stream.

The snapshot works like this:

data:
  filename: /config/www/doorbell_snapshot.jpg
target:
  entity_id: camera.doorbell
action: camera.snapshot

If/when it works you can add the frequency and perhaps add the date / time stamp in the file name.

When using a custom webrtc camera card, can I get it to show last event image from my camera when it is NOT streaming. So at idle it shows last event and then when I click play button it shows live stream?

Or if not how can I achieve this functionality please? basically want to show 6 cameras on one page (two columns of 3) and by default it shows the last event image, and then when clicked it either plays stream or perhaps even pops up a box showing the live stream and when popup closed the stream stops.

Thank you

Thank you so much! I will try it tonight.

Also, is there a way to save a copy of the Eufy event image?
I can see that the entity image.<eufycam_name>_event_image contains the image of last triggered event of the camera, but how do I save a copy of it into my /media folder?

I don’t know if its possible to extract a jpeg from an image.entity. If so it should be a feature built into home assistant

There was a pull request accepted last month in the dev version.

Its available in v2024.11

Yes, thank you!!

I updated HA to 2024.11.2.

The following automation works to “copy” the Eufy event image to my media folder (set up as persistent docker folder) whenever there’s a change in the Eufy event image:

alias: Eufy snapshot image
description: ""
triggers:
  - trigger: state
    entity_id:
      - image.eufycam_lr_event_image
    to: null
conditions: []
actions:
  - action: image.snapshot
    metadata: {}
    data:
      filename: /media/eufy_image_snapshot.jpg
    target:
      entity_id: image.eufycam_lr_event_image
mode: single

EDIT: add condition to make sure a true state change (not just attribute change) is detected.
See: https://github.com/fuatakgun/eufy_security?tab=readme-ov-file#alternative-trigger-condition

EDIT2:
Remove condition check. Add “to: null” in the trigger does the trick to make sure it triggers only on state change, not attribute changes.
See:
https://www.home-assistant.io/docs/automation/trigger/#state-trigger

Thanks again! It’s working for me.

In case it helps anyone, here’s my working hourly snapshot automation:

alias: Eufy rtsp stream snapshot
description: ""
mode: single
triggers:
  - minutes: "7"
    trigger: time_pattern
conditions: []
actions:
  - target:
      entity_id: camera.eufycam_lr
    data: {}
    action: eufy_security.start_rtsp_livestream
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
    enabled: true
  - variables:
      timeStamp: "{{ as_timestamp(now(), 0) | timestamp_custom(\"%Y-%m-%d-%H%M\") }}"
  - data:
      filename: /media/eufy-snapshots/eufycam_lr-{{ timeStamp }}.jpg
    target:
      entity_id: camera.eufycam_lr
    action: camera.snapshot
  - target:
      entity_id: camera.eufycam_lr
    data: {}
    action: eufy_security.stop_rtsp_livestream
  - data:
      cmd_options: >-
        -s -f /media/eufy-snapshots/eufycam_lr-{{ timeStamp }}.jpg
        /media/eufy-snapshots/eufycam_lr.jpg
    action: shell_command.ln_cmd

Note:

  1. I use rtsp stream. The p2p stream doesn’t work on my C120 T8400 camera.
  2. Some short delay is required after rtsp stream starts… I am using 5 seconds.
  3. I do a symbolic link at the end so that my local_file integration can access the latest snapshot.
1 Like

Try using Grid Card in the lovelace dashboard, then add a custom-webrtc card inside for each of your cameras, setting column to 2. The webrtc card should look like this:

type: custom:webrtc-camera
entity: camera.eufycam_lr
poster: image.eufycam_lr_event_image
ui: true
shortcuts:
  - name: Play
    icon: mdi:play
    service: camera.turn_on
    service_data:
      entity_id: camera.eufycam_lr
  - name: Stop
    icon: mdi:stop
    service: camera.turn_off
    service_data:
      entity_id: camera.eufycam_lr

See this for reference:
https://github.com/fuatakgun/eufy_security?tab=readme-ov-file#4-setting-up-your-dashboard-for-camera

I notice that encapsulating the webrtc card inside the Grid card forces it to update back to the event image when streaming is stopped.

1 Like

Hi, thank you, tried that and when clicking play icon it shows stream, but when I then click stop it still shows last stream image, it doesn’t go back to the event image?

Update: it went back eventually but after about 2 minutes

Yeah, the event image doesn’t come back immediately after streaming stops. Sometimes I have to do a refresh on the browser or my phone companion app.