madchicken/homebridge-zigbee-nt

Some devices lost after restarting Homebridge

lucaskoehler opened this issue · 3 comments

Some Zigbee devices paired to the plugin are lost after restarting the homebridge server.
In my case: a Tradfri bulb and an Aqara Leak Sensor are not displayed anymore while the Hue Outdoor Sensor still works after rebooting.

When trying to pair the devices again, it says that they were not unpaired.

This is the log of the restart process:

[10/19/2021, 06:58:07] [Homebridge UI] Homebridge restart request received
[10/19/2021, 06:58:07] [Homebridge UI] Executing restart command: sudo -n systemctl restart homebridge
homebridge : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/systemctl restart homebridge
pam_unix(sudo:session): session opened for user root by (uid=0)
Stopping Node.js HomeKit Server...
[10/19/2021, 06:58:07] Got SIGTERM, shutting down Homebridge...
[10/19/2021, 06:58:07] [ZigBee] Stopping zigbee service
[10/19/2021, 06:58:07] [ZigBee] Zigbee: disabling joining new devices.
[10/19/2021, 06:58:08] [ZigBee] Stopping http server
[10/19/2021, 06:58:08] [ZigBee] Successfully stopped ZigBee service
homebridge.service: Main process exited, code=exited, status=143/n/a
homebridge.service: Failed with result 'exit-code'.
Stopped Node.js HomeKit Server.
homebridge.service: Found left-over process 30587 (node) in control group while starting unit. Ignoring.
This usually indicates unclean termination of a previous run, or service implementation deficiencies.
homebridge.service: Found left-over process 30790 (sh) in control group while starting unit. Ignoring.
This usually indicates unclean termination of a previous run, or service implementation deficiencies.
homebridge.service: Found left-over process 30791 (sudo) in control group while starting unit. Ignoring.
This usually indicates unclean termination of a previous run, or service implementation deficiencies.
homebridge.service: Found left-over process 30792 (systemctl) in control group while starting unit. Ignoring.
This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Started Node.js HomeKit Server.
Initializing HAP-NodeJS v0.9.6...
[10/19/2021, 06:58:14] Loaded config.json with 0 accessories and 3 platforms.
[10/19/2021, 06:58:14] Loaded 3 cached accessories from cachedAccessories.
[10/19/2021, 06:58:14] ---
[10/19/2021, 06:58:15] Loaded plugin: homebridge-automation-switches@3.2.1
[10/19/2021, 06:58:15] Registering platform 'homebridge-automation-switches.AutomationSwitches'
[10/19/2021, 06:58:15] ---
[10/19/2021, 06:58:15] Loaded plugin: homebridge-config-ui-x@4.41.2
[10/19/2021, 06:58:15] Registering platform 'homebridge-config-ui-x.config'
[10/19/2021, 06:58:15] ---
[10/19/2021, 06:58:22] Loaded plugin: homebridge-zigbee-nt@2.5.4
[10/19/2021, 06:58:22] Registering platform 'homebridge-zigbee-nt.ZigbeeHomebridgeNTPlatform'
[10/19/2021, 06:58:22] ---
[10/19/2021, 06:58:22] Loading 3 platforms...
[10/19/2021, 06:58:22] [Config] Initializing config platform...
[10/19/2021, 06:58:22] [Config] Spawning homebridge-config-ui-x with PID 30817
[10/19/2021, 06:58:22] [ZigBee] Initializing ZigbeeHomebridgeNTPlatform platform...
[10/19/2021, 06:58:22] [ZigBee] Initializing platform: ZigBee - v2.5.4 (API v2.7)
[10/19/2021, 06:58:22] [AutomationSwitches] Initializing AutomationSwitches platform...
[10/19/2021, 06:58:22] [AutomationSwitches] AutomationSwitchesPlatform Plugin Loaded - Version 3.2.1
[10/19/2021, 06:58:22] [AutomationSwitches] Found automation switch in config: "Fenster Timer"
[10/19/2021, 06:58:22] Initializing platform accessory 'Fenster Timer'...
[10/19/2021, 06:58:22] [ZigBee] Loading accessory from cache: zigbee:permit-join
[10/19/2021, 06:58:22] [ZigBee] Loading accessory from cache: zigbee:touchlink
[10/19/2021, 06:58:22] [ZigBee] Loading accessory from cache: 0x001788010649a76c
Preparing Advertiser for 'Homebridge BAFE' using ciao backend!
Setup Payload:
X-HM://0024PGTZW219P
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:
                       
    ┌────────────┐
    │ XXX-XX-XXX │
    └────────────┘
                       
Starting to advertise 'Homebridge BAFE' using ciao backend!
[10/19/2021, 06:58:23] Homebridge v1.3.5 (Homebridge) is running on port 51826.
[10/19/2021, 06:58:23] [ZigBee] Configured port for ZigBee dongle is /dev/ttyACM0
[10/19/2021, 06:58:23] [ZigBee] Initializing ZigBee controller on port /dev/ttyACM0 and channels 11, 25 (pan ID 6754)
[10/19/2021, 06:58:27] [ZigBee] Successfully started ZigBee service
[10/19/2021, 06:58:27] [ZigBee] ZigBee platform initialized @ 0x00124b0014d9a2d0
[10/19/2021, 06:58:27] [ZigBee] Reuse accessory from cache with uuid 6895c160-ba25-497f-b805-38071c751c56 and name zigbee:permit-join
[10/19/2021, 06:58:27] [ZigBee] Zigbee: disabling joining new devices.
[10/19/2021, 06:58:27] [ZigBee] PermitJoin accessory successfully registered
[10/19/2021, 06:58:27] [ZigBee] Reuse accessory from cache with uuid 4994893c-ea77-4292-a4ad-09e1f36f7099 and name zigbee:touchlink
[10/19/2021, 06:58:27] [ZigBee] TouchLink accessory successfully registered
[10/19/2021, 06:58:27] [ZigBee] Initializing ZigBee device: 0x001788010649a76c - SML002 - Philips
[10/19/2021, 06:58:27] [ZigBee] Reuse accessory from cache with uuid 49f2bbbd-f750-425f-bdd1-411450df10d7 and name 0x001788010649a76c
[10/19/2021, 06:58:27] [ZigBee] Registered device: 0x001788010649a76c Philips SML002
[10/19/2021, 06:58:27] [ZigBee] Mounting device 0x001788010649a76c...
[10/19/2021, 06:58:27] [ZigBee] Starting WEB UI on port 9000, host is set to 0.0.0.0
[10/19/2021, 06:58:27] [ZigBee] WebSocket server started @ null
[10/19/2021, 06:58:27] [ZigBee] WEB UI Listening on port 9000
[10/19/2021, 06:58:32] [Homebridge UI] Homebridge Config UI X v4.41.2 is listening on :: port 8080
[10/19/2021, 06:58:49] [ZigBee] Accepting joining whitelisted device '0x001788010649a76c'
[10/19/2021, 06:58:50] [ZigBee] Device announce: 0x001788010649a76c (Philips - SML002)
[10/19/2021, 06:58:50] [ZigBee] Mounting device 0x001788010649a76c...
[10/19/2021, 06:58:51] [ZigBee] Accepting joining whitelisted device '0x001788010649a76c'
[10/19/2021, 06:58:51] [ZigBee] Device announce: 0x001788010649a76c (Philips - SML002)
[10/19/2021, 06:58:51] [ZigBee] Mounting device 0x001788010649a76c...
[10/19/2021, 06:59:12] [ZigBee] Cannot set property 'configured' of undefined
(node:30793) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'configured' of undefined
    at ConfigurableAccessory.set isConfigured [as isConfigured] (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/accessories/zig-bee-accessory.ts:209:46)
    at ConfigurableAccessory.<anonymous> (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/accessories/zig-bee-accessory.ts:178:28)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/homebridge-zigbee-nt/dist/accessories/zig-bee-accessory.js:5:58)
(node:30793) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:30793) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:30793) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'configured' of undefined
    at ConfigurableAccessory.set isConfigured [as isConfigured] (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/accessories/zig-bee-accessory.ts:209:46)
    at ConfigurableAccessory.<anonymous> (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/accessories/zig-bee-accessory.ts:178:28)

(the last part of the log repeats every few seconds)

My homebridge has the exact same issue.

Looking into it

Should be fixed in version 2.5.5