[New Binding] Eufy Doorbell

Based on some reverse engineering I have created a binding for the Eufy Doorbell. Since most of the Eufy security devices use the same protocols (REST, P2P and MQTT), it should be possible to add the other devices fairly easily.

Here is an alpha release of the binding -
https://github.com/basriram/openhab2-addons/releases/download/2.5.0/org.openhab.binding.eufysecurity-2.5.1-SNAPSHOT.jar
along with the source

Once you install the binding, you need to manually setup the Bridge using an email account that is already registered with eufy security mobile app. The binding should be able to auto discover the doorbell as long as the doorbell is already registered in the mobile app.

At this time the binding will trigger the doorbell ring, motion detected switches as well as provide the image captured by the door bell during those events. Commands such as turning off motion detection, chime etc., are not implemented yet.

3 Likes

I’ve installed this, but I’m not sure what I’ve done wrong. The button and motion triggers seem to come through, but no image is displayed, and the timestamps are wrong. Do you have documentation on how to configure this binding?

Can you turn on debug log and share the output? There is a delay between when the event is triggered and when the image file is available on AWS. I have hard coded the delay as 10 sec but it may be too short.

What’s interesting is I can open the image url in a browser and see the image… the timestamps are also bizarre…

When I added a doorbell pushed image to Habpanel, its not recognizing it as an image, it just prints the base64 characters in the container.

Using an image widget and using the direct url (eufylife url) to a preview image from the log displays the image correctly… attempting to use a channel just shows a broken image icon

2020-01-26 18:05:43.659 [temChannelLinkRemovedEvent] - Link 'eufysecurity_T8200_REDACTED_image => eufysecurity:T8200:REDACTED:image' has been removed.

2020-01-26 18:05:43.671 [temChannelLinkRemovedEvent] - Link 'eufysecurity_T8200_REDACTED_doorbellImage => eufysecurity:T8200:REDACTED:doorbellImage' has been removed.

2020-01-26 18:05:43.673 [temChannelLinkRemovedEvent] - Link 'eufysecurity_T8200_REDACTED_motionHistoryImage => eufysecurity:T8200:REDACTED:motionHistoryImage' has been removed.

2020-01-26 18:05:43.674 [temChannelLinkRemovedEvent] - Link 'eufysecurity_T8200_REDACTED_imageTimestamp => eufysecurity:T8200:REDACTED:imageTimestamp' has been removed.

2020-01-26 18:05:43.678 [temChannelLinkRemovedEvent] - Link 'eufysecurity_T8200_REDACTED_motionTimestamp => eufysecurity:T8200:REDACTED:motionTimestamp' has been removed.

2020-01-26 18:06:20.559 [DEBUG] [.internal.EufySecurityHandlerFactory] - Register discovery service for Eufy Security devices and stations by bridge '653fa2cc'

2020-01-26 18:06:20.604 [hingStatusInfoChangedEvent] - 'eufysecurity:bridge:653fa2cc' changed from UNINITIALIZED to INITIALIZING

2020-01-26 18:06:20.642 [hingStatusInfoChangedEvent] - 'eufysecurity:T8200:REDACTED' changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)

2020-01-26 18:06:20.646 [DEBUG] [y.internal.api.EufySecurityWebClient] - json signin {"transaction":"REDACTED","email":"REDACTED","password":"REDACTED"}

2020-01-26 18:06:24.739 [DEBUG] [y.internal.api.EufySecurityWebClient] - Response received HttpContentResponse[HTTP/1.1 200 OK - 480 bytes]

2020-01-26 18:06:24.752 [DEBUG] [nternal.api.model.EufySecuritySystem] - Obtained Account Information org.openhab.binding.eufysecurity.internal.api.model.AccountInfo@13dec92

2020-01-26 18:06:24.755 [DEBUG] [ty.handler.EufySecurityBridgeHandler] - Eufy Security System connected successfully

2020-01-26 18:06:24.771 [hingStatusInfoChangedEvent] - 'eufysecurity:bridge:653fa2cc' changed from INITIALIZING to ONLINE

2020-01-26 18:06:24.779 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Client ID is android_EufySecurity_REDACTED_192.168.1.16

2020-01-26 18:06:24.812 [hingStatusInfoChangedEvent] - 'eufysecurity:T8200:REDACTED' changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING

2020-01-26 18:06:27.875 [DEBUG] [.internal.api.EufySecurityMqttClient] - starting profile connection...

2020-01-26 18:06:27.966 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: Lost MQTT connectivity, need to handle re-connect

2020-01-26 18:06:29.210 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'security-mqtt.eufylife.com' with clientid android_EufySecurity_REDACTED_192.168.1.16

2020-01-26 18:06:29.809 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: Lost MQTT connectivity, need to handle re-connect

2020-01-26 18:06:29.911 [hingStatusInfoChangedEvent] - 'eufysecurity:T8200:REDACTED' changed from INITIALIZING to ONLINE

2020-01-26 18:06:29.917 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.919 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellHistoryIndex of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.919 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellHistoryTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.921 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motion of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.921 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionImage of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.921 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.922 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionHistoryIndex of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.922 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: NOT IMPELMENTED YET

2020-01-26 18:06:29.922 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionHistoryTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.924 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionHistoryImage of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.926 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:image of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.926 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:imageTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.919 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellHistoryImage of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.918 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellImage of thing eufysecurity:T8200:REDACTED

2020-01-26 18:06:29.929 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: NOT IMPELMENTED YET

2020-01-26 18:06:29.939 [vent.ItemStateChangedEvent] - eufysecurity_T8200_REDACTED_motion changed from NULL to OFF

2020-01-26 18:07:45.437 [DEBUG] [.handler.EufySecurityDoorbellHandler] - got MQTT message for topic /phone/doorbell/REDACTED/push_message

2020-01-26 18:07:45.679 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Handler: Update MOTION channels for thing eufysecurity:T8200:REDACTED

2020-01-26 18:07:45.695 [vent.ItemStateChangedEvent] - eufysecurity_T8200_REDACTED_motionTimestamp changed from NULL to +52040-03-04T09:11:20.000+0000

2020-01-26 18:07:45.697 [vent.ItemStateChangedEvent] - eufysecurity_T8200_REDACTED_motion changed from OFF to ON

2020-01-26 18:07:46.117 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Successfully parsed msgType: NOTIFY_EVENT_FACE_DETECTION_VALUE

    picUrl: "https://security-app.eufylife.com/v1/s/g/REDACTED"

2020-01-26 18:07:55.679 [DEBUG] [nternal.api.model.EufySecuritySystem] - invoking thread to download picurls for event 

2020-01-26 18:07:55.682 [DEBUG] [y.internal.api.EufySecurityWebClient] - Downloading image using url=https://security-app.eufylife.com/v1/s/g/REDACTED

2020-01-26 18:07:57.184 [vent.ItemStateChangedEvent] - eufysecurity_T8200_REDACTED_motionImage changed from NULL to raw type (binary/octet-stream): 30710 bytes

2020-01-26 18:08:00.687 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Update channel 'motion' to OFF for thing eufysecurity:T8200:REDACTED

2020-01-26 18:08:00.698 [vent.ItemStateChangedEvent] - eufysecurity_T8200_REDACTED_motion changed from ON to OFF

2020-01-26 18:10:42.527 [DEBUG] [.internal.api.EufySecurityMqttClient] - stopping device mqtt connection... 

2020-01-26 18:10:42.573 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Canceling motion off job

2020-01-26 18:10:42.646 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.651 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellImage of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.653 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: NOT IMPELMENTED YET

2020-01-26 18:10:42.656 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellHistoryIndex of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.660 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellHistoryTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.669 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motion of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.670 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:doorbellHistoryImage of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.673 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.677 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionImage of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.679 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: NOT IMPELMENTED YET

2020-01-26 18:10:42.681 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionHistoryIndex of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.684 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionHistoryTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.687 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:motionHistoryImage of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.691 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:image of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.693 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Got command REFRESH for channel eufysecurity:T8200:REDACTED:imageTimestamp of thing eufysecurity:T8200:REDACTED

2020-01-26 18:10:42.702 [me.event.ThingUpdatedEvent] - Thing 'eufysecurity:T8200:REDACTED' has been updated.

2020-01-26 18:10:42.727 [vent.ItemStateChangedEvent] - eufysecurity_T8200_REDACTED_motion changed from NULL to OFF

2020-01-26 18:10:45.719 [DEBUG] [.internal.api.EufySecurityMqttClient] - starting profile connection...

2020-01-26 18:10:45.722 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: Lost MQTT connectivity, need to handle re-connect

2020-01-26 18:10:45.734 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'security-mqtt.eufylife.com' with clientid android_EufySecurity_REDACTED_192.168.1.16

2020-01-26 18:10:46.149 [WARN ] [.handler.EufySecurityDoorbellHandler] - TODO: Lost MQTT connectivity, need to handle re-connect

2020-01-26 18:12:28.108 [DEBUG] [.handler.EufySecurityDoorbellHandler] - got MQTT message for topic /phone/doorbell/REDACTED/push_message

2020-01-26 18:12:28.113 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Handler: Update DOORBELL channels for thing eufysecurity:T8200:REDACTED

2020-01-26 18:12:28.130 [vent.ItemStateChangedEvent] - eufysecurity_T8200_REDACTED_doorbellTimestamp changed from NULL to +52040-03-07T15:43:01.000+0000

2020-01-26 18:12:28.139 [vent.ChannelTriggeredEvent] - eufysecurity:T8200:REDACTED:doorbell triggered PRESSED

2020-01-26 18:12:28.147 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Successfully parsed msgType: NOTIFY_EVENT_PRESS_DOORBELL_VALUE

    picUrl: "https://security-app.eufylife.com/v1/s/g/REDACTED"

2020-01-26 18:12:38.112 [DEBUG] [nternal.api.model.EufySecuritySystem] - invoking thread to download picurls for event 

2020-01-26 18:12:38.120 [DEBUG] [y.internal.api.EufySecurityWebClient] - Downloading image using url=https://security-app.eufylife.com/v1/s/g/REDACTED

2020-01-26 18:12:39.463 [vent.ItemStateChangedEvent] - eufysecurity_T8200_REDACTED_doorbellImage changed from NULL to raw type (binary/octet-stream): 28335 bytes

2020-01-26 18:12:58.132 [DEBUG] [.handler.EufySecurityDoorbellHandler] - Update channel 'doorbell' to OFF for thing eufysecurity:T8200:REDACTED

2020-01-26 18:12:58.140 [vent.ChannelTriggeredEvent] - eufysecurity:T8200:REDACTED:doorbell triggered RELEASED

Fixed the timestamp and image preview issue. Here is the new jar file

https://github.com/basriram/openhab2-addons/releases/download/2.5.2/org.openhab.binding.eufysecurity-2.5.2-SNAPSHOT.jar

I have added another property (Image_URL) that stores the raw URL from the doorbell. Please delete the existing thing/items and uninstall the old binding before installing the new one and see if it fixes your issue.

2020-01-26 23:07:55.656 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.eufysecurity-2.5.2-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.eufysecurity [257]
  Unresolved requirement: Import-Package: com.fasterxml.jackson.core.util

	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[org.eclipse.osgi-3.12.100.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.4]
2020-01-26 23:08:19.744 [DEBUG] [core.karaf.internal.FeatureInstaller] - Running scheduled sync job

I was able to get it to load by manually placing the jars from the maven repo in the addons folder. The imageurl property is working perfectly now, and is faster than my cellphone! Thak you very much for this effort, I can’t wait to see what else you can do with it.

I was in the middle of getting the p2p client to work, just disabled it for now. Can you re-download the jar file and install the Jackson bundle manually as well -
feature:install openhab.tp-jackson

This is amazing work!
Any chance you can do a binding for the Axis A8105E video doorbell?

Unfortunately I do not have that doorbell and it will be hard without it

Is it expected for the P2P client in this binding to attempt several requests a second, even if the refresh rate for the camera’s Thing is set to null?

The p2p code is not ready yet so in the latest version of the jar file I have disabled it. Use that for now.

I am using 2.5.2 currently, and it seems to be still trying to open sessions with the camera several times a second

Here is the new link
https://github.com/basriram/openhab2-addons/releases/download/2.5.3/org.openhab.binding.eufysecurity-2.5.3-SNAPSHOT.jar

I have added a flag in the bridge configuration to enable or disable p2p communication and to configure the local ip address of the openhab server. This is only needed if you enabled p2p communication flag.

I removed the old things and binding, added the 2.5.3 version. When I try to add the security bridge, it throws the error:

2020-02-09 17:00:03.952 [WARN ] [ore.thing.internal.ThingRegistryImpl] - Cannot create thing. No binding found that supports creating a thing of type ‘eufysecurity:bridge’.

And confirmed the new version is loaded

openhab> bundle:list|grep -i euf
273 x Active x 80 x 2.5.3.SNAPSHOT x org.openhab.binding.eufysecurity

I also cleared the OH cache from command line and the issue persists.

It is working for me. Can you share some logs after restarting the bundle to see if there are any errors during startup?

Not the full binding functionality, but you can just have the Axis make a HTTP GET request to an item in OpenHAB to trigger something when pressed. Not familiar with the doorbell specifically, but their camera’s have this ability on events. So you can define an event for motion detection and use the doorbell button as a trigger to make web calls to separate OpenHAB items via the legacy (unsupported and bad practice from RESTful standards) endpoint: http://localhost:8080/classicui/CMD?<itemname>=<command> .

So you’d make an item like Trigger_DoorbellPressed and make the doorbell do a call to http://openhab:8080/classicui/CMD?Trigger_DoorbellPressed=ON

Note that this CMD? endpoint could go unsupported and the REST API is the preferred method, but I don’t think you can do a HTTP GET to set an item in the REST API and I don’t think the Axis stuff with do a PUT

See this guide section 2.3 for setting up the HTTP event action

and this post for more information on the CMD? endpoint

I am trying out this binding 2.5.3 and I cannot get the bridge to initialize. Could it possibly be that I am in Canada and the region choices are only US and EU?

I could never get the bridge for this version to initialize either

I have done a clean re-compile, can you try this version and see if it is able to initialize.

https://github.com/basriram/openhab2-addons/releases/download/2.5.1/org.openhab.binding.eufysecurity-2.5.1-SNAPSHOT.jar

I did not see any references to Canada servers in their app so I am assuming they point to their US MQTT Servers so can you pick US as the region and see if it works?