Eufy Camera Integration

Pasting the rest_command into a web browser works, but the behavior is the same as when I trigger from a button/switch.

HomeBase: the sensor updates and the mode changes (and all is reflected properly in the Eufy App). A win!

Indoor: HA sensor updates based on the value written into ioBroker but the camera’s mode does not actually change. It’s as if the ioBroker can’t talk to the Indoor 2k camera’s station.

EDIT: Disregard all this. Works fine for both Home Base and Indoor 2k cameras. It was a VLAN/ remote site issue.

I’ve got REST switches working half-way. What I mean is, they work great for the HomeBase but do not seem to work for the Indoor cams.

A functioning REST switch seem to require 3 parts:

  1. The sensor
  2. The rest_command
  3. The switch itself that draws from the sensor state and implements the rest_command

Sensor Sample:

sensor:
  - platform: rest
    name: Eufy Home Base Guard Mode
    resource: "http://IP:PORT/getPlainValue/eufy-security.0.T8010XXXXXXXXXXX.station.guard_mode"
    scan_interval: 10
    value_template: >-
      {% set v = value | replace('"', "")|int  %}
      {{ {0: "Away",
          1: "Home",
          2: "Schedule",
          3: "Custom1",
          4: "Custom2",
          5: "Custom3",
          47: "Geofence",
          63: "Disarmed"}[v] | default("Unknown state:" + (value|urlencode)) }}

rest_command Sample: (I’ve only set it up for Home and Disarmed, the two features I use most. But you could set up rest_commands for all the modes identified in the sensor above)

rest_command:
  eufy_home_base_guard_mode_home:
    url: "http://IP:PORT/set/eufy-security.0.T8010XXXXXXXXXXX.station.guard_mode?value=1&ack=false"
  eufy_home_base_guard_mode_disarmed:
    url: "http://IP:PORT/set/eufy-security.0.T8010XXXXXXXXXXX.station.guard_mode?value=63&ack=false"

Switch Sample:

switch:
  - platform: template
    switches:
      give_it_a_name_switch:
        friendly_name: "Give It A Name Switch"
        icon_template: hass:shield-home-outline
        value_template: "{{ is_state('sensor.eufy_d_home_base_guard_mode', 'Home') }}"
        turn_on:
          service: rest_command.eufy_home_base_guard_mode_home
        turn_off:
          service: rest_command.eufy_home_base_guard_mode_disarmed

EDIT: Regarding the rest_commands working on HomeBase but not on indoor cameras. I think it’s possibly (v. likely!) an I.D.-10-T (idiot) error on my part. I thought both devices were configured the same, but they’re not: the HomeBase is on the main network and the indoor cameras are on an isolated IoT VLAN. This is a remote site that is connected to my home network (where I’m running HA and all this stuff) via a site-to-site OpenVPN connection. My home network xxx.xxx.1.xxx can see the remote network xxx.xxx.2.xxx but cannot see the remote IoT VLAN xxx.xxx.40.xxx. So as I see it, there are two possible ways to fix this: 1. get physical access to the remote indoor cameras and change them over to the xxx.xxx.2.xxx network so they can be seen by Home Assistant. Or 2, spin up a ioBroker docker container on the xxx.xxx.2.xxx network that can “see” the IoT VLAN xxx.xxx.40.xxx network and be seen by my HA instance running on xxx.xxx.1.xxx. I’ve wasted a lot of air time here on the HomeBase vs. Indoor cameras (SORRY!!), and I think it’s probably a dum-dum user mistake. Will report back after implementing either 1 or 2. If I’m correct in my assumption that this is the issue, the rest_commands should be working great!

EDIT2: YEP. User error. Spun up a container on the 2.xxx network that can see the 40.xxx network, and I’m now able to change mode for the indoor cameras no problem. Just remapped my configuration.yml entries to the location of the 2.xxx container and good to go. Shoot, I’m sorry everyone for all the back and forth on the indoor cameras not working. They work fine using rest_commands.

made a quick gif of it working, take a look:

Indoor cam

shows off in the android app too actually, but the iobroker value doesnt update back to true when you turn it back on.

ha, and you solved it just as i was showing you it worked…

Glad you figured it out!

When you turn it back on where? In the app? If yes, there is unfortunately as far as I know no realtime notification via P2P or other interfaces, so the ioBroker adapter only recognizes the setting after it performs the “static” refresh (adjustable setting in the adapter; default: every 10 minutes).

@rama3124 I’ve added support for your camera along with support for mine. Very quick turn around from both the guys and you should see the update in supervisor. Grab this and your camera should work. :slight_smile:

1 Like

Thanks Chris, your help is much appreciated. I’m sick of getting notifications to my eufy app every time I step outside and plan to program an automation that only notifies me if no one’s home when the motion is detected

1 Like

Yep, turn back on in the app.

ah, good to know thats a well understood process.

No big deal, ideally ill never use the app again after i get this fully setup

huh, what codebase is chriscolden working on? I havent seen his name pop up before

Yep. All good. Thanks for pulling all that together!!

Hi, the sensors working realy well with the addon from Max.
What I don’t get is the point, HOW to get the live stream from the camera.
Any hint welcome.

Add support for T8140-Z & T8113-Z

1 Like

Ok, new blog is up. If anybody has suggested fixed for the eufy post, please make a PR: blog/index.md at main · FuzzyMistborn/blog · GitHub

6 Likes

Tutorial:

Some code snippets for those with IObroker all setup who want to control the enabled state of their cameras. This allows me to turn all the cameras off/on at once, or individually, and I can use the switches setup in automations.

the benefits of this for indoorcam users are many as you can change the state (either enabled, or any other state) en masse rather than individually doing it for each camera. In addition, this allows the ability to have cameras completely disabled as part of an automation, not just stop recording, but actually roll up the lens of pan/tilt and stop live streaming of any cam.

Imgur

Configuration.yaml

rest_command:

# Enable/Disable EufyCams

  eufy_entryway_disabled:
    url: "http://IOBROKER:8087/set/eufy-security.0.CAMERAID.cameras.CAMERAID.device_enabled?value=false"
  eufy_entryway_enabled:
    url: "http://IOBROKER:8087/set/eufy-security.0.CAMERAID.cameras.CAMERAID.device_enabled?value=true"

# Current camera enabled status

binary_sensor:
  - platform: rest
    name: Eufy Entryway Power
    resource: "http://IOBROKER:8087/getPlainValue/eufy-security.0.CAMERAID.cameras.CAMERAID.device_enabled"
    scan_interval: 10

# Switch for use in lovelace or automations
switch:
  - platform: template
    switches:
      eufy_entryway_power:
        friendly_name: "Eufycam Entryway Power"
        icon_template: hass:shield-home-outline
        value_template: "{{ is_state('binary_sensor.eufy_entryway_power', 'on') }}"
        turn_on:
          service: rest_command.eufy_entryway_enabled
        turn_off:
          service: rest_command.eufy_entryway_disabled

Groups.yaml

#Enables you to turn on or off all your cameras as configured above with one button

  cameras:
    entities:
      - switch.eufy_basement_power
      - switch.eufy_craftroom_power
      - switch.eufy_diningroom_power
      - switch.eufy_entryway_power
      - switch.eufy_frontbedroom_power
      - switch.eufy_kitchen_power
      - switch.eufy_laundryroom_power
      - switch.eufy_livingroom_power
2 Likes

Hi guys,
I’ve just installed my wireless door bell.

Regarding integrating it with HA would I be correct in saying
The eufy mqtt is push: good for receiving instant notifications
Iobroker is rest: good for changing settings?

Can you have both running? (or am I missing something)

This is correct. MQTT if you need speedy notifications and images (as a doorbell would), and iobroker for everything else.

2 Likes

I understand there’s a lot of information in this thread now, but it would be nice to have separate topics for the different ways of integrating Eufy that exists now. It’s super confusing for someone that starts to look into this now… :smiley:

Shouldn’t that first CAMERAID in your REST resource URLs actually be BASESTATIONID?

Hi,
regarding the MQTT broker
I’ve noticed a few times the entities doesn’t show the last image or motion ect, until I restart the add-on. has anyone else come across this issue?

each indoor cam has a built in base station, but thats not where it handles its enabled state. Other variable are in the station subsection like guard mode though.