Mit bitte erklären wir ich an die benötigte log Datei komme.
Du kannst das Homebridge-Log entweder in der Weboberfläche sehen oder im Terminal mit dem Befehl hb-service logs aufrufen.
Ein Neustart der Homebridge sieht bei mir im Log so aus:
[17/06/2021, 08:14:49] [CMD Switch] iMac Screensaver is off.
[17/06/2021, 08:14:49] [CMD Switch] Hue Loop is off.
[17/06/2021, 08:14:49] [ZP] Wohnzimmer Sonos: get Remaining Duration: return 0s
[17/06/2021, 08:14:50] [Homebridge UI] Homebridge restart request received
[17/06/2021, 08:14:50] [Homebridge UI] UI / Bridge settings have not changed; only restarting Homebridge process
[17/06/2021, 08:14:50] [Homebridge UI] Sending SIGTERM to Homebridge
[17/06/2021, 08:14:50] Got SIGTERM, shutting down Homebridge...
[17/06/2021, 08:14:50] [AppleTvPlatform] Shutting down Apple TV clients...
[17/06/2021, 08:14:50] [ZP] closed http://0.0.0.0:41337/notify
[17/06/2021, 08:14:55] [Hue] goodbye
[17/06/2021, 08:14:55] [ZP] goodbye
[17/06/2021, 08:14:56] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[17/06/2021, 08:15:01] [HB Supervisor] Restarting Homebridge...
[17/06/2021, 08:15:01] [HB Supervisor] Starting Homebridge with extra flags: -I
[17/06/2021, 08:15:01] [HB Supervisor] Started Homebridge v1.3.4 with PID: 14603
[17/06/2021, 08:15:01] [HB Supervisor] Stopping services...
[17/06/2021, 08:15:01] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGTERM
[17/06/2021, 08:15:06] [HB Supervisor] Restarting Homebridge...
[17/06/2021, 08:15:06] [HB Supervisor] Starting Homebridge with extra flags: -I
[17/06/2021, 08:15:06] [HB Supervisor] Started Homebridge v1.3.4 with PID: 14617
Initializing HAP-NodeJS v0.9.4...
[17/06/2021, 08:15:35] [HB Supervisor] OS: Linux 5.10.17-v7l+ arm
[17/06/2021, 08:15:35] [HB Supervisor] Node.js v14.17.0 /usr/local/bin/node
[17/06/2021, 08:15:35] [HB Supervisor] Homebridge Path: /usr/local/lib/node_modules/homebridge/bin/homebridge
[17/06/2021, 08:15:35] [HB Supervisor] UI Path: /usr/local/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[17/06/2021, 08:15:42] [Homebridge UI] Homebridge Config UI X v4.41.1 is listening on :: port 8088
[17/06/2021, 08:15:42] [HB Supervisor] Starting Homebridge with extra flags: -I
[17/06/2021, 08:15:42] [HB Supervisor] Started Homebridge v1.3.4 with PID: 14727
Initializing HAP-NodeJS v0.9.4...
[17/06/2021, 08:15:43] Loaded config.json with 24 accessories and 12 platforms.
[17/06/2021, 08:15:44] Loaded 6 cached accessories from cachedAccessories.
[17/06/2021, 08:15:44] ---
[17/06/2021, 08:15:46] Loaded plugin: [email protected]
[17/06/2021, 08:15:46] Registering platform 'homebridge-alexa.Alexa'
[17/06/2021, 08:15:46] ---
[17/06/2021, 08:15:47] Loaded plugin: [email protected]
[17/06/2021, 08:15:47] Registering platform 'homebridge-apple-tv-remote.AppleTvPlatform'
[17/06/2021, 08:15:47] ---
[17/06/2021, 08:15:47] Loaded plugin: [email protected]
[17/06/2021, 08:15:47] Registering platform 'homebridge-calendar.Calendar'
[17/06/2021, 08:15:47] ---
[17/06/2021, 08:15:47] Loaded plugin: [email protected]
[17/06/2021, 08:15:47] Registering platform 'homebridge-cmdswitch2.cmdSwitch2'
.
.
.
Ganz oben sieht man in Hellgrau noch das alte Log.
Ab [17/06/2021, 08:14:50] wird der Restart eingeläutet,
ab [17/06/2021, 08:15:06] geht's dann richtig los (fette Schrift):
[17/06/2021, 08:15:06] [HB Supervisor] Restarting Homebridge... Da fängt das Log an.
Erst wird die Homebridge gestartet, dann werden die Plugin geladen. Bei mir geht das Laden der Plugins dann noch eine Weile weiter. Ich hab das jetzt hier mal abgeschnitten beim Laden von homebridge-cmdswitch2 und drei Pünktchen hingemacht. Wenn alle Plugins geladen sind, dann kommt die Initialisierung der Plugins - das ist die Phase, wo die Plugins angeworfen werden und anfangen, ihre Arbeit zu verrichten:
.
.
.
[17/06/2021, 08:16:01] Loaded plugin: [email protected]
[17/06/2021, 08:16:01] Registering platform 'homebridge-zp.Lib'
[17/06/2021, 08:16:01] Registering platform 'homebridge-zp.ZP'
[17/06/2021, 08:16:01] Registering platform 'homebridge-zp.ZPS1'
[17/06/2021, 08:16:01] ---
[17/06/2021, 08:16:01] Loading 12 platforms...
[17/06/2021, 08:16:01] [AppleTvPlatform] Initializing AppleTvPlatform platform...
[17/06/2021, 08:16:01] [CMD Switch] Initializing cmdSwitch2 platform...
[17/06/2021, 08:16:01] [Alexa] Initializing Alexa platform...
[17/06/2021, 08:16:01] [Alexa] homebridge-alexa v0.5.39, node v14.17.0, homebridge v1.3.4
[17/06/2021, 08:16:01] Initializing platform accessory 'Alexa'...
[17/06/2021, 08:16:01] [Hue] Initializing Hue platform...
[17/06/2021, 08:16:01] [Hue] homebridge-hue v0.13.13, node v14.17.0, homebridge v1.3.4
[17/06/2021, 08:16:01] [ZP] Initializing ZP platform...
[17/06/2021, 08:16:01] [ZP] homebridge-zp v1.3.0, node v14.17.0, homebridge v1.3.4, homebridge-lib v5.1.4
[17/06/2021, 08:16:01] [People] Initializing People platform...
[17/06/2021, 08:16:02] Initializing platform accessory 'Stefan'...
[17/06/2021, 08:16:02] Initializing platform accessory 'Anna'...
[17/06/2021, 08:16:02] Initializing platform accessory 'Anyone'...
[17/06/2021, 08:16:02] Initializing platform accessory 'No One'...
[17/06/2021, 08:16:02] [People] WebHook: Started server on port '51828'.
[17/06/2021, 08:16:02] [Config] Initializing config platform...
[17/06/2021, 08:16:02] [Config] Running in Service Mode
[17/06/2021, 08:16:02] [Calendar] Initializing Calendar platform...
[17/06/2021, 08:16:02] [Calendar] CalendarPlatform Plugin Loaded - version 0.4.0
[17/06/2021, 08:16:02] [Calendar] Found calendar in config: "Eintracht"
[17/06/2021, 08:16:02] [Calendar] Pushing calendar sensor 'Eintracht' state 0 - value 0
[17/06/2021, 08:16:02] [Calendar] Polling calendar Eintracht has started.
[17/06/2021, 08:16:02] [Calendar] Updating calendar Eintracht
[17/06/2021, 08:16:02] Initializing platform accessory 'Eintracht'...
[17/06/2021, 08:16:02] [Screeneo Videos] Initializing OmxPlayer platform...
OmxPlayer plugin started!
.
.
.
Auch hier geht's eine Weile munter weiter, ich hab auch das jetzt mal abgeschnitten. Bei dir sieht das ja eh alles anders aus, weil du andere Plugins verwendest, aber grundsätzlich läuft es bei dir auch so ab. Aber hier können nun so einige Fehler auftauchen. Beispielsweise könnte an dieser Stelle über eine fehlerhafte Konfiguration gemeckert werden oder darüber, dass ein benötigter externer Service (wie ein Wetterserver) nicht erreicht werden kann oder über einen Programmierfehler in einem Plugin. Diese Stelle im Log interessiert Plugin-Programmierer am meisten. Die stehen beispielsweise auf so hässliche Sachen wie:
[17/06/2021, 08:16:02] [Farn] Initializing mqttthing accessory...
[17/06/2021, 08:16:02] [Farn] MQTT URL: http://homepi.lan:1883
[17/06/2021, 08:16:02] [Farn] MQTT options: {"keepalive":10,"clientId":"mqttthing_Farn_e45f6560","protocolId":"MQTT","protocolVersion":4,"clean":true,"reconnectPeriod":1000,"connectTimeout":30000,"will":{"topic":"WillMsg","payload":"mqtt-thing [Farn] has stopped","qos":0,"retain":false},"rejectUnauthorized":false}
[17/06/2021, 08:16:02] [Farn] Exception while creating services: TypeError: Cannot read property 'getCurrentRelativeHumidity' of undefined
[17/06/2021, 08:16:02] [Farn] TypeError: Cannot read property 'getCurrentRelativeHumidity' of undefined
at characteristic_CurrentRelativeHumidity (/usr/local/lib/node_modules/homebridge-mqttthing/index.js:1608:41)
at configToServices (/usr/local/lib/node_modules/homebridge-mqttthing/index.js:2745:17)
at createServices (/usr/local/lib/node_modules/homebridge-mqttthing/index.js:3279:24)
at new makeThing (/usr/local/lib/node_modules/homebridge-mqttthing/index.js:3311:23)
at /usr/local/lib/node_modules/homebridge/src/server.ts:350:50
at Array.forEach (<anonymous>)
at Server.loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:270:29)
at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:162:12)
[17/06/2021, 08:16:02] [Farn] Accessory mqttthing returned empty set of services; not adding it to the bridge.
Grusel. Wenn aber alles superduper ist, dann endet der Startvorgang ungefähr so:
.
.
.
[17/06/2021, 08:16:04] [Hue] Philips hue: 2 services
[17/06/2021, 08:16:04] Initializing platform accessory 'Deckenlampe'...
[17/06/2021, 08:16:04] Initializing platform accessory 'Flurlampe'...
Preparing Advertiser for 'Homebridge CAD8' using ciao backend!
Setup Payload:
X-HM://0023ISYW8I8M6
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
┌────────────┐
│ 123-45-678 │
└────────────┘
Starting to advertise 'Homebridge CAD8' using ciao backend!
[17/06/2021, 08:16:04] Homebridge v1.3.4 (Homebridge) is running on port 51826.
Das ist das Startlog. Wenn du also einem Plugin-Entwickler etwas zukommen lassen willst, dann ist das der ganze Krempel zwischen
[17/06/2021, 08:15:06] [HB Supervisor] Restarting Homebridge...
und
[17/06/2021, 08:16:04] Homebridge v1.3.4 (Homebridge) is running on port 51826.
Danach folgt dann das Live-Log, das in den meisten Fällen nicht so interessant ist, aber möglicherweise kann man auch dort Interessantes finden. Beispielsweise könnte man dort sehen, dass ein bestimmtes Gerät ein- und ausgeschaltet wird, während sich in der Home-App nichts rührt. Auch das wüsste der Entwickler gern.
Was oben gezeigt wird, ist das Standard-Log. Dann gibt es noch das Debug-Log. Das zeigt den gleichen Vorgang wie das Standard-Log, aber viel, viel, viel, viel detaillierter und ist für unsere kleinen User-Äuglein die Mutter aller Unübersichtlichkeit, während Entwickler behaupten, dass sie das so lesen wie die Zeitung beim Morgenkaffee. Da lach ich doch mal ein bisschen, aber tatsächlich enthält das Debug-Log manchmal wichtige Informationen, die man sonst nicht sieht. Gleichzeitig werden damit soviel Informationen erzeugt, dass man es nicht stundenlang aktiviert lassen sollte - die Größe der SD-Card deines Raspi ist nämlich endlich.