Homebrige
Installation auf Raspberry Pi (rasbian-jessie)
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt update; sudo apt upgrade
nodejs --version
python --version
g++ --version
sudo apt-get install python g++ libavahi-compat-libdnssd-dev
sudo npm install -g --unsafe-perm homebridge
sudo npm install -g homebridge-fhem
sudo npm -g outdated
sudo npm -g update homebridge
sudo npm -g update homebridge-fhem
sudo useradd -m -c "Homebridge Service" -s /bin/bash -G audio,bluetooth,dialout,gpio,systemd-journal,video homebridge
sudo visudo -f /etc/sudoers.d/homebridge
homebridge ALL=(root) SETENV:NOPASSWD: /usr/local/bin/npm, /bin/systemctl restart homebridge, /usr/local/bin/node
sudo chmod 640 /etc/sudoers.d/homebridge
sudo mkdir -p /var/homebridge
sudo nano /var/homebridge/config.json
evtl. “username”: “CC:22:3D:E3:CE:30”, auf “username”: “CC:22:3D:E3:CE:31”
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"platforms": [
{
"platform": "FHEM",
"name": "FHEM",
"server": "127.0.0.1",
"port": "8083",
"filter": "room=Homekit"
}
],
"accessories": []
}
sudo chown -R homebridge:homebridge /var/homebridge
sudo nano /etc/systemd/system/homebridge.service
[Unit]
Description=Node.js HomeKit Server
After=syslog.target network-online.target
[Service]
Type=simple
User=homebridge
EnvironmentFile=/etc/default/homebridge
ExecStart=/usr/local/bin/homebridge $HOMEBRIDGE_OPTS
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
sudo nano /etc/default/homebridge
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-I -U /var/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
sudo systemctl daemon-reload
sudo systemctl enable homebridge
Test deamon start/restart
sudo systemctl restart homebridge; sudo journalctl -fau homebridge
Mapping
Beispiel Dummyschalter ja/nein > on/off
attr <device> siriName <name>
attr <device> genericDeviceType switch
attr <device> homebridgeMapping On=ja=state,valueOff=nein,valueOn=ja,cmdOff=nein,cmdOn=ja
Config ui
Baustelle ab hier
https://github.com/oznu/homebridge-config-ui-x
sudo npm install -g --unsafe-perm homebridge-config-ui-x