Home Assistant integration to manage Eufy Security devices as cameras, home base stations, doorbells, motion and contact sensors.
Home Assistant integration to manage Eufy Security devices as cameras, home base stations, doorbells, motion and contact sensors.
Please check the new implementation, this repository will not be updated any further.
https://github.com/mega-yfue/ha-eufy-sdk-addon
https://github.com/mega-yfue/ha-eufy-sdk
Welcome to Alpha release of Eufy Security Integration for Home Assistant. Congratulations on being a brave heart and trying this version.
eufy-security-ws using eufy-security-client to imitate mobile app and web portal functionalities and wrapped eufy-security-ws as hassio-eufy-security-ws so we can use it as Home Assistant Add-on.event duration in seconds long.Please check here: https://github.com/bropat/eufy-security-client#known-working-devices
In upcoming steps, you are going to install at least one add-on and two integrations.
In Home Assistant eco-system, if you are using Supervised or HASS OS based setup, you can use Add-ons page of Home Assistant to install these. If you are running Core or you don't have Add-ons option in your setup, you need to install the docker and run these containers yourself. You will see respective commands in respective steps. If you are interested in composing of your docker container, please check the end section
This integration is not part of Home Assistant Core so you have to install this as a custom integration. There are two ways of doing this, either manually downloading and copying files or using HACS (Home Assistant Community Store). I will be using HACS method here.
If you are intending to use this integration for video streaming purposes and if your camera does not support RTSP (Real Time Streaming Protocol) based streaming (no option of continuous or NAS recording in your camera settings), you also need to install webrtc custom integration which would include go2rtc binary (go2rtc also exists as standalone add-on). This add-on will enable us to convert peer to peer (P2P) bytes into a RTSP stream so you can play it nicely inside Home Assistant (with or without RTC) or with VLC Player.
If you are intending to use this integration for video streaming purposes and if your camera supports RTSP, you will probably enjoy reliable stream because generating RTSP stream is responsibility of hardware and it is very much reliable than P2P based streaming. There is no need to convert incoming P2P bytes into RTSP stream. There are some modified version of Android apk of Eufy Security out there which could enable RTSP stream for unsupported devices but I have not tried it. Moreover, I do not own personally a P2P required device, that is because, many times, I cannot replicate your issues locally and we need to work together to debug these issues.
Lastly, your camera would not start streaming magically by itself, you have to call turn_on or turn_off services of respective camera entities. So, when you first install everything, you would not have any video until you call these functions. Moreover, P2P streaming might stop randomly because of low level technical issues, you can restart it again with turn_off and turn_on. You can trigger your automation's on camera states (idle, preparing, streaming).
So, let's start.
Please follow the guideline from here: https://github.com/bropat/hassio-eufy-security-ws
This is a must for P2P streaming and nice to have for RTSP streaming. P2P streaming will use go2rtc to generate stream with a specific RTSP address. RTSP streaming will use this for faster streaming.
There are two ways of doing this, either installing add-on itself or installing Webrtc custom integration. I suggest you to install Webrtc custom integration, which includes go2rtc and respective front-end card for faster streaming.
Installing go2rtc with or without webrtc can be done following this link: https://github.com/fuatakgun/WebRTC . If you prefer to have a dedicadated go2rtc setup (not bundled with webrtc integration), you need to first install over here: https://github.com/AlexxIT/go2rtc
1- If you have not already installed, install HACS following this guide: https://hacs.xyz/docs/use/download/download/
2- When HACS is ready, search for Eufy Security inside HACS Integrations.
3- Install Eufy Security integration through HACS, restart your Home Assistant instance.
4- Navigate to Settings -> Devices & Services page of Home Assistant(https://your-instance.duckdns.org/config/integrations). Click on Add Integration and search for Eufy Security (not Eufy, it is Eufy Security exactly). If you do not see it, first validate that it is installed via HACS and you had restarted it, later try with another browser. Integrations list might be already cached in your browser.
5- Put Eufy Security Add-on IP Address (127.0.0.1 for Supervised installation) and configured port (default 3000) and click Submit.
6- You might receive Captcha or Multi Factor Authentications (MFA) warnings, please Reconfigure the integration. Captcha code will be visible on Reconfigure page and MFA Code will be emailed or texted to you. Please enter these values. After this, you might need to restart your Home Assistant instance.
7- If you have installed webrtc custom integration with go2rtc or standalone go2rtc Add-On, please put its IP Address into Integration Configuration page. You can put 127.0.0.1 for Supervised installation.
8- You can also configure Cloud Scan Interval, Video Analyze Duration, Custom Name 1, Custom Name 2 and Custom Name 3
Note: Custom Name 1, Custom Name 2, and Custom Name 3 are labels used to represent the first, second, and third custom guards (modes) you've created in the Eufy Security app. You can trigger your custom guards using the built-in alarm panel card like so:
arm_custom_bypass -> triggers your first custom guard defined in Eufy security app (ordered by 'created date')
arm_night -> trigger second custom guard
arm_vacation -> trigger third custom guard
For example, you create a "bedtime" mode in Eufy Security app, by default there would be no way to trigger that using the alarm panel card. However, using this integration, you can call the arm_custom_bypass service from the alarm panel, which will enable your "bedtime" mode. You can adjust the display name of this mode using Step 8 above.
These built-in alarm panel services do not correspond with any default Eufy guards, so they are re-purposed to allow further flexibility to trigger custom security modes using this integration. See discussion in #145 for more details.
9- Enable diagnostic entities that are disabled by default. After installation, some entities are disabled to avoid generating too large amounts of data. This is expected behavior. If you think any entity is important, just enable it. To do this select one of the device in eufy_security integrations. Then scroll down to Diagnostic section and select one of entity. In top go to settings and turn on Enabled and Visible parameters in settings. After around 30 seconds this entity will be available.
Native Home Assistant streaming is fairly slow (maybe not?), so you are highly advised to install WebRTC integration from HACS.
Below code will show camera picture while camera is not streaming and webrtc card while camera is streaming (conditional cards). Please replace camera.entrance with your camera entity name.
type: custom:webrtc-camera
entity: camera.entrance
poster: image.entrance_event_image
ui: true
shortcuts:
- name: Play
icon: mdi:play
service: camera.turn_on
service_data:
entity_id: camera.entrance
- name: Stop
icon: mdi:stop
service: camera.turn_off
service_data:
entity_id: camera.entrance
If your camera supports pan and tilt, you can add respective commands to webrtc interface.
type: custom:webrtc-camera
entity: camera.garden
ptz:
service: eufy_security.ptz
data_left:
entity_id: camera.garden
direction: LEFT
data_right:
entity_id: camera.garden
direction: RIGHT
data_up:
entity_id: camera.garden
direction: UP
data_down:
entity_id: camera
No open issues yet, or sync has not completed.