Eufy Camera Integration

Yeah,I got Lovelace,what was the name of the card? I see picture,picture entity,picture glance?

Picture Entity

On Camera View field select -> live.

Ok,ill check.

Apologies its Picture Entity.

OMG,it works. Thank you very much Vin. I appreciate it. Now

Yeah,I figure it out. My pan and tilt is the one working,the other 2k is the one grayed out.
Well,after getting the Pan and Tilt working,Continous is now available on the other.

Both the Pan and Tilt and the Fixed 2k are working now. I love it. Thanks again,much appreciated.

I’m obvious not doing something right, I have the component installed in HACS and restarted but when I search for eufy on the confurations->integration tab no sign of it. Can someone point out my obvious mistake here?

Ok got it now it just took sometime to show up

Some parts of eufys P2P protocol have been reverse-engineered and now its possible to actually control most parts of the cameras/homebase locally ( change guard-mode, turning cameras on/off and changing settings )

Also its possible to manually bind to Google Cloud Messaging to get the actual notifications (motion/doorbell trigger etc) which are also used by the app.

Check out:


I currently have a small test setup running which casts the RTSP stream of the battery doorbell (through synology surveillance-station) to my android-tv when someone rings the doorbell and besides some minor issues it seems to work pretty well.

Guess with all the work already done on the HA integration it will not take too much time to implement some of it.

3 Likes

Nice find! So how did you get it set up?

Which part? Most has been figured out by decompiling the app and wireshark… Jan Loebel ( the owner of that repo ) had already worked out the basics of the P2P-protocol and with some additional debugging through wireshark and using multiple cams it can now handle the actual commands to control the cameras over the local network.

To enable RTSP for the battery doorbell I decompiled the app and found that support was there yet hidden ( perhaps because there are some issues that i dont know about )… I altered the app, compiled and signed and can now enable RTSP for the doorbell as I can for the other cameras.

For handling notifications you can bind to GCM and you will receive the push notifications directly.

See:

To integrate P2P you should take a look at:

A slightly altered version of my test setup which demonstrates the basic use:

import { HttpService } from './http/http.service';
import { CommandTypes } from './p2p/command.model';
import { DeviceClientService } from './p2p/device-client.service';
import { LocalLookupService } from './p2p/local-lookup.service';
import { PushMessage } from './push/push.model';
import { PushService } from './push/push.service';

(async () => {
  const httpService = new HttpService(USERNAME, PASSWORD);
  const hubs = await httpService.listHubs();

  if (hubs && hubs.length > 0) {
    const hub = hubs[0];
    const lookupService = new LocalLookupService();
    const address = await lookupService.lookup(HOMEBASE_IP);

    const service = new DeviceClientService(address, hub.p2p_did, hub.member.action_user_id);
    const connected = await service.connect().catch((error) => {
      console.log('error trying to connected:', error);
      return false;
    });

    if (connected) {
      console.log('p2p connected, start listening for push messages');

      const pushService = new PushService();
      const credentials = await pushService.createPushCredentials();

      pushService.listen(credentials, async (msg: PushMessage) => {
        const event = msg.data;
        const payload = event.payload;
        if (payload && payload.event_type === 3103 && payload.channel === 2 && payload.push_count === 1) {
          console.log('doorbell pressed');

          if (!streaming) {
            service.sendCommandWithIntString(CommandTypes.CMD_NAS_TEST, 1, 2);
            streaming = true;

            setTimeout(() => {
              if (streaming) {
                service.sendCommandWithIntString(CommandTypes.CMD_NAS_TEST, 0, 2);
              }
              streaming = false;
            }, 6000);
          }
          await got.get('url_to_a_webhook');
        }
      });

      // Register generated token

      const fcmToken = credentials.fcm.token;

      await httpService.registerPushToken(fcmToken);
      await httpService.pushTokenCheck();
    }
  } else {
    console.warn('no hub found');
  }
})();

Some additional information:
The device channel (2 in my case) is the channel received from the api for a specific camera.

CMD_NAS_TEST is the command used by the app to manually start the RTSP-stream for testing purposes. Starting the stream using the API was unreliable for me, as in that it did start the RTMP-stream, but did not start the RTSP stream, but this does.

To turn cameras on/off:

Turn camera 0 on
service.sendCommandWithIntString(CommandTypes.CMD_DEVS_SWITCH, 0, 0);

Turn camera 2 off
service.sendCommandWithIntString(CommandTypes.CMD_DEVS_SWITCH, 1, 2);

As you can see sometimes things work slightly different then you would expect (0=on/1=off) so its best to use a decompiled app as a reference.

Would the 2K wired version be similar to configure? There’s been a lot of mixed messaging with regards to the hardware capabilities between the wired and battery versions.

As in the wired doorbell? of course it has some differences as it does not use the homebase but technically they seem to work pretty similar when going through the app…

Anything in specific?

I think you should take most messages about these devices with a grain of salt as a lot of people just don’t understand how they actually work ( which is mostly thanks to eufy and their closed up eco-system ).

I have the integration running under a second eufy account and 2 x eufy 2c and a doorbell all detected. But when I add them to a picture entity card I don’t get any images. I’ve not switched on rtsp as I’m just interested in the last motion image at present. Is there anything I am missing getting the last image into lovelace?

I have the wired 2k doorbell with a second account using the eufy integration and the last motion image works for me:

aspect_ratio: 0%
camera_image: camera.doorbell
entities: []
title: Doorbell
type: picture-glance
tap_action:
  action: more-info

Fuzz, would this apply to the floodlight cam?
oof, Please excuse my ignorance and direct question. From what I have seen is you are following this CLOSE and as i need a little hand-holding you seemed the one for me to follow.

I have HA setup but really only gets the updates when motion is found. Also, it seems like something beyond my grasp of comprehension is not working as this integration spams my logs with errors (example below).

Also, I do have Syn Surveillance station but could not figure out how to add this camera…

Any help with this in NOOB format would be appreciated.

Logger: eufy_security.camera
Source: /usr/local/lib/python3.8/site-packages/eufy_security/camera.py:58
First occurred: 9:10:44 AM (1632 occurrences)
Last logged: 11:04:55 AM

* Unable to process parameter "1249", value "120"
* Unable to process parameter "1131", value "1"
* Unable to process parameter "1045", value "0"
* Unable to process parameter "99904", value "0"
* Unable to process parameter "1400", value "0"

Whats the name of the HACS integration to install?

Edit: Forget that. Found it. It’s the custom repository mentioned earlier.

Is there a readme on how to configure this for viewing the stream with the HACS integration? I can get the clips of the last movement, but I’m trying to bring this camera into HomeKit without using the built in HomeKit integration as the app has way more AI and features than HomeKit alone.