[New Binding] Eufy Doorbell

I have chosen the US as the region and I will try again with the 2.5.1 recompile you have posted.

Dear basriram,
thanks for working on the add-on.

Iā€™m trying to incororate the hombase2 and the eufyCam 2C camera.

In the code Iā€™ve found the REST endpoint:

public static final String PRIMARY_URL = "https://mysecurity.eufylife.com/api/v1";

Iā€™ve done some tests with Postman and at least for the european api the endpoint is slightly different. Instead api it is called apieu

https://mysecurity.eufylife.com/apieu/v1/app/get_devs_list

Can you give me some insights how youā€™ve structured the add-on so that I can try to add the two additional device types.

Best regards
becksen.

Except for the door bell all other eufy devices seem to only use the p2p connection but I have not completed the p2p implementation. I have deciphered the protocol so I can share it with you so you can try your luck. I will also provide a high level design so you can tweak the endpoints.

1 Like

Iā€˜d appreciate that.

Iā€™m little struggling with the git repository. I can clone your project. But checkout and establishing a new branch is failing.

Thanks.

Hi,

Is this binding still being developed?
I am trying to add a T8210 (battery powered version of the T8200) but i get the following error:

2020-04-15 19:55:28.264 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to ā€˜ssl://security-mqtt-eu.eufylife.comā€™. Next attempt in 60000ms

2020-04-15 19:55:28.266 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: Lost MQTT connectivity, need to handle re-connect

2020-04-15 19:55:28.281 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to ā€˜ssl://security-mqtt-eu.eufylife.comā€™ with clientid android_EufySecurity_xxxxxxxxxxxxxxxxxxxxxxxxxxx_192.168.X.X

2020-04-15 19:55:28.285 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: Lost MQTT connectivity, need to handle re-connect

Eufy has recently revamped their entire architecture to make it more secure and I have not had the time to reverse engineer their new app. Please feel free to fork and make changes as needed.

Unfortunately i donā€™t have skills or time to learn the skills to make changes.
Thanks anyway.

Does the camera works offline? can i use it with the binding and block the internet connection of the camera?

Currently there is no way to access the device via openHAB. Maybe it might not happen ever again. Anker has updated the API for security reasons. Since then no one has managed to reverse-engineer it. I guess they will focus on HomeKit and Alexa/Google for now.

1 Like

How must I set up the bridge? I added the jar in the addons dir, but where I must add my account data?

is it possible to rotate the image ? so that i can mount the doorbell horizontal ?

Hi there,
Is this binding working? ā€˜Cuz Iā€™m looking to buy the doorbell, but wont be useful when I cant connect it to openhabā€¦:wink:

Unfortunately Eufy changed their doorbell firmware to remove mqtt notification and this binding cannot function without that so it will not work.

For those interested, the way I find to interact with the new api is to setup this docker

that creates a webscocket server
and then use this client to receive alerts and send command to the camera HUB (eufycam 2c in my case)

Now i try to find a way to update openhabā€™s item when the client receive an event, and send a command
I think i will use the openhab REST API to update the item, but iā€™m not sur how to send command once the websocket client is connected.

Aymeric

Finally, I use this docker to connect to the Eufy API

With Nodered to create the link between the websocket above and openhab.

Works fine so far. Letā€™s see if its stable

(I already have my alarm connected to openhab. The goal was to activate/deactive the camera movement detection depending on my alarm system, and to receive the alerts in openhab to trigger my alarm)

This is fantastic, any luck getting it to show camera live on openhab?

Surprisingly, it is very stable. It never failed for 2 weeks now.
The pushed notification have almost no delay.

It donā€™t use the livestream, and didnā€™t test it.

However i use the PictureURL property wich is a link to jpeg on an amazon cloud file, and it works fine (itā€™s the picture you see on the android app, taken when the last event was triggered).

It works so well I ordered to new cameras to complete my setup.

Below youā€™ll find the 2 docker-compose for both eufy-webservice and nodered, and the nodered flow.
The nodered flow receives commands from MQTT and sends event via MQTT also.

Two hints: you need to create a secondary eufy account for the websocket docker, and the correct format for the payload is {ā€œcommandā€: ā€œstart_listeningā€, ā€œmessageIdā€: ā€œstart_listeningā€}

################################################################################
# Node-RED Stack or Compose
################################################################################
# docker stack deploy node-red --compose-file docker-compose-node-red.yml
# docker-compose -f docker-compose-node-red.yml -p myNoderedProject up
################################################################################
version: "3.7"

services:
  node-red:
    image: nodered/node-red:latest
    environment:
      - TZ=Europe/Paris
    ports:
      - "1880:1880"
    volumes:
      - ./data:/data
    restart: always

services:
  eufy-security-ws:
    image: bropat/eufy-security-ws:latest
    environment:
      - TZ=Europe/Paris
      - USERNAME=eufyaccount
      - PASSWORD=eufypassword!
    ports:
      - "3300:3000"
    volumes:
      - /root/eufy/data:/data
    restart: always

NodeRed Flow

[{"id":"cd2b76ff.67e048","type":"tab","label":"EUFY","disabled":false,"info":""},{"id":"1b8c84a6.252b2b","type":"debug","z":"cd2b76ff.67e048","name":"DEBUG","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":640,"y":300,"wires":[]},{"id":"90e18b5.e3ae378","type":"websocket in","z":"cd2b76ff.67e048","name":"","server":"","client":"5a1f1b78.b358e4","x":360,"y":280,"wires":[["1b8c84a6.252b2b","dbfb2bd.8d2ba58"]]},{"id":"cde7f6c2.85aeb8","type":"websocket out","z":"cd2b76ff.67e048","name":"","server":"","client":"5a1f1b78.b358e4","x":370,"y":200,"wires":[]},{"id":"bca3980.2d2b8e8","type":"inject","z":"cd2b76ff.67e048","name":"Start_Listening","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"30","topic":"","payload":"{\"command\": \"start_listening\", \"messageId\": \"start_listening\"}","payloadType":"str","x":120,"y":120,"wires":[["cde7f6c2.85aeb8"]]},{"id":"2560c7a9.4dc948","type":"inject","z":"cd2b76ff.67e048","name":"Mode 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\": \"station.set_guard_mode\", \"messageId\": \"set_guard_mode\", \"serialNumber\": \"T8010N2321061E81\",\"mode\":1 }","payloadType":"str","x":90,"y":200,"wires":[["cde7f6c2.85aeb8"]]},{"id":"99a9e07f.5d9608","type":"inject","z":"cd2b76ff.67e048","name":"Mode 63","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\": \"station.set_guard_mode\", \"messageId\": \"set_guard_mode\", \"serialNumber\": \"T8010N2321061E81\",\"mode\":63 }","payloadType":"str","x":100,"y":280,"wires":[["cde7f6c2.85aeb8"]]},{"id":"dbfb2bd.8d2ba58","type":"mqtt out","z":"cd2b76ff.67e048","name":"","topic":"EUFY/event","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"82d6b3db.6d576","x":650,"y":340,"wires":[]},{"id":"a42a0c32.be177","type":"mqtt in","z":"cd2b76ff.67e048","name":"","topic":"EUFY/command","qos":"2","datatype":"auto","broker":"82d6b3db.6d576","nl":false,"rap":true,"rh":0,"x":100,"y":380,"wires":[["cde7f6c2.85aeb8","15a2f24f.aa630e"]]},{"id":"15a2f24f.aa630e","type":"debug","z":"cd2b76ff.67e048","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":300,"y":480,"wires":[]},{"id":"5a1f1b78.b358e4","type":"websocket-client","z":"cd2b76ff.67e048","path":"ws://192.168.1.204:3300","tls":"","wholemsg":"false"},{"id":"82d6b3db.6d576","type":"mqtt-broker","name":"MQTT","broker":"192.168.1.220","port":"1883","clientid":"NodeRed","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

and some except from my openhab rules

Change the Secrity mode of the Eufy Base
           val actionsBroker = getActions("mqtt","mqtt:broker:MQTT_Broker") 
            actionsBroker.publishMQTT( "EUFY/command", "{\"command\": \"station.set_guard_mode\", \"messageId\": \"set_guard_mode\", \"serialNumber\": \"T8010N232xxxxxx\",\"mode\":1 }")

EUFY MQTT Things

Thing mqtt:topic:EUFY "EUFY" (mqtt:broker:MQTT_Broker) {
    Channels:
        Type string : EUFY_event  [stateTopic="EUFY/event"]
}

and ITEMS

String EUFY_Event "EUFY Event"   {channel="mqtt:topic:EUFY:EUFY_event"}
1 Like

@aymeric106 thanks for posting a workable solution. Does this solution enable the eufy doorbell / camera to work without the cloud / internet. In other words, does the docker connect to the eufy cloud or directly to the camera/doorbell?

Interested to know as well!

This sounds fantastic!
What is now the way to make this an official binding?