Homebridge/Siri on Synology

Why?

For my Roomba&Homeautomation project I wanted to have an integration with Siri ("Hey Siri, turn Roomba on!"). This is easier than I thought first, since there's already a project that does all the work: Homebridge

So, this thing has to run somewhere. A common thing is to run it on a Raspberry Pi, but I didn't want to have another component that is always running around. But one thing that's already running all the time is my Synology NAS.

How?

I already had some experience with installing stuff on the NAS via IPKG, but that was only "nice"... and not "GREAT!". It always felt a little odd to use that, and some packages (libavahi) that are especially needed for homebridge are not available via ipkg.

After looking around I found the solution: "Debian Chroot" from SynoCommunity. Just add it as a source to the vanilla synology packet manager, and install the package. After it's installed, start it up and wait.... for a long time... During the first startup the complete environment is installed, but when that's done you're having a completly usable&separate debian on your NAS :D

To get into the chroot, do a

sudo /var/packages/debian-chroot/scripts/start-stop-status chroot

I'm not sure if I was stupid at the first try, but I had some problems with the shipped NPM+NodeJS versions, so I decided to build that myself (which takes on my synology quite some time as well....):

  • apt-get install build-essential
  • fetching the sources from nodejs.org (I used 4.4.4)
  • unpacking
  • configure
  • make install

Install some other needed packages with

apt-get install libavahi-compat-libdnssd-dev git

You have to make sure that dbus&avahi daemons are running (or else you will get strange unknown errors during homebridge startup): "/etc/init.d/dbus start" & "/etc/init.d/avahi-daemon start"

Now you're ready to install homebridge:

npm install -g homebridge

Now you can configure homebridge, add some plugins for the stuff you want to control via it and start it up!

Beside the Roomba, I can now also turn on my PC and the living room lights via Siri... yay!

Next?

Currently I haven't made it reboot safe, so after rebooting the NAS I have to restart dbus+avahi manually and start homebridge in a screen session... But I'll change that later... maybe ;)

And probably I should add something for "Hey Siri, Tea, Earl Gray, Hot"?