Hallo Zusammen!
Ich bin seit einer ganzen Weile dabei, meinen Raspberry 3 Model B ( folgendes Set: Raspberry Pi Set [Anzeige] ) zu einer Homebridge Zentrale einzurichten.
Zuerst habe ich Pilight installiert und eingerichtet ( Anleitung: https://raspberry.tips/hausautomatisi…automatisierung ).
Das funktioniert auch soweit. Anschließend habe ich die Homebridge anhand folgender Anleitung installiert: https://smartapfel.de/homebridge/homebridge-installieren/.
Ich habe generell, wie Ihr sicher merkt, nicht so die große Ahnung vom Programmieren, ich arbeite hautpsächlich nach Copy/Paste. Manche Befehle ergeben sich meiner Logik nach, andere eher weniger :D.
Falls noch Infos fehlen versuche ich sie so schnell wie möglich nachzureichen!
Verwendete Software:
cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Linux Kernel:
Wenn ich die Homebridge manuell über "sudo homebridge" starte funktioniert auch alles, folgende Meldung bekomme ich:
pi@raspberrypi:/ $ sudo homebridge
[2019-4-14 10:54:46] Loaded config.json with 3 accessories and 1 platforms.
[2019-4-14 10:54:46] ---
[2019-4-14 10:54:46] Loaded plugin: homebridge-config-ui-x
[2019-4-14 10:54:46] Registering platform 'homebridge-config-ui-x.config'
[2019-4-14 10:54:46] ---
[2019-4-14 10:54:47] Loaded plugin: homebridge-http
[2019-4-14 10:54:47] Registering accessory 'homebridge-http.Http'
[2019-4-14 10:54:47] ---
[2019-4-14 10:54:47] Loaded plugin: homebridge-pilight
[2019-4-14 10:54:47] Registering accessory 'homebridge-pilight.pilight'
[2019-4-14 10:54:47] ---
[2019-4-14 10:54:48] Loading 1 platforms...
[2019-4-14 10:54:48] [Config] Initializing config platform...
[2019-4-14 10:54:48] [Config] Spawning homebridge-config-ui-x with PID 4991
[2019-4-14 10:54:48] Loading 3 accessories...
[2019-4-14 10:54:48] [Schranklampe] Initializing pilight accessory...
[2019-4-14 10:54:48] [Schranklampe] [homebridge-pilight] Plugin 'homebridge-pilight 2.0.0' registered as: plugin='homebridge-pilight', accessory='pilight', name='Schranklampe'
[2019-4-14 10:54:48] [Schranklampe] [homebridge-pilight] [WebSocket] Connecting to "ws://localhost:80/"...
[2019-4-14 10:54:48] [Fensterlampe] Initializing pilight accessory...
[2019-4-14 10:54:48] [Fensterlampe] [homebridge-pilight] Plugin 'homebridge-pilight 2.0.0' registered as: plugin='homebridge-pilight', accessory='pilight', name='Fensterlampe'
[2019-4-14 10:54:48] [Fensterlampe] [homebridge-pilight] [WebSocket] Connecting to "ws://localhost:80/"...
[2019-4-14 10:54:48] [TV-Leiste] Initializing pilight accessory...
[2019-4-14 10:54:48] [TV-Leiste] [homebridge-pilight] Plugin 'homebridge-pilight 2.0.0' registered as: plugin='homebridge-pilight', accessory='pilight', name='TV-Leiste'
[2019-4-14 10:54:48] [TV-Leiste] [homebridge-pilight] [WebSocket] Connecting to "ws://localhost:80/"...
Setup Payload:
X-HM://0023ISYWY09J1
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:
┌────────────┐
│ 031-45-154 │
└────────────┘
[2019-4-14 10:54:51] Homebridge is running on port 51826.
[2019-4-14 10:54:51] [Schranklampe] [homebridge-pilight] [WebSocket] Connection established successfully
[2019-4-14 10:54:51] [Schranklampe] [homebridge-pilight] Requesting initial states...
[2019-4-14 10:54:51] [TV-Leiste] [homebridge-pilight] [WebSocket] Connection established successfully
[2019-4-14 10:54:51] [TV-Leiste] [homebridge-pilight] Requesting initial states...
[2019-4-14 10:54:51] [Fensterlampe] [homebridge-pilight] [WebSocket] Connection established successfully
[2019-4-14 10:54:51] [Fensterlampe] [homebridge-pilight] Requesting initial states...
[2019-4-14 10:54:51] [Schranklampe] [homebridge-pilight] Updated internal state to "off"
[2019-4-14 10:54:51] [TV-Leiste] [homebridge-pilight] Updated internal state to "on"
[2019-4-14 10:54:51] [Fensterlampe] [homebridge-pilight] Updated internal state to "off"
[2019-4-14 10:54:56] [Config] Using Form Authentication
[2019-4-14 10:54:56] [Config] Console v3.11.0 is listening on port 8080.
Alles anzeigen
Die Homebridge habe ich in meiner Apple home App hinzugefügt und ich kann die 3 Funktsteckdosen darüber schalten.
Da die Homebridge ja auch beim Booten starten soll habe ich es auch wie in der Anleitung beschrieben mit dem Systemd Startscript probiert, daran scheitert es jedoch leider.
Ich habe schon Stunden in google damit verbracht und versucht andere Lösungsvorschläge zu probieren, es half jedoch alles nichts, deswegen wende ich mich an euch.
Folgende Fehlermeldung erscheint:
pi@raspberrypi:/ $ sudo systemctl start homebridge; sudo journalctl -fau homebridge
-- Logs begin at Sat 2019-04-13 14:21:03 CEST. --
Apr 14 11:05:02 raspberrypi systemd[1]: Started Node.js HomeKit Server.
Apr 14 11:05:02 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=203/EXEC
Apr 14 11:05:02 raspberrypi systemd[1]: homebridge.service: Unit entered failed state.
Apr 14 11:05:02 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.
Apr 14 11:05:12 raspberrypi systemd[1]: homebridge.service: Service hold-off time over, scheduling restart.
Apr 14 11:05:12 raspberrypi systemd[1]: Stopped Node.js HomeKit Server.
Apr 14 11:05:12 raspberrypi systemd[1]: Started Node.js HomeKit Server.
Apr 14 11:05:12 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=203/EXEC
Apr 14 11:05:12 raspberrypi systemd[1]: homebridge.service: Unit entered failed state.
Apr 14 11:05:12 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.
Apr 14 11:05:22 raspberrypi systemd[1]: homebridge.service: Service hold-off time over, scheduling restart.
Apr 14 11:05:22 raspberrypi systemd[1]: Stopped Node.js HomeKit Server.
Apr 14 11:05:22 raspberrypi systemd[1]: Started Node.js HomeKit Server.
Apr 14 11:05:22 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=203/EXEC
Apr 14 11:05:22 raspberrypi systemd[1]: homebridge.service: Unit entered failed state.
Apr 14 11:05:22 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.
Apr 14 11:05:32 raspberrypi systemd[1]: homebridge.service: Service hold-off time over, scheduling restart.
Apr 14 11:05:32 raspberrypi systemd[1]: Stopped Node.js HomeKit Server.
Apr 14 11:05:32 raspberrypi systemd[1]: Started Node.js HomeKit Server.
Apr 14 11:05:32 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=203/EXEC
Apr 14 11:05:32 raspberrypi systemd[1]: homebridge.service: Unit entered failed state.
Apr 14 11:05:32 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.
Alles anzeigen
Die Meldung wiederholt sich alle 10 Sekunden, wie auch laut Script geplant, wenigstens funktioniert also etwas .
Da ich ja den Nutzer homebridge erstellt habe, habe ich auch überlegt ob ich den Nutzer erst wechseln muss ( su homebridge ) und dann den Service starten, hat jedoch auch nichts geholfen.
Der Inhalt von /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=-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=*
Der Inhalt von /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
Alles anzeigen
Der Pfad unter ExecStart ist auch korrekt, ist ja laut diversen Seiten oft ein Fehler, siehe:
sudo which homebridge
/usr/local/bin/homebridge
Meine config.json, welche normalerweise unter /root/.homebridge/ liegt, habe ich in das erstellte Verzeichnis /var/homebridge kopiert
cat /var/homebridge/config.json
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:33",
"port": 51826,
"pin": "031-45-154"
},
"description": "Home Smart Home",
"platforms": [
{
"platform": "config",
"name": "Config",
"port": 8080,
"auth": "form",
"theme": "red",
"restart": "sudo -n systemctl restart homebridge",
"temp": "/sys/class/thermal/thermal_zone0/temp",
"sudo": true,
"log": {
"method": "systemd",
"service": "homebridge"
}
}
],
"accessories": [
{
"accessory": "pilight",
"port": "80",
"name": "Schranklampe",
"device": "Switch1",
"sharedWs": "false",
"type": "Switch"
},
{
"accessory": "pilight",
"port": "80",
"name": "Fensterlampe",
"device": "Switch2",
"sharedWs": "false",
"type": "Switch"
},
{
"accessory": "pilight",
"port": "80",
"name": "TV-Leiste",
"device": "Switch3",
"sharedWs": "false",
"type": "Switch"
}
]
}
Alles anzeigen
Ich hoffe ihr könnt ihr helfen, so dass ich meine Homebridge zum laufen bekomme!
Schon im Voraus vielen Dank und bei fehlenden Infos einfach Fragen.
Liebe Grüße Dario