Eufy Camera Integration

@bachya since this topic is exploding, can we somewhere follow your progress on all this? separate?
I’m waiting for yours before doing anything with eufy

4 Likes

ive managed to get the last stream showing in homeassistnat using ffmpeg - i havent seen it mentioned anywhere else so heres my code:

camera ffmpeg:
  - platform: ffmpeg
    input: "http://192.168.0.24:8082/eufy-security.0/**CAMERA_ID**/last_event/**CAMERA_ID**.m3u8"
    name: CCTV-01
3 Likes

With the Outdoor cameras and a base station there is an automations tab when you can make one camera or motion sensor trigger another camera to start recording. They show up as linked events in the Eufy app. Is there any method at the moment to do a remote trigger with Home Assistant? If there isn’t a way of doing this can one start a live stream and record that to storage somehow?

Yes, you can initiate it using integration. Your camera will start streaming over RTSP and you can use home assistant functionality to record it in your server.

I’ve got an issue in eufy-security-python-ws that I’m using to keep track of progress. Hopefully that’ll work.

Incidentally, coming along:

Just an FYI: I had a close family member share a scary diagnosis over the weekend; there will be days where working on this (as my day job allows) is a welcome relief, but other days, I’m not sure how much I’ll be able to focus. Appreciate everyone’s patience.

18 Likes

Family first, always. :pray:

9 Likes

Wow great.
Will follow it there…
As already said here.
Family business comes first !

2 Likes

I was able to set this up finally. Many thanks to the OP and to @bropat for the server wrapper
The ability to have some trigger set off streaming the camera to any arbitrary chromcast target is next level stuff IMO.
There does seem to be a transcoding lag of about 12 seconds. Will need to do some research to determine if it will be possible to reduce this

1 Like

Thank you for your efforts! One thing I’d like to request is the addition of the Eufy motion sensor. The one that I have is detected, but as a camera entity. I know it’s the sensor because it’s the only device that is located in that area. I’d really love to be able to use it for automations, because the Aeotec Multisensor 6 that I have has stopped detecting motion at all.

Thanks!

EDIT: I ended up getting it to work with the Eufy Home Assistant MQTT Bridge

1 Like

Hi all, I have improved half baked custom integration and added add-on support. Please take a look at README file to install everything flawlessly :slight_smile:

Big thanks to @bropat who made this possible. Please consider buying a coffee for him over here: https://ko-fi.com/bropat

4 Likes

when you used the previous integration, nothing was functional, right?

Nice work! Does this allow you to set the status from home to away and vice versa through HA?

Cameras only.

I was to much focused on setting up the live stream, i missed it, do you mind creating a github issue to track this?

I went through and uninstalled all Eufy Security related stuff and rebooted and did a fresh install, following your instructions. Everything installed correctly, as best I can tell, and everything (except the smart lock) was detected. Unfortunately, most everything is coming up unavailable. I’m restarting HA to see if that might help things. When restarting, the message about starting Eufy Security is up for a long, long time. Same goes for the “Wrapping up startup” message, now.

Reboot finally finished and I get “Not Loaded” for the Eufy Security integration in Configuration-Integrations. Hit reload and that message cleared.
Clicked on devices and I have:
T8210 - Doorbell - all entities available
T8510 - Smart lock - Wifi signal avail, battery not avail, motion and person detection obviously not avail
T8910 - Motion sensor - none of the entities are available (motion, battery, wifi)
T8410 - Indoor camera (x2) - motion available, wifi entity unavailable
T8114 - Outdoor camera (x2) - every entity available

Weird that it isn’t listing any camera entities. Only sensors and binary sensors. Kind of defeats the purpose.

1 Like

This might have something to do with it…

Logger: homeassistant.components.camera
Source: custom_components/eufy_security/camera.py:124
Integration: Camera (documentation, issues)
First occurred: 1:15:02 AM (2 occurrences)
Last logged: 1:27:22 AM

Error while setting up eufy_security platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/eufy_security/camera.py", line 76, in async_setup_entry
    _LOGGER.debug(f"{DOMAIN} - camera setup entries - {entities}")
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 803, in __repr__
    return f"<Entity {self.name}: {self.state}>"
  File "/config/custom_components/eufy_security/camera.py", line 124, in state
    self.entity["rtspStream"] == True
KeyError: 'rtspStream'

Logger: homeassistant.components.sensor
Source: custom_components/eufy_security/sensor.py:86
Integration: Sensor (documentation, issues)
First occurred: 1:15:02 AM (4 occurrences)
Last logged: 1:27:22 AM

Error adding entities for domain sensor with platform eufy_security
Error while setting up eufy_security platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 666, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state
    state = self.state
  File "/config/custom_components/eufy_security/sensor.py", line 86, in state
    return self.entity[self.key]
KeyError: 'battery'
Logger: homeassistant.components.binary_sensor
Source: custom_components/eufy_security/binary_sensor.py:77
Integration: Binary sensor (documentation, issues)
First occurred: 1:15:02 AM (6 occurrences)
Last logged: 1:27:23 AM

Error adding entities for domain binary_sensor with platform eufy_security
Error while setting up eufy_security platform for binary_sensor
eufy_security: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 666, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state
    state = self.state
  File "/config/custom_components/eufy_security/binary_sensor.py", line 77, in state
    return self.entity[self.key]
KeyError: 'personDetected'

This error originated from a custom integration.

Logger: custom_components.eufy_security
Source: custom_components/eufy_security/websocket.py:67
Integration: Eufy Security (documentation, issues)
First occurred: 1:15:01 AM (130 occurrences)
Last logged: 1:51:10 AM

eufy_security - Exception - process_messages : 'serialNumber' - traceback: Traceback (most recent call last): File "/config/custom_components/eufy_security/websocket.py", line 65, in process_messages await self.on_message(msg) File "/config/custom_components/eufy_security/websocket.py", line 81, in on_message await self.message_callback(message) File "/config/custom_components/eufy_security/coordinator.py", line 143, in on_message serial_number = message["serialNumber"] KeyError: 'serialNumber'
eufy_security - Exception - process_messages : 'personDetected' - traceback: Traceback (most recent call last): File "/config/custom_components/eufy_security/websocket.py", line 65, in process_messages await self.on_message(msg) File "/config/custom_components/eufy_security/websocket.py", line 81, in on_message await self.message_callback(message) File "/config/custom_components/eufy_security/coordinator.py", line 170, in on_message self.async_set_updated_data(self.data) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 287, in async_set_updated_data update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state state = self.state File "/config/custom_components/eufy_security/binary_sensor.py", line 77, in state return self.entity[self.key] KeyError: 'personDetected'
eufy_security - Exception - process_messages : 'motionDetected' - traceback: Traceback (most recent call last): File "/config/custom_components/eufy_security/websocket.py", line 65, in process_messages await self.on_message(msg) File "/config/custom_components/eufy_security/websocket.py", line 81, in on_message await self.message_callback(message) File "/config/custom_components/eufy_security/coordinator.py", line 170, in on_message self.async_set_updated_data(self.data) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 287, in async_set_updated_data update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state state = self._stringify_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state state = self.state File "/config/custom_components/eufy_security/binary_sensor.py", line 77, in state return self.entity[self.key] KeyError: 'motionDetected'

This will definitely help, i will take a look at them today. My main focus was cameras so far, it is time to expand the coverage. Can you create an issue on GitHub page?

1 Like

When I try to add the custom repository in HACS, I get the error:

Repository structure for main is not compliant

I’m using this URL with a category of Integration:

https://github.com/fuatakgun/eufy_security_addon

I’m using HA core-2021.7.3 and HACS v1.13.2

Any ideas?

Please follow screenshots, you are using add on url for integration page.

Issue created. Here

1 Like