Is anyone using ioBroker with their Eufy device?

Curious if anyone's gotten ioBroker.Eufy-Security to work on HE? I have managed to get ioBroker installed but installing iobroker.eufy-security is not going anywhere. I can't get it to to show up in my Adapters page.

For anyone who might be looking for info on this in the future. I followed the blog post on this site, it is more of a Home Assistant tutorial but the install instruction is the same. There was already an existing raspberry pi in my network so that was used to run ioBroker.

Before installing ioBroker, make sure your pi is up to date.

sudo apt-get update
sudo apt-get upgrade
sudo reboot

There are screenshots provided in the original link above but the ones below were not discussed in detail so these are here for reference.

REST API config screen

Web server config screen

From within RM or WebCoRE, you can hit the API URL to set the doorbell Guard Mode to:
[0:AWAY, 1:HOME, 2:SCHEDULE, 3:CUSTOM1, 4:CUSTOM2, 5:CUSTOM3, 47:GEO, 63:DISARMED]

http://IOBROKER_SERVER_IP:8087/set/eufy-security.0.CAMERA_SERIAL_NUMBER.station.guard_mode?value=GUARD_MODE_VALUE&ack=false

Example, set Guard Mode to Schedule:
http://192.169.1.200:8087/set/eufy-security.0.T8200N00000000.station.guard_mode?value=2&ack=false

Also got a little carried away and used a Pi-Hole driver, modified it to create my very first crude driver for this Eufy/ioBroker setup if you want to call it that. I'm still messing with the driver to see if correct Guard Mode can be incorporated text instead of on/off. I'll post that when if successful :slight_smile: :grin:

    /**
 *  Eufy2K Wired Doorbell
 *
 *  Copyright 2018 Nick Veenstra
 *  Convert to Hubitat by cuboy29
 *  Modified by eibyer original Pi-Hole driver and converted for use with Eufy Doorbell 2K
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */
metadata {
	definition (name: "Eufy Doorbell", namespace: "eibyer", author: "eibyer") {
		capability "Switch"
		capability "Refresh"
        
        command "poll"
        command "refresh"

		attribute "lastupdate", "string"
	}
   
    preferences {
	    section ("Settings") {
            input name: "deviceIP", type:"text", title:"ioBroker IP Address", required: true
            input name: "deviceSerialNumber", type: "text", title: "Eufy Device Serial Number", required: true      
         }
	}

}

private getPort() {
    return 8087
}

private getApiPath() { 
	"/get/eufy-security.0." 
}

private setApiPath() { 
	"/set/eufy-security.0." 
}


def installed() {
	log.debug "Installed with settings: ${settings}"
}

def uninstalled() {
	log.debug "uninstalled()"
}

def updated() {
	log.debug "Updated with settings: ${settings}"

	initialize()
}

def initialize() {
	
    // Do the initial poll
	poll()
	// Schedule it to run every minute
	runEvery5Minutes("poll")

}
def refresh() {
	poll()
}

def poll() {

	if (deviceIP == null) {
    	log.debug "IP address missing in preferences"
        return
    }
    def hosthex = convertIPtoHex(deviceIP).toUpperCase()
    def porthex = convertPortToHex(getPort()).toUpperCase()
    def path = getApiPath() + deviceSerialNumber + ".station.guard_mode"
    device.deviceNetworkId = "$hosthex:$porthex" 
  	def hostAddress = "$deviceIP:$port"
    def headers = [:] 
    headers.put("HOST", hostAddress)

    def hubAction = new hubitat.device.HubAction(
        method: "GET",
        path: path,
        headers: headers,
        null,
        [callback : parse] 
    )
    sendHubCommand(hubAction)
}

def parse(response) {
	
    log.debug "Parsing '${response}'"
    def json = response.json
	log.debug "Received '${json}'"
    if (json.val == 0) {
    	sendEvent(name: "switch", value: "on")
    }
	if (json.val == 1) {
    	sendEvent(name: "switch", value: "off")
    }
    
    sendEvent(name: 'lastupdate', value: lastUpdated(now()), unit: "")
   
}

def on() {
	doSwitch(0)
}

def off() {
	doSwitch(1)
}

def doSwitch(mode) {
	
    if (deviceIP == null) {
    	log.debug "IP address missing in preferences"
        return
    }
    def hosthex = convertIPtoHex(deviceIP).toUpperCase()
    def porthex = convertPortToHex(getPort()).toUpperCase()
 	def path = setApiPath() + deviceSerialNumber + ".station.guard_mode?value=" + mode
    device.deviceNetworkId = "$hosthex:$porthex" 
  	def hostAddress = "$deviceIP:$port"
    def headers = [:] 
    headers.put("HOST", hostAddress)

    log.debug path
    
    def hubAction = new hubitat.device.HubAction(
        method: "GET",
        path: path,
        headers: headers,
        null,
        [callback : parse] 
    )
    sendHubCommand(hubAction)
}

def lastUpdated(time) {
	def timeNow = now()
	def lastUpdate = ""
	if(location.timeZone == null) {
    	log.debug "Cannot set update time : location not defined in app"
    }
    else {
   		lastUpdate = new Date(timeNow).format("MMM dd yyyy HH:mm", location.timeZone)
    }
    return lastUpdate
}
private String convertIPtoHex(ipAddress) { 
    String hex = ipAddress.tokenize( '.' ).collect {  String.format( '%02x', it.toInteger() ) }.join()
    return hex

}

private String convertPortToHex(port) {
	String hexport = port.toString().format( '%04x', port.toInteger() )
    return hexport
}
1 Like

Thanks for sharing your Eufy driver! Can you share any improvements you have made?

I recently replaced all of my Arlo cameras with Eufy despite having a working Hubitat interface to the Arlo cameras using the pyaarlo library. Problems dealing with Arlo's new Cloudflare security motivated me to switch to Eufy.

I successfully installed ioBroker and @bropat's Eufy Security adapter and am eager to interface my new Eufy cameras to Hubitat. Your post and driver are a great start.

I started modifying the above driver but have not really finished it. I kinda got the functionality I was looking for which was to disable/enable guard mode on the doorbell from within webcore. If the cameras API calls are the same as the doorbell then I'm sure you'd be able to work it out.

As a test, I tried sending these URLs to the ioBroker, but each responded with "Not Implemented". Do you see anything wrong here? I verified my serial numbers for HomeBase and Eufy camera.

I would have expected to see a change in the HomeBase guard_mode and Eufy camera motion_detection values in ioBroker but saw no change.

Homebase SN: T8010P1320462210
Camera SN: T8142N63213121E5

HomeBase:

http://192.168.0.155:8087/set/eufy-security.0.T8010P1320462210.station.guard_mode?value=63&ack=false

Garage Camera:

http://192.168.0.155:8087/set/eufy-security.0.T8142N63213121E5.cameras.motion_detection?switch.enable=false&ack=false

This also resulted in "Not Implemented":

http://192.168.0.155:8087/set/eufy-security.0.T8010P1320462210.cameras.T8142N63213121E5.motion_detection?switch.enable=false&ack=false

I think found my problem...I did not have the RESTful adapter port set to 8087.

Also, I found that I could find the correct object name for the URL by opening the edit icon for each instance ID.

Good you got it figured out. Did it work for your cameras also?

Yep!! Using your code as a starting point , I plan to create two Hubitat devices: Eufy HomeBase and Eufy HomeBase Camera. Thanks!

1 Like

I completed both drivers with your code as a starting point, and I now can control both the HomeBase2, 2 cameras, and a doorbell reliably via Hubitat and ioBroker. Thanks @eibyer !!

Very nice, if you've made improvements to the crude driver I started with maybe you can post here for others who might be able to use it.

The Hubitat Eufy drivers for ioBroker are available here:

2 Likes

Hello,
I hope that you will be able to help me with this ioBroker and Eufy setup. I followed this instruction:

So in the end I have IoBroker running in the docker on my raspberry pi, have the eufy.security adapter + Simple RESTful API + WEB server.

I was able finally to make properly authentication so now in the eufy-security.0 instance I see all 3 my devices: Homebase, Dorberll and 2 x Cam 2 2k. Which looks promising. Now have two issues:

  1. In the logs of the IoBroker I see many connected and disconnected information for eufy-security.0:
    Source Time Debug message
    eufy-security.0
    2021-10-24 18:52:10.182 info Connected to station T8010Numbers on host Eufy_Base_Station_IP_Address and port 15264
    eufy-security.0
    2021-10-24 18:52:05.139 info Disconnected from station T8010Numbers
    eufy-security.0
    2021-10-24 18:51:59.205 info Connected to station T8010Numbers on host Eufy_Base_Station_IP_Address and port 27396
    eufy-security.0
    2021-10-24 18:51:54.149 info Disconnected from station T8010Numbers

Not sure if its normal. Any clue ?

The main problem is that I'm not able to reach the api anyhow to make any changes to the devices.

I tried:
http://admin:password@192.168.55.11:8087/set/eufy-security.0.T8010P2321053A27.station.guard_mode?value=1&ack=false

http://172.17.0.4:8081/set/eufy-security.0.T8010P2321053A27.station.guard_mode?value=2
http://192.168.55.11:8081/set/eufy-security.0.T8010P2321053A27.station.guard_mode?value=1
http://192.168.55.11:8081/set/eufy-security.0.T8010P2321053A27.station.guard_mode?value=1

but in the end nothing is changing and I'm getting:
Cannot GET /set/eufy-security.0.T8010P2321053A27.station.guard_mode

Nothing visible in the logs on iObroker/Eufy Security instance/adapter side. But if I make any changes from Eufy mobile app - I see the changes in the logs.

Moreover in the mentioned settings for Rest API config screen and Web server screen from the top of this thread I do not see option to set the Ip address form my local network. Instead of seeing there something like 192.168. I see 172.17.05 (why) ... I would expect to see there Ip address of my rapberry pi which starts with 192.168.x.x

IOBroker running on port:8081
rest simple api running on port:8087
Web server runnin on port:8082

moreover I created a rule on HE - but of course it does not work :frowning:

Any help is more than welcome.

Thank you,
Zbigniew

Update: First issue related to connected/disconnected messages fixed by updating adapter to newer version. Second problem still no clue why it does not work. It supposed to be working on 8087 default port. in my case:

http://IP_Address:8087/set/eufy-security.0.T8010Number.station.guard_mode?value=1
Message: Unable to connect
Firefox can’t establish a connection to the server at IP_Address:8087

When I go to Overview in IoBroker main manu (on the left) I see the box with Simple Rest API with correct IP address ....When I click on it it automaticaly tries to open:
http://IP_ADDRESS:8087/get/system.adapter.simple-api.0.uptime?prettyPrint
but it did not work - getting again:

Unable to connect

Firefox can’t establish a connection to the server at 1IP_Address:8087.

Something definitely not right. Even changing port to some not used by any application / container getting the same.

Can you post a screen cap of the simple api settings? I've not touched my setup since May so I'm retracing my stumbling steps :slight_smile:

Hi,
Screen below:

Thanks!

It looks like that I missed one thing from below installation link:

For the Docker image, we’ll be using https://github.com/buanet/docker-iobroker. This seems to be the “official” image and it works well enough for me. Here is my docker-compose:

  iobroker:
    image: buanet/iobroker:latest
    container_name: iobroker
    ports:
      - "8081:8081" # Main
      - "8082:8082" # Web Server
      - "8087:8087" # Rest API
    volumes:
      - /home/fuzzy/docker/iobroker:/opt/iobroker
    environment:
      - LANGUAGE="en_US:en"
    restart: always

So the question is .. how I can forward the missing ports:8082 & 8087 once I have iobroker installed and configured ... Will I need to start from scratch ... remove iobroker container and install it once again ?

Here is the current setup:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
952876e2eb0f buanet/iobroker "/bin/bash -c /opt/s…" 6 days ago Up 37 hours (healthy) 0.0.0.0:8081->8081/tcp, :::8081->8081/tcp iobroker

docker port 952876e2eb0f
8081/tcp -> 0.0.0.0:8081
8081/tcp -> :::8081

In the end I removed the container and installed once again using following command:
docker run -p 8081:8081 -p 8082:8082 -p 8087:8087 --restart=always --name iobroker -v iobrokerdata:/opt/iobroker buanet/iobroker:latest

Next configured missing adapters and looks like finally it is working :slight_smile:

1 Like

I created some Eufy drivers for HomeBase and HomeBase cameras based on initial work by @eibyer: https://github.com/scottmil/hubitat/tree/main/drivers.
I also use a simple ioBroker SearchEngine Blockly script to sent Maker API HTTP requests to control a mechanical chime when the adapter notifies ioBroker of doorbell ringing. Eliminates any need for wiring to my Eufy wireless doorbell, a nice feature for me.

My next project is to be able to control my new switchbot without a hub from HE or even just via webhook. Anyone done such a thing yet?

I finally got to tinkering with ioBroker and Switchbot BLE adapter. Installed the adapter from URL (expert mode). Configure the tries and intervals under Instances.

Control the bot press using the following webhook format.
http://iobroker_ip:8087/set/switchbot-ble.0.bot_mac_address.control.press?value=true&ack=false

The bot_mac_address can be found in the Switchbot app or from the ioBroker Objects tree,
image