Eufy Security Integration

There is an option to change the port to something else in add on settings page

Does anyone know what the issue is if when you press the camera card all you get is the heading and the gear icon, you donā€™t actually get the RTSP feed?

I have not played about with P2P etc, this is just out the box integration connected to the eufy security addon

If I use VLC to open the network stream rtsp://ipaddressofbasestation/live0 etc the RTSP feed works just fine.

just to add, if I use call service to stop the RTSP feed it kills off the VLC stream, so its definitely working a bit

There is something wrong with native streaming support of home assistant, i could not solve it. I suggest you to install and use webrtc integration following readme, it is much more reliable and faster. Because of this backup solution, i am not too much bothered to solve it.

i would give it a try with ios, it is working for some users.

Ok, so I have enabled ffmpeg in config
installed the simple RTSP server add-on
reconfigured the integration to use P2P

when I call the start p2p service I see this in the logs of the RTSP server, any idea?

2022/01/05 22:28:32 I [1/0] [RTSP] [session 207383214] is publishing to path ā€˜T8113N1320303178ā€™, 1 track with TCP
2022/01/05 22:28:42 I [0/0] [path T8113N1320303178] destroyed
2022/01/05 22:28:42 I [0/0] [RTSP] [conn 172.30.32.1:60820] closed
2022/01/05 22:28:42 I [0/0] [RTSP] [session 207383214] closed

So when you call start p2p service, you cameraā€™s streaming sensor should be true and you should see livestream in webrtc card.

Are you recommending that we also install the webrtc integration even if weā€™re not using P2P and only using RTSP?

I had the same issue, so I created a button for my cameras to start and stop the feed. It updates on a 5-10 second delay. I am not (yet) running the webrtc integration, but will check it out if thatā€™s the recommendation. I only have RTSP cameras.

Hereā€™s the yaml for one of my cameras, to the extent the button approach works for you:

square: false
columns: 1
cards:
  - type: picture-entity
    entity: camera.my_camera
    tap_action:
      action: more-info
  - type: button
    tap_action:
      action: call-service
      service: camera.turn_on
      service_data: {}
      target:
        entity_id: camera.my_camera
    entity: camera.my_camera
    show_name: false
    show_icon: true
    icon: mdi:play-pause
    icon_height: 40px
    hold_action:
      action: call-service
      service: camera.turn_off
      service_data: {}
      target:
        entity_id: camera.my_camera

Webrtc is required independent of streaming protocol, you should use it for RTSP or P2P

1 Like

Iā€™m a little confused by all the options and layers, can I see if I understand correctly please? Relating to Eufy 2C cameras.

Your integration speaks to the Eufy add-on, for states, sensors, configurable options

The add-on has nothing to do with video, RTSP etc, its purely entity states etc

Some cameras support RTSP and some do not? Those that do not support RTSP have to use a P2P streaming service? Which transcodes files? to RTSP?

Because the add-on has nothing to do with video, your integration will try and connect HA lovelace RTSP cards to the RTSP stream from the base station?

I dont really understand the role of the RSTP Simple Server here? is this only to do with transcoding the file P2P based cameras? and does not apply to the Eufy 2c?

Web RTC is there as a better way to pick up RTSP streams, really its not specific to your intergration at all, its just a good practice to pick up the RTSP stream from the base station?

Some cameras (2c?) do not automatically start streaming when the RTSP stream is opened, therefore we call the service to start the RTSP stream?

I guess my confusion lies in what specifically I am supposed to be doing for the 2c cameras? I dont think that P2P is relevant to me, can you confirm? I also dont think that the RTSP simple server is relevant? or is it, because something in HA is broken when speaking to the 2c RTSP stream? does it survive the fact that the 2c stops the stream?

In your docs, WebRTC is labelled as requiredā€¦ and your post above confirms this, this is to overcome a limitation in HA Lovelace? and its RTSP implementation?

The motion sensor only works if the camera and security state of the Eufy base station is set to send push notifications, so we have to receive push notifications to our phones via the Eufy app just to get the motion sensor to detect motion? Ofc I can mute Eufy, or sign outā€¦ and I have also seen another approach where motion could be detected by the changing of the thumbnail/snapshot image.

2 Likes

thanks for sharing this, your services are called camera.turn_on ā€¦ but I understood the service to be called eufy_security.start_p2p_livestream

I liked this summary, much better than mine :slight_smile:

  • Add-on communicates with devices over P2P (peer to peer - to send commands and receive responses, similar to mobile app) and integration communicates with add-on over web sockets.
  • Integration fetches current state of sensors from add-on.
  • Add-on is running similar to mobile app, receiving all notifications and updating its current state (motion sensor etc) and informing integration on these updates.
  • RTSP video streaming is very similar to other commands, integration sends a request to add-on to initiate RTSP streaming (if your camera is not streaming all the time - battery ones) and add-on sends a command to device and giving back to response to integration.
  • P2P video streaming relies heavily on add-on, integration sends a request to add-on to initiate P2P streaming and add-on receives all video chunks (bytes by bytes) and forwarding them to integration.
  • Integration glues back all incoming bytes and generates video using FFMPEG. When I first built the integration, I was publishing video as a file under home assistant, later on, came up with RTSP Server Add-on. I am using this add-on to publish video stream as RTSP stream, rather than file.
  • Independent of RTSP or P2P video streaming, HA native streaming is not working with Eufy Security integration and I do not know why :slight_smile: but webrtc is solving this issue and making it faster.

Let me know if you need more information.

1 Like

if camera supports RTSP, camera.turn_on will call eufy_security.start_rtsp_livestream otherwise it will call eufy_security.start_p2p_livestream. So, RTSP is superior to P2P and P2P is treated as fallback.

Hi! Quick question - is the binary motion sensor supposed to work with eufyCam 2C? I donā€™t seem to get any state changes.

And also, it seems that the ability to arm/disarm homebase through home assistant sometimes disappears. It usually works for a few days after uograding but then stops working. Is it also expected or should debug further?

You will only get state changes if your security profile is configured to send push notifications. The sensors rely on the push notifications.

2 Likes

Thanks.

I now have WebRTC working and this seems really good, PiP, speed etc and works just fine on IOSā€¦ all very nice.

If WebRTC is configured to use the base station RTSP stream, surely this completely bypasses Simple RTSP Server Add On? WebRTC is just listening to the base station stream?

Working great now, thanks! Hereā€™s my update card config. for anyone looking for a start/stop (press/long press) option.

type: grid
square: false
columns: 1
cards:
  - type: conditional
    conditions:
      - entity: binary_sensor.my_camera_streaming_sensor
        state: 'False'
    card:
      type: picture-entity
      entity: camera.my_camera
      tap_action:
        action: call-service
        service: camera.turn_on
        service_data: {}
        target:
          entity_id: camera.my_camera
  - type: conditional
    conditions:
      - entity: binary_sensor.my_camera_streaming_sensor
        state: 'True'
    card:
      type: custom:webrtc-camera
      entity: camera.my_camera
  - type: button
    tap_action:
      action: call-service
      service: camera.turn_on
      service_data: {}
      target:
        entity_id: camera.my_camera
    entity: camera.my_camera
    hold_action:
      action: call-service
      service: camera.turn_off
      service_data: {}
      target:
        entity_id: camera.my_camera
    icon: mdi:play-pause
    icon_height: 40px
    show_name: false
    show_state: false
3 Likes

nice :+1:
just imported this

Hello, Thanks for the great integration!

I have set it up and the streams works.
Only I have make some buttons to stop the streamā€¦ because the hold action doesnā€™t work, do you have any idea to get this working?