kuestess / homebridge-platform-insteonlocal

Homebridge platform plugin for local Insteon control
Other
76 stars 26 forks source link

Homebridge crashes when using refresh interval. #272

Closed jake-at-work closed 1 year ago

jake-at-work commented 1 year ago

Describe The Bug: Using the refresh property on the global plugin config or any specific device results in a SIGTERM. Removing the refresh property allows Homebridge to start.

To Reproduce: Set refresh to any value greater than 0 and restart.

Expected behavior: Should restart without crashing and refresh at desired interval.

Logs:

[17/07/2022, 21:37:49] [Insteon Local Platform] Restoring existing accessory from cache: Living Room Chandelier
[17/07/2022, 21:37:49] TypeError: Cannot read properties of undefined (reading 'push')
    at new InsteonLocalAccessory (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/src/InsteonLocalAccessory.ts:152:24)
    at InsteonLocalPlatform.discoverDevices (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/src/InsteonLocalPlatform.ts:613:30)
    at HomebridgeAPI.<anonymous> (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/src/InsteonLocalPlatform.ts:111:12)
    at HomebridgeAPI.emit (node:events:539:35)
    at HomebridgeAPI.signalFinished (/var/lib/homebridge/node_modules/homebridge/src/api.ts:275:10)
    at Server.start (/var/lib/homebridge/node_modules/homebridge/src/server.ts:190:14)
[17/07/2022, 21:37:50] Got SIGTERM, shutting down Homebridge...

Plugin Config:

...
{
            "name": "Insteon Local Platform",
            "model": "2245",
            "refresh": "0",
            "server_port": "3000",
            "keepAlive": "3600",
            "devices": [
...
                {
                    "name": "Living Room Chandelier",
                    "deviceID": "573D5E",
                    "dimmable": "true",
                    "deviceType": "dimmer"
                }
...

Screenshots:

Environment:

ctgreybeard commented 1 year ago

I believe I also ran into this. After upgrading my InsteonLocal failed to initialize. Log says:


[18/07/2022, 20:13:53] [InsteonLocal] Found 11 devices in config
[18/07/2022, 20:13:53] [InsteonLocal] Adding new accessory: Dining Room Light
[18/07/2022, 20:13:53] TypeError: Cannot read properties of undefined (reading 'push')
    at new InsteonLocalAccessory (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/src/InsteonLocalAccessory.ts:152:24)
    at InsteonLocalPlatform.discoverDevices (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/src/InsteonLocalPlatform.ts:625:30)
    at HomebridgeAPI.<anonymous> (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/src/InsteonLocalPlatform.ts:111:12)
    at HomebridgeAPI.emit (node:events:539:35)
    at HomebridgeAPI.signalFinished (/var/lib/homebridge/node_modules/homebridge/src/api.ts:275:10)
    at Server.start (/var/lib/homebridge/node_modules/homebridge/src/server.ts:190:14)
[18/07/2022, 20:13:53] [InsteonLocal] Connected to Insteon PLM...
[18/07/2022, 20:13:53] [InsteonLocal] Insteon event listener started...
[18/07/2022, 20:13:53] Got SIGTERM, shutting down Homebridge...
[18/07/2022, 20:13:53] Got SIGTERM, shutting down Homebridge...
[18/07/2022, 20:13:53] [CameraUI] Driveway: Configuring unbridged accessory...
[18/07/2022, 20:13:53] [CameraUI] Driveway: Setting up accessory...
[18/07/2022, 20:13:53] [CameraUI] Front Camera: Configuring unbridged accessory...
[18/07/2022, 20:13:53] [CameraUI] Front Camera: Setting up accessory...
[18/07/2022, 20:13:53] [CameraUI] ESP-Roamer: Configuring unbridged accessory...
[18/07/2022, 20:13:53] [CameraUI] ESP-Roamer: Setting up accessory...
[18/07/2022, 20:13:53] [CameraUI] Accessories refreshed and config.json saved!
[7/18/2022, 8:13:53 PM] [InsteonUI] Hub/PLM info is {
  raw: '026053c0c403159e',
  type: '60',
  id: '53C0C4',
  deviceCategory: { id: 3, name: 'Network Bridges' },
  deviceSubcategory: { id: 21 },
  firmwareVersion: '9e'
}
[18/07/2022, 20:13:53] Driveway DDE6 is running on port 44653.
[18/07/2022, 20:13:53] Please add [Driveway DDE6] manually in Home app. Setup Code: 987-14-803
[18/07/2022, 20:13:53] Front Camera 6479 is running on port 42769.
[18/07/2022, 20:13:53] Please add [Front Camera 6479] manually in Home app. Setup Code: 987-14-803
[18/07/2022, 20:13:53] ESP-Roamer F7E5 is running on port 38537.
[18/07/2022, 20:13:53] Please add [ESP-Roamer F7E5] manually in Home app. Setup Code: 987-14-803
[18/07/2022, 20:13:58] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
[18/07/2022, 20:14:03] [HB Supervisor] Restarting Homebridge...
kuestess commented 1 year ago

@pivotal-jbarrett @ctgreybeard Will have a fix shortly - leftover code from the refactor that needed to be removed.

kuestess commented 1 year ago

@pivotal-jbarrett @ctgreybeard Fix now live in 0.5.1.

jake-at-work commented 1 year ago

@kuestess It works again! Thanks!