Eufy Camera Integration

Haha you can say that again.

For me, I don’t have a lot of HA experience in the first place, so there are a few hurdles I need to jump to even figure out how to implement any of these solutions. That’s why the guide was helpful. Digging through this thread, I wanted to try out MQTT and had no idea that you had to have both a broker and a publisher. I know better now, but again, that’s what I mean by multiple hurdles. HA is great, but almost too featured in some ways.

Next thing to play with is Node-RED (another reason why I wanted to play around with MQTT)

Eventually I might be able to go doorbell->Hue lights flashing red->Google Home starts playing the Star Trek battle song. Haha

Let us know if you figure it out with node-red! My (wireless) doorbell is also unable to get any livestream. Oddly enough, the m3u8 path works fine in VLC when the stream has started.

Oh I’m still an absolute novice so far. But if I figure it out, I’ll let you know. Right now I’m actually working on a 3D floor plan and hooking up my Philip’s Hue lights to it.

Hey @MaxW, did something recently happen with your github repo? A few days ago I posted I couldn’t get your MQTT bridge addon to install via the Supervisor/Addon store. The reason was after adding the repo, nothing showed up. Today, all of your addons showed up. I know I have restarted HA multiple times since then, so not sure why it’s now working.

Maybe this means I can stop my manually launched Docker containers and use the addons instead. Yay!

All, wanted to let everyone know whos been looking to automate turning off/on their EufyCams based off Homeassistant triggers, thats this is finally working via @bropat and @fuzzymistborn s hard work.

the state variable eufy-security.0.CAMERAID.cameras.CAMERAID.device_enabled from eufy_security_client, which is exposed to home assistant through the iobroker integration works perfectly to turn the camera off from automation events.

Turning the camera off disables both live streaming, and recording.

To get this setup, follow fuzzy’s excellent guide for getting iobroker up and linked to HA

then in your config.yaml add the rest_command as follows.

rest_command:

# Enable/Disable EufyCams

  eufy_CAMERAID_disabled:
    url: "http://IOBROKERIP:8087/set/eufy-security.0.CAMERAID.cameras.CAMERAID.device_enabled?value=false"
  eufy_CAMERAID_enabled:
    url: "http://IOBROKERIP:8087/set/eufy-security.0.CAMERAID.cameras.CAMERAID.device_enabled?value=true"

Then trigger this by whatever automation means you like.

I’m curious whether changing the Guard Mode via an ioBroker rest_command will work on indoor 2k cameras?

I have the sensors, rest_commands, and switches all set up (thanks to everyone here!) and they’re working great on the HomeBase 2 (near “instantaneous” with the 10 second polling). But the same setup framework does not appear to work for the indoor cameras (despite showing both ‘cameras’ and ‘station’ objects in ioBroker).

When I trigger the rest_command via the switch template for the indoor camera the new value is written to ioBroker and the change shows up in my HA sensor, but it doesn’t seem to have any actual affect on my camera (the security mode doesn’t actually change from Home to Disarmed).

I assume it’s either a limitation of the indoor cameras or it requires a different setup/syntax from what I’m using for the HomeBase.

Thank you in advance if anyone has suggestions (or can confirm that it doesn’t work and I should just move on).

Ive been noticing this one pretty heavily lately, i switch an iobroker setting (device_enabled) specifically, but it doesnt update the toggle in the eufy app under camera settings for a long time, if at all.

It works, the camera is definitely disabled, but the app doesnt reflect the state right.

Not a problem, just a point of awareness for folks checking the app to verify if actions went through.

hey, thats solely what im doing it on, 2k indoor cams. They have a station attribute tree in iobroker, so in function they kind of have their own little station built into each camera that addresses the mode rather than a global one.

Thats one of the annoying thing about the stock implementation in the eufy app. You want to switch to away manually? you have to go through every single cam and switch the mode. I have 10 cams.

See my post right before this one about the app not updating. I bet the mode is actually changing, but you’re not seeing the update in the app.

Perhaps, but the HomeBase stations update “immediately” when using an identical setup. I wonder what’s causing the difference in response (and awareness in the Eufy App itself) between the HomeBase station and the indoor station. I’m thinking about it like I think you are: the camera’s own station should be able to control the mode the same as the HomeBase.

I totally agree with you - would be great to set up a group switch/automation to set all cameras (or a defined group of cameras) at once with a single switch (HomeBase cameras and every-single-indoor-camera). Or an automation that sets all indoor cams to “Disarmed” when you arrive home.

To your knowledge, is there a “better” P2P Connection Type setting to use in ioBroker? My options are Prefer location connection, Only local connection, or Quickest Connection. I’m currently on Prefer local connection.

As noted, REST is a tad slow, but for turning cameras on and off thats no biggie. It sounds like someone is trying to get iobroker fully integrated with HA via MQTT, which would be awesome (and eliminate then need for the bridge, and having notifications on on your app all the time).

I know @bropat doesnt have any indoor 2k cameras to test on to the best of my knowledge, so this may be a quirk specifically with those. Im 110% available to give him guest access to mine if it helps in any way.

That would be great!
I’ve poked around a little with MQTT using the Eufy Home Assistant MQTT Bridge (that I added via Max W.'s add-on repository) as well as the MQTT ioBroker integration.

I’ve been able to pull down states from both MQTT clients and am finding the Bridge works well for the Latest image visuals.

I can’t seem to push anything back through, though, when setting up a MQTT switch instead of a rest_command. Maybe I need to try the “use different topics for set and get” per comment #428.

I’m chipping away at the MQTT info. just need to figure out a template platform for the switch. I can set the mode of an indoor camera and have it reflect in my sensors and the Eufy App.

Here’s the basis of my code.

  1. ioBroker MQTT instance: MQTT SETTINGS tab, check “Use different topic names for set and get”
    The documentation shows that you need to add /set to the end of your command_topic line.

  2. Switch for a “Home” to “Disarm” now looks like this:

switch:
  - platform: mqtt
    name: give it a name
    unique_id: give_it_an_id
    state_topic: "iobroker/eufy-security/0/T84XXXXXXXXXXXXX/station/guard_mode"
    command_topic: "iobroker/eufy-security/0/T84XXXXXXXXXXXXX/station/guard_mode/set"
    payload_on: "1"
    payload_off: "63"
    state_on: "1"
    state_off: "63"

If Anyone has some ideas on how to set the template depending on the current state of the mode it would be super helpful. My switch above only seems to go one way (from Home to Disarm). And while the mode changes both in my sensors and the Eufy App, this switch still presents as “On” and clicking it again doesn’t re-set the mode back to Home - it’s state is always “on” / “1”, so any toggle is always “Disarm”/“63”

@fuzzymistborn’s guide above might help. He has a template switch using REST commands, but I think those could be modified to MQTT. Here’s his toggle switch, which sounds like what you’re looking for:

  - platform: template
    switches:
	  eufy_doorbell:
        friendly_name: "Front Door - Guard Mode"
        icon_template: mdi:doorbell-video
        value_template: "{{ is_state('sensor.eufy_doorbell_guard_mode', 'Home') }}"
        turn_on:
          service: rest_command.eufy_doorbell_home
        turn_off:
          service: rest_command.eufy_doorbell_disarmed

I also found this:

https://www.home-assistant.io/integrations/switch.mqtt/ that MaxW posted back in December. Might help.

Well, I’ve narrowed it down to a couple of things to work through:

  1. It’s possibly a timing issue. The switch does work as intended but it’s not receiving the updated state from MQTT fast enough and so resets itself as “on.” If I push the Button/Switch to change the mode, and then quickly press the reload button for MQTT in ioBroker, both the sensor and the button/switch reflect the new and correct state.

  2. I’m getting a double tap. When I press the button/switch off (which sets the mode to Disarm), it’s sending “63” twice (per a debug flow in Node-Red). After reloading MQTT (to reflect the correct state), when I press the switch back on (which sets the mode to Home), it sends “1” twice. So I’m not sure what’s happening here with that.

Given the state_topic element within MQTT, I’m not sure there’s any actual benefit to a template for naming inside a switch, as the state will be defined from the topic and I can then set those values to mean either “on” or “off.”

Since I am templating my MQTT sensor (so that 1 will translate to Home), I’m getting the same result, for example, when I use either:

state_topic: "iobroker/eufy-security/0/T84XXXXXXXXXXXXX/station/guard_mode"

or

value_template: "{{ is_state('sensor.eufy_my_cool_room_guard_mode_mqtt', 'Home') }}"

Interestingly, the RESTful sensors and commands seem to be updating ok (and quickly) when I trigger from the MQTT switch (although the rest_command won’t actually change the guard mode of the camera (even though it will reflect the state as set by the MQTT switch)).

I feel like I’m so close and maybe just missing something obvious.

You can force the app to refresh by performing a pull down in the devices view. After that you should see the correct settings under the settings of the respective device.

Thanks :slight_smile:
That is correct. If something does not work simply report, then I try to fix it.

The Eufy app refreshes fine. It’s the HA MQTT sensors that don’t refresh without reloading the MQTT instance in ioBroker. I let it run 25 min and no refresh, so I manually reloaded in ioBroker.

As far as something else not working: rest_commands do not update the indoor cameras ( but work just fine on the HomeBase)

Thank you for all your work on this!
:slight_smile:

Have you activated the option “Send states (ack=true) too” in the MQTT instance under “MQTT Settings”?

The first step to connect via P2P is to request via this protocol which IP addresses the station/device has. You will always get an answer in double pack, private IP address from local network and public IP address. The setting “P2P Connection Type” causes the following:

  • Prefer local: Prefers the local IP address to establish the effective connection in the next step. Only if this fails it tries a connection over the public IP address.
  • Only local: The connection is only established with a local IP address, if this fails, no P2P connection is established.
  • Quickest: The connection request is sent to both IP addresses at the same time, the first to respond will be accepted.

well, nothing chanced on my side. But happy to know it works for you :slight_smile:

1 Like