kuestess / homebridge-platform-insteonlocal

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

New install of homebridge RPi, insteonlocal crashes HB, no insteon.local? #266

Closed ctgreybeard closed 2 years ago

ctgreybeard commented 2 years ago

I've imaged a new install of Homebridge RPi and am configuring it to match the older one I was already running.

When I restarted the server it crashed starting the plugin and I could see that the error said that insteon.json was missing. I tried creating an empty on but that lead to other errors and it's still crashing.

How do I make an insteon.json that will allow me to continue?

ctgreybeard commented 2 years ago

Here is the log from the current crash. I had tried creating an insteon.json with only "{}" in it. An empty one fails also.

[10/07/2022, 10:21:29] [HB Supervisor] Starting Homebridge with extra flags: -I -P /var/lib/homebridge/node_modules --strict-plugin-resolution
[10/07/2022, 10:21:29] [HB Supervisor] Started Homebridge v1.5.0 with PID: 2322
[10/07/2022, 10:21:30] Loaded config.json with 0 accessories and 4 platforms.
[10/07/2022, 10:21:30] Loaded 0 cached accessories from cachedAccessories.
[10/07/2022, 10:21:30] ---
[10/07/2022, 10:21:31] Loaded plugin: homebridge-automation-switches@3.2.1
[10/07/2022, 10:21:31] Registering platform 'homebridge-automation-switches.AutomationSwitches'
[10/07/2022, 10:21:31] ---
[10/07/2022, 10:21:31] Loaded plugin: homebridge-camera-ui@5.0.27
[10/07/2022, 10:21:31] Registering platform 'homebridge-camera-ui.CameraUI'
[10/07/2022, 10:21:31] ---
[10/07/2022, 10:21:32] Loaded plugin: homebridge-platform-insteonlocal@0.4.28
homebridge API version: 2.7
[10/07/2022, 10:21:32] Registering platform 'homebridge-platform-insteonlocal.InsteonLocal'
[10/07/2022, 10:21:32] ---
[10/07/2022, 10:21:32] Loading 4 platforms...
[10/07/2022, 10:21:32] [AutomationSwitches] Initializing AutomationSwitches platform...
[10/07/2022, 10:21:32] [AutomationSwitches] AutomationSwitchesPlatform Plugin Loaded - Version 3.2.1
[10/07/2022, 10:21:32] [AutomationSwitches] Found automation switch in config: "isSummer"
[10/07/2022, 10:21:32] [AutomationSwitches] Switch isSummer is stored in file switch.6E37ED9207B2.json
[10/07/2022, 10:21:32] [AutomationSwitches] Found automation switch in config: "isChristmas"
[10/07/2022, 10:21:32] [AutomationSwitches] Switch isChristmas is stored in file switch.6AD212838781.json
[10/07/2022, 10:21:32] [AutomationSwitches] Found automation switch in config: "onVacation"
[10/07/2022, 10:21:32] [AutomationSwitches] Switch onVacation is stored in file switch.5396A8FEBCBD.json
[10/07/2022, 10:21:32] Initializing platform accessory 'isSummer'...
[10/07/2022, 10:21:32] Initializing platform accessory 'isChristmas'...
[10/07/2022, 10:21:32] Initializing platform accessory 'onVacation'...
[10/07/2022, 10:21:32] [CameraUI] Initializing CameraUI platform...
[10/07/2022, 10:21:32] [InsteonLocal] Initializing InsteonLocal platform...
Initializing Insteon UI
Reading config from /var/lib/homebridge/config.json
Found 4 platform(s) in config
Reading devices from insteon.json
[10/07/2022, 10:21:32] TypeError: Cannot read properties of undefined (reading 'info')
    at InsteonUI.loadInsteonConfig (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2217:39)
    at InsteonUI.init (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:120:7)
    at new InsteonUI (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:17:7)
    at new InsteonLocalPlatform (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/index.js:56:7)
    at /var/lib/homebridge/node_modules/homebridge/src/server.ts:473:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/var/lib/homebridge/node_modules/homebridge/src/server.ts:400:27)
    at Server.start (/var/lib/homebridge/node_modules/homebridge/src/server.ts:176:29)
[10/07/2022, 10:21:32] Got SIGTERM, shutting down Homebridge...
ctgreybeard commented 2 years ago

I found the original error:

[10/07/2022, 10:09:08] [InsteonLocal] Initializing InsteonLocal platform...
Initializing Insteon UI
Reading config from /var/lib/homebridge/config.json
Found 4 platform(s) in config
Creating new insteon.json
No devices in config
[10/07/2022, 10:09:08] TypeError: "path" is not defined: undefined
    at new SerialPort (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/@serialport/stream/lib/index.js:116:11)
    at Insteon.serial (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/home-controller/lib/Insteon/index.js:153:17)
    at InsteonLocalPlatform.connectToHub (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/index.js:440:7)
    at new InsteonLocalPlatform (/var/lib/homebridge/node_modules/homebridge-platform-insteonlocal/index.js:306:8)
    at /var/lib/homebridge/node_modules/homebridge/src/server.ts:473:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/var/lib/homebridge/node_modules/homebridge/src/server.ts:400:27)
    at Server.start (/var/lib/homebridge/node_modules/homebridge/src/server.ts:176:29)
[10/07/2022, 10:09:08] Got SIGTERM, shutting down Homebridge...

Although it claims to create a new insteon.json none was created.

ctgreybeard commented 2 years ago

I think I have it!

I had not defined the "host" for the PLM.

ctgreybeard commented 2 years ago

Question: In my much older version's config I had the model defined as "2413" but that isn't a choice in the config UI now, only "PLM". I am using "2413" now but should I use "PLM"? It shows as a null in the config UI but seems to be working OK.

kuestess commented 2 years ago

@ctgreybeard Either PLM or 2413 will work. The code uses a serial connection for any model other than 2242 or 2245.

ctgreybeard commented 2 years ago

Thanks! I think I'll leave it for now.

For what it's worth I did a full bare build with the Homebridge RPi image then rebuilt my configuration from the ground up with that. I'm back running again and very happy. I never had a GUI before nor have I used the Insteonlocal web interface but I used both of them today. I have some minor cleanup to do like finishing the linking which requires legwork up and down the stairs but all seems to be running well.

Thanks for being available!