HomeKit control of Ecovacs N79S with Homebridge

Followed some advice on Reddit to get my robot vacuum setup with HomeKit in iOS, via Homebridge. My Deebot N79S is now working via:

Your Home app (on various Apple devices) communicates with Homebridge running on your RPi.
MnrGreg’s exe’s communicate with the Ecovacs service on the web, and your Deebot device on your behalf.

iOS device, Home app > RPi (DietPi), Homebridge, CmdSwitch2, and deebot app > Deebot vacuum

My config.json looks like this:

        "mdns": {
                "interface": ""
        "bridge": {
                "name": "Homebridge",
                "username": "B8:27:EB:32:2F:3F",
                "port": 35565,
                "pin": "031-13-295"

        "description": "Homebridge for Ecovacs automation.",
        "platforms": [{
                "platform": "cmdSwitch2",
                "name": "CMD Switch",
                "switches": [{
                        "name": "Vacuum",
                        "on_cmd": "/var/lib/homebridge/deebot clean-auto",
                        "off_cmd": "/var/lib/homebridge/deebot charge",
                        "state_cmd": "/var/lib/homebridge/deebot status 2>&1 | grep RUNNING",
                        "manufacturer": "Ecovacs",
                        "model": "Deebot N79S",
                        "serial": "E000P8U2318710222040",
                        "timeout": 20
        "accessories": []

Some challenges:

Once you have Homebridge working on demand (from CLI) you can setup a service on your RPi to run Homebridge automatically on boot. This ensures Homebridge is “always on”. Follow the steps at the bottom of my previous writeup here to get Homebridge to startup automatically at boot. [https://dietpi.com/forum/t/tutorial-homebridge-for-nest/2027/1]

As you’re working with the homebridge user you create when setting up the service, you may need to use

su - homebridge


usermod -d /var/lib/homebridge

to configure a HOME dir for the Homebridge system user. On boot Homebridge will run as the homebridge system user, and will run any CmdSwitch2 commands as the same user.

As a result of setting up Homebridge to run as a service, pretty much all of your configurations need to be housed together in /var/lib/homebridge/config.json, except the deebot app’s config at /usr/local/etc/deebot.json.

root@DietPi:~# ls -la /var/lib/homebridge/
total 5704
drwxrwxrwx  5 root       root          4096 Nov 12 00:44 .
drwxr-xr-x 23 root       root          4096 Dec 30  2018 ..
drwxrwxrwx  2 homebridge homebridge    4096 Jul  8  2018 accessories
-rw-------  1 homebridge homebridge      56 Nov 12 00:27 .bash_history
drwxr-xr-x  2 homebridge homebridge    4096 Nov 11 22:44 .config
-rwxrwxrwx  1 root       root           645 Nov 12 00:28 config.json
-rwxr-xr-x  1 root       root       5860281 Nov 12 00:25 deebot
drwxrwxrwx  2 root       root          4096 Nov 11 21:51 persist

I used https://www.md5hashgenerator.com to generate the hashes in /usr/local/etc/deebot.json. You need a hash of your Ecovacs account password, and a random hash for use as the device ID value.

pip3 wasn’t working? Had to reinstall;

sudo apt-get remove python3-pip; sudo apt-get install python3-pip

RPi was connected to a wired network separate from the wireless network. Almost everything important (HomeKit devices, Home Hub, etc.) is on wireless.

Had to enable wireless on the RPi, but then configure Homebridge to use wireless instead of the wired network interface.
Add the mdns entry to the Homebridge config.json:

    "mdns": { "interface": "" },  // set the device's appropriate IP address here
    "bridge": {
        "name": "...",
        "username": "...",
        "port": ...,
        "pin": "..."
    "description": "....",
    "accessories": [
    "platforms": [

as well as following the steps here to manually edit /usr/lib/node_modules/homebridge/node_modules/bonjour-hap/lib/Service.js in order to set the wireless IP address of the RPi: https://github.com/nfarina/homebridge/issues/2098

Ultimately, you should be able to use an iOS app like Discover to locate the Homebridge device.