kuestess / homebridge-platform-insteonlocal

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

Scene creation: hang #251

Closed JimCSaratoga closed 2 years ago

JimCSaratoga commented 2 years ago

@kuestess when you have a chance can you advise me if I'm doing something wrong. I'm trying to create a scene (assigning a group number 99) on a new hub with three devices. The three devices are 2 2477S switches and a Keypad with all the keys defined. (the Driveway key on the 6-button keypad is the top right of the four buttons in the middle - which if I understand this correctly is C and Group 4).

When I click create scene the webpage hangs and never returns.
Please see the attached screenshot.

Any thoughts? Thanks in advance!

Screen Shot 2022-05-22 at 11 31 46 AM
kuestess commented 2 years ago

@JimCSaratoga Looks good, but you'll probably want the Keypad button as a controller and responder so it can initiate the scene too. When you submit and it hangs, can you post what you get in the log?

64Spaces commented 2 years ago

I might be mistaken. But isn’t the key on the 6-button keypad on the top right of the four buttons in the middle supposed to be D? Essentially, C, D, E, F?

JimCSaratoga commented 2 years ago

@64Spaces Yes because it's the same hardware as an 8 button so when in the 6 button configuration they start out as C / D E / F

But I read somewhere when building a scene with the express server you need to specify the number of the button on the keypad you want to use, which for a 6 button I want to turn on the D light so that's button "group" 4 @kuestess am I correct on this?

@kuestess my docker container must have been corrupted when the Synology updated its DSM... (got to love it) so I'm not able to see the logs or get it running - time to build another Homebridge container...

JimCSaratoga commented 2 years ago

@kuestess I've recreated the configuration on a spare hoobs and turned on debugging. I don't see the same lighter text debugging as I have with a standard homebridge install so am not appreciating the debugging messages coming from Homebridge or your plugin out of hoobs. That said I was able to create one scene (the one above) after resetting all of the switches and the keypad, but when I did this same procedure for another scene using that same keypad it hangs at "Getting links and devices from Hub..." One other thing I noticed is that in the Express server webpages the "get Hub info" crashes the plugin (unfortunately without any debug information). At a loss here and sorry that there isn't any extra information.

JimCSaratoga commented 2 years ago

@kuestess ok back up again - error message:

ypeError: self.hubDevices.findIndex is not a function at _getRampRate (/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2731:38) at /homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2713:18 at Array.forEach () at /homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2711:24 at Array.forEach () at InsteonUI.buildHubSceneData (/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2693:12) at InsteonUI.renderHubPage (/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:274:7) at InsteonUI.handleRequest (/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:1597:8) at Layer.handle [as handle_request] (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/index.js:328:13)

JimCSaratoga commented 2 years ago

Had another crash (homebridge again) but it doesn't look related:

Created backup of previous config Done writing Insteon config Reading devices from insteon.json Found Front Entrance Lanterns in homebridge config [5/23/2022, 11:00:32 AM] TypeError: self.hubDevices.push is not a function at /homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2323:22 at Array.forEach () at /homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2296:15 at /homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/q/q.js:2055:17 at runSingle (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/q/q.js:137:13) at flush (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/q/q.js:125:13) at processTicksAndRejections (node:internal/process/task_queues:78:11) [5/23/2022, 11:00:32 AM] Got SIGTERM, shutting down Homebridge... Building Hub scene data... TypeError: self.hubDevices.findIndex is not a function at _getRampRate (/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2731:38) at /homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2713:18 at Array.forEach () at /homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2711:24 at Array.forEach () at InsteonUI.buildHubSceneData (/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:2693:12) at InsteonUI.renderHubPage (/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:274:7) at InsteonUI.handleRequest (/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:1597:8) at Layer.handle [as handle_request] (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/index.js:328:13) [5/23/2022, 11:00:37 AM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [5/23/2022, 11:00:42 AM] [HB Supervisor] Restarting Homebridge... [5/23/2022, 11:00:42 AM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules -D [5/23/2022, 11:00:43 AM] [HB Supervisor] Started Homebridge v1.4.1 with PID: 14328 [5/23/2022, 11:00:43 AM] Loaded config.json with 0 accessories and 2 platforms. [5/23/2022, 11:00:43 AM] Loaded 0 cached accessories from cachedAccessories. [5/23/2022, 11:00:43 AM] --- [5/23/2022, 11:00:45 AM] Loaded plugin: homebridge-platform-insteonlocal@0.4.28 homebridge API version: 2.7 [5/23/2022, 11:00:45 AM] Registering platform 'homebridge-platform-insteonlocal.InsteonLocal' [5/23/2022, 11:00:45 AM] --- [5/23/2022, 11:00:45 AM] Loaded plugin: homebridge-config-ui-x@4.45.0 [5/23/2022, 11:00:45 AM] Registering platform 'homebridge-config-ui-x.config' [5/23/2022, 11:00:45 AM] --- [5/23/2022, 11:00:45 AM] Loading 2 platforms... [5/23/2022, 11:00:45 AM] [Config] Initializing config platform... [5/23/2022, 11:00:45 AM] [Config] Running in Service Mode [5/23/2022, 11:00:45 AM] [InsteonLocal] Initializing InsteonLocal platform... Initializing Insteon UI

kuestess commented 2 years ago

@JimCSaratoga Based upon the above, it looks like an issue with your Insteon.json - the plugin loads that at startup to build self.hubDevices which seems to be the source for these errors. Maybe a permissions problem with your Insteon.json or some corruption?

JimCSaratoga commented 2 years ago

@JimCSaratoga Based upon the above, it looks like an issue with your Insteon.json - the plugin loads that at startup to build self.hubDevices which seems to be the source for these errors. Maybe a permissions problem with your Insteon.json or some corruption?

I'll take a look thanks @kuestess

JimCSaratoga commented 2 years ago

@kuestess permissions from terminal:

-rw-r--r-- 1 abc users 104534 May 23 19:29 insteon.json

kuestess commented 2 years ago

@JimCSaratoga That looks correct - same permissions from inside the container as well?

JimCSaratoga commented 2 years ago

Serves me right for using Docker :D I'll go and google how to access the container volume and check - thank you @kuestess

kuestess commented 2 years ago

@JimCSaratoga From terminal: docker exec -it homebridgecontainername /bin/bash

kuestess commented 2 years ago

@JimCSaratoga You might try nuking/renaming your Insteon.json, restart homebridge, get devices from the devices page and see if that fixes it.

JimCSaratoga commented 2 years ago

i just renamed my insteon.json and then restarted - saw the new insteon.json was created then came across this error when i went to get hub info (using the button)

Getting all device links TypeError: Cannot read properties of undefined (reading 'forEach') at InsteonUI.handleRequest (/homebridge/node_modules/homebridge-platform-insteonlocal/insteon-ui.js:1791:19) at Layer.handle [as handle_request] (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/index.js:328:13) at /homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/index.js:286:9 at Function.process_params (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/index.js:346:12) at next (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/index.js:280:10) at expressInit (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/middleware/init.js:40:5) at Layer.handle [as handle_request] (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/homebridge/node_modules/homebridge-platform-insteonlocal/node_modules/express/lib/router/index.js:328:13) at /homebridge/node_modules/homebr

JimCSaratoga commented 2 years ago

still working on checking the docker permissions - terminal doesn't have a path to that command

kuestess commented 2 years ago

@JimCSaratoga You may just need to change the above command from /bin/bash to /bin/sh

JimCSaratoga commented 2 years ago

might have an issue with this device (it's a standard 2477S that works):

Done getting links for 330B8F Getting device info for 330D78 Error getting device info Getting operating flags for 330D78 Error getting operating flags (ED) Flags (SD): "FF" Getting database delta for 330D78 dbDelta: 05 Getting device links for 330D78 linkArray: [] No links returned from 330D78 Error getting links for 330D78 Getting device info for 31F6CC Getting operating flags for 31F6CC Flags (ED): ["01","01","00","00","20","20","1C","FE","3F","00","01","00","00","00"] Flags (SD): "00" Getting database delta for 31F6CC dbDelta: 04 Getting device links for 31F6CC linkArray: [ {

JimCSaratoga commented 2 years ago

@kuestess i've been working on this all day. It appears that the permissions in the container are ok. What I found is that there are a lot of odd links on the keypad (that has always been the source of all of my cases that I've opened). I've noticed that when I remove some of those (e.g. addresses that are not a part of the hub and frankly I have no idea where they came from) the scenes complete. At times they complete but after closing the dialog box that was hanging. There are also log entries where it says Scene completed! (or something like that) then it issues an error. Then I see scene completed! again. Not sure what to think about that. Question for you is it better to manually link the devices with the set button or use the Link tab? If using the link tab is there a way to just add a symmetric link using the scene fields? E.g. Driveway 1 lanterns is linked as a responder to the keypad but not Driveway 2 lanterns both of them should be controllers/ responders. I would want to do a group 1 symmetrical link but I don't want to blow away everything else in the group 1 when looking at the keypad (hopefully this makes sense). that and I still have no clue what to put into the level fields or ramp rates. Can you point me to guidance on that? Thanks!!!

kuestess commented 2 years ago

@JimCSaratoga Not sure exactly what you mean by 'scene completed' in the log - is that for operating scenes, or creating them? I would probably start by cleaning up the unknown links on the device page such that all of the links make sense (ie, you know what devices they are). I don't think what you're proposing above is possible via tap linking and would require the app (now dead) or software. Any scenes created there only add to the link database, but won't blow away anything.

JimCSaratoga commented 2 years ago

sorry that was creating a scene.

@kuestess any thoughts about (assuming it's a variable) link.at is ?

here's what I'm seeing on the log: Creating scene... Sucessfully created scene! Creating scene... [5/24/2022, 8:19:39 PM] [InsteonLocal] Received command for 423292 [5/24/2022, 8:19:39 PM] [InsteonLocal] Found 1 accessories matching 423292 [5/24/2022, 8:19:39 PM] [InsteonLocal] Hub command: {"standard":{"type":"50","id":"423292","gatewayId":"49EBED","extended":false,"messageType":1,"hopsLeft":0,"maxHops":3,"command1":"2F","command2":"00","raw":"025042329249EBED232F00"}} [5/24/2022, 8:19:39 PM] [InsteonLocal] Got event for Front Yard Garage Entry Lantern (423292) Sucessfully created scene! Creating scene... Error creating scene: Error: Cannot update link - link.at is invalid Error creating scene Saved new insteon config Created backup of previous config Done writing Insteon config Reading devices from insteon.json

I'll go through the links again and see what doesn't look correct.