Eufy Security Integration

Hi, I have the following automation to automatically show a popup using browser_mod when motion detected on my camera

  1. Do I need a separate automation for each camera or can I somehow modify this one to cover multiple different camera motion events and show relevant image?

  2. What is best way to also have a notification sound play when popup shows?

alias: test popup
description: ""
triggers:
  - type: motion
    device_id: 0247f6b9c76de5db7d1559fec3da3a9b
    entity_id: c617ac5f69c23b6771f1f4c527f4eb17
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - type: turn_on
    device_id: e4ef52da3baef7f3d0be8b94be803617
    entity_id: 6a0076cd561d6246a77f9364905d0914
    domain: switch
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
    enabled: true
  - data:
      dismissable: true
      autoclose: false
      title: Driveway
      size: wide
      timeout: 30000
      browser_id:
        - 1a3d407c6fa5e82aa02cfd9eb382563b
        - b5391f694055808e3e064d99a6a70c13
        - 285041b6465149c70fead06db19e1c22
        - 4f6708ecd791f66b6a490d8e42e34f5e
      content:
        type: picture-entity
        entity: image.driveway_event_image
    enabled: true
    action: browser_mod.popup
mode: single

  1. You can have multiple cameras under the “triggers” if they all have the same/similar actions. (BTW, in the UI, I find it easier to choose the trigger on the entity rather than device.)
  2. Not sure what you mean by notification sound - do you mean to have the browser on your PC/tablet/phone play a sound?
  1. Thanks. All of them would be same trigger e.g. motion and then showing the relevant event_image from that camera. But I mean motion from camera 1 and show event_image from camera 1, or if motion is from camera 2 then show event_image from camera 2 and so on for about 4 cameras

  2. Yes, sorry should have been clearer - I have an Samsung Tab A9+ on the wall and when the above alert triggers and shows popup I want to make a notification sound or similar on the Android tablet

Below code works for me… at least for one Eufy camera I have tested (camera name below is “eufycam_lr”).

You can add other camera motion detection entity_id’s to the triggers section and the “regex” command in the template should replace “motion_detected” with “event_image” to get to the respective camera’s event_image entity.

For notification sound, I just added a “play_media” action, targeted to the browser ID identified by the browser_mod. (Note that the sound file is local to where I am running homeassistant, which is a raspberry pi, not the device where the browser is).

Not sure if this is the cleanest way, but hope it works for you.

alias: Eufy Security motion/person notifies phone + browser popup + sound
description: ""
triggers:
  - entity_id:
      - binary_sensor.eufycam_lr_motion_detected
      - binary_sensor.eufycam_lr_person_detected
    to: "on"
    trigger: state
conditions: []
actions:
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - metadata: {}
    data:
      title: "{{ device_attr(trigger.entity_id, 'name') }} -  Motion/Person detected!"
      message: >-
        by {{ trigger.to_state.object_id }} at {{
        as_local(trigger.to_state.last_changed) }}
      data:
        ttl: 0
        priority: high
        image: >-
          /api/image_proxy/image.{{ trigger.to_state.object_id |
          regex_replace(find='motion_detected|person_detected',
          replace='event_image', ignorecase=False) }}
    action: notify.mobile_app_sm_g973u1
  - action: browser_mod.popup
    metadata: {}
    data:
      dismissable: true
      content:
        type: picture-entity
        entity: >-
          image.{{ trigger.to_state.object_id |
          regex_replace(find='motion_detected|person_detected',
          replace='event_image', ignorecase=False) }}
      size: wide
      timeout: 10000
  - action: media_player.play_media
    metadata:
      title: Nudge.ogg
      thumbnail: null
      media_class: music
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: app
          media_content_id: media-source://media_source
    data:
      media_content_type: audio/ogg
      media_content_id: media-source://media_source/local/Nudge.ogg
    target:
      entity_id: media_player.xxxxxxxx_xxxxxxxx
mode: single
1 Like

Hi, I have the code below which uses a picture entity to show last event image from my camera and then when tapped it shows image larger.

This works fine but pops up on all devices, how can I get it to only show pop up large image on the device I tapped it on? Is that possible?

show_state: true
show_name: false
camera_view: auto
type: picture-entity
entity: image.driveway_event_image
name: Driveway
tap_action:
  action: perform-action
  perform_action: browser_mod.popup
  target: {}
  data:
    dismissable: true
    content:
      type: picture-entity
      entity: image.driveway_event_image
    size: wide
    autoclose: false
    timeout: 20000
    title: Driveway

Not an expert on browser_mod but it looks like you can encapsulate the browser_mod action with fire-dom-event action (link to doc) - like this:

tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.popup
    target: {}
    data:
      dismissable: true
      content:
        type: picture-entity
        entity: image.driveway_event_image
      size: wide
      autoclose: false
      timeout: 20000
      title: Driveway

(The lines from “target” onwards are the same from your original code but indented by 2 spaces.)

The effect is that the action will act on the current browser.

1 Like

That works perfectly, thank you so much for your help, I really appreciate it

I can’t manage to stream to solocam s220, is it possible? the other integration works just fine