Homebrige auf Linux (z.B. raspberry Pi) installieren

Mit Homebridge kannst du unter anderem mit deinem Iphone oder Ipad √ľber Siri dein Haus steuern.

 

Grundkonfiguration: 

Show/Hidden bash code

View source
 
 
apt-get update apt-get upgrade 
apt-get install git make curl
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install libavahi-compat-libdnssd-dev npm
 
npm install -g --unsafe-perm homebridge hap-nodejs node-gyp cd /usr/local/lib/node_modules/homebridge/ npm install --unsafe-perm bignum cd /usr/local/lib/node_modules/hap-nodejs/node_modules/mdns node-gyp BUILDTYPE=Release rebuild
cd /usr/local/lib/node_modules/homebridge
npm install --unsafe-perm mdns
npm rebuild --unsafe-perm
 
 

 

Tado Heizzungssteuerung vie Homekit 

Weiteres Todo:

Show/Hidden bash code
View source
 
/etc/init.d/dbus start
/etc/init.d/avahi-daemon start
npm install homebridge-server@latest -g
npm install forever -g
 
 

Konfig anlegen
Show/Hidden bash code
View source
 
vim ~/.homebridge/config.json
 
 
Inahlt 
Show/Hidden bash code
View source
 
 
{
 "bridge": {
 "name": "Homebridge",
 "username": "CC:22:3D:E3:CE:30",
 "port": 51826,
 "pin": "031-45-154"
 },
 
 "accessories": [
 ],
 
 "platforms": [
 ]
}
 
 
 

 

Homebridge kompatibele Schaltsteckdose

 

Script in "/etc/init.d/homebridge" einf√ľgen (neu anlegen)

Show/Hidden bash code
View source
 
#!/bin/sh
### BEGIN INIT INFO
# Provides: homebridge
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time for homebridge
# Description: Enable service provided by daemon.
### END INIT INFO
export PATH=$PATH:/usr/local/bin
export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules
PID=`pidof homebridge`
case "$1" in
start)
if ps -p $PID > /dev/null 2>&1; then
 echo "Homebridge is already running"
else
 homebridge > /dev/null 2>&1 &
 echo "Homebridge starting"
 $0 status
fi
;;
stop)
if ! ps -p $PID > /dev/null 2>&1; then
 echo "Homebridge is not running"
else
 kill $PID
 echo "Homebridge closed"
fi
;;
restart)
if ! ps -p $PID > /dev/null 2>&1; then
 $0 start
else
 $0 stop
 $0 start
fi
;;
status)
if ps -p $PID > /dev/null 2>&1; then
 echo "Homebridge is running PID $PID"
else
 echo "Homebridge is not running"
fi
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;
esac
exit 0
 
 
 

 

Script ausf√ľhrbar machen

Show/Hidden bash code
View source
 
chmod 755 /etc/init.d/homebridge
update-rc.d homebridge defaults
homebridge
 
 

Im Browser l√§sst sich nun √ľber http://IPDESSERVERS:8765/ die Homebridge Gui aufrufen
und die Homebridge konfigurieren.


Dir hat das Projekt gefallen? Dann¬†Unterst√ľtze mich, damit ich weiterhin solche Projekte vorstellen kann!¬†

Kommentar schreiben

Sicherheitscode
Aktualisieren