Hi,
As promised, you’ll find below instructions about how to install HomeBridge/Vera on a Synology NAS using Docker.
In order to follow this tutorial, you’ll need to activate SSH (see Control Panel → “Terminal & SNMP” menu → “Terminal” tab → “Enable SSH service” checkbox) and to install Docker (from the Synology Package Center).
1 - SSH to the SYNO and create a “homebridge” folder somewhere in /volume1/docker/
ssh root@<SYNO_IP> -p <PORT>
- Creation of the mandatory folders *
- Docker folder should have been created by the Docker package, but just in case here are the commands to create it :
mkdir -p /volume1/docker/
chown root:root /volume1/docker
mkdir -p /volume1/docker/<your_username>/homebridge
2 - Create a file named “dockerfile”
cd /volume1/docker/<your_username>/homebridge
vi dockerfile
**** Basic commands to know in Vi ****
i : getting into Edition mode
ESC : getting out of Edition mode
When you’re out of edition mode :
dd : delete a line
ZZ : save the file with your modifications and get out of Vi
:q! : get out of Vi without saving the file
(French speaking people, you’ll find attached a memento about Vi commands).
Copy / Paste this content into the file :
[code]#########################################
DOCKERFILE POUR HOMEBRIDGE VERA
DOCKERFILE FOR HOMEBRIDGE VERA
#########################################
FROM debian:jessie
MAINTAINER tahitibub <tahitibub * gmail * com>
USER root
VARIABLES D’ENVIRONNEMENT
ENVIRONMENT VARIABLES
ENV DEBIAN_FRONTEND noninteractive
DEPOTS, MISES A JOUR & INSTALLATION DE LIBAVAHI
DEPOSITS, UPDATE and INSTALL OF LIBAVAHI
RUN \
apt-get update && \
apt-get install -y apt-utils nano &&
sed -i “s/exit 101/exit 0/” /usr/sbin/policy-rc.d && \
apt-get install -y
curl
wget
git
apt-transport-https
python
build-essential
make
g++
libavahi-compat-libdnssd-dev
libkrb5-dev
vim
net-tools
INSTALLATION DE NODE.JS
NODE.JS INSTALLATION
RUN \
curl -sLf -o /dev/null ‘https://deb.nodesource.com/node_0.12/dists/vivid/Release’ &&
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - &&
echo ‘deb Index of /node_0.12/ vivid main’ > /etc/apt/sources.list.d/nodesource.list &&
echo ‘deb-src Index of /node_0.12/ vivid main’ >> /etc/apt/sources.list.d/nodesource.list &&
apt-get update &&
apt-get install -y nodejs
INSTALLATION DE HOMEBRIDGE
HOMEBRIDGE INSTALLATION
#(LE PLUGIN VERA NECESSITE HOMEBRIDGE 0.2.13)
#(VERA PLUGIN NEEDS HOMEBRIDGE V0.2.13)
RUN
npm install -g homebridge@0.2.13 &&
npm install -g homebridge-vera
FINALISATION
FINALIZATION
USER root
(CORRECTION DU PROBLEME DBUS)
(DBUS PROBLEM FIX)
RUN rm -r /var/run && rm -r /var/lock && ln -s /run /var/run && ln -s /run/lock /var/lock && rm /run/dbus/*
EXPOSE 51826
CMD [“/root/.homebridge/run.sh”]
[/code]
3 - Building of the Docker image
cd /volume1/docker/<your_username>/homebridge/
docker build -t jessie-homebridge-vera .
4 - Creation of the configuration files
In your folder, you’ll have to create 2 configuration files :
- config.json : configuration of homebridge (where you put your VERA’s IP)
- run.sh : shell script that will be run by the container when you start the image
Here is the content of the “config.json” file :
[code]{
“bridge”: {
“name”: “Homebridge”,
“username”: “CC:22:3D:E3:CE:30”,
“port”: 51826,
“pin”: “031-45-154”
},
"description": "This is an example configuration file.",
"platforms": [
{
"platform": "Vera",
"name": "Vera",
"veraIP": "XXX.XXX.XXX.XXX",
"includesensor": false,
"securitypoll": 2000,
"dimmertest": false }
]
}
[/code]
You’ll have to replace “XXX.XXX.XXX.XXX” by your VERA’s IP address.
If needed, you can check your config.json file here.
Here is the content of the “run.sh” file :
[code]#!/bin/bash
MODIFICATION DES PARAMETRES DE AVAHI
AVAHI SETTINGS MODIFICATION
sed -i “s/rlimit-nproc=3/#rlimit-nproc=3/” /etc/avahi/avahi-daemon.conf
sed -i -e’/AVAHI_DAEMON_DETECT_LOCAL/s/1/0/’ /etc/default/avahi-daemon
LANCEMENT DES SERVICES DBUS, AVAHI, HOMEBRIDGE
RUNNING DBUS, AVAHI AND HOMEBRIDGE SERVICES
dbus-daemon --system
avahi-daemon -D
homebridge
[/code]
5 - Launching
You’ll have to enter this command :
docker run -d --net=host -p 51826:51826 -v /volume1/docker/<your_username>/homebridge:/root/.homebridge jessie-homebridge-vera
Let me know if you managed to do it !
Regards