NRCHKB / node-red-contrib-homekit-bridged

Node-RED Contribution - HomeKit Bridged : Node-RED nodes to simulate Apple HomeKit devices.
https://nrchkb.github.io
MIT License
412 stars 52 forks source link

[Bug]: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined #359

Closed macinspak closed 3 years ago

macinspak commented 3 years ago

Describe the bug Difficult to reproduce, I have it currently.

I have had this running successfully for a long time, then (all of a sudden, no changes, yeah- I know) and I was getting "no response", I removed the bridge from home.app but now cannot re-add the bridge, it doesn't appear in the home.app at all

To Reproduce not sure

Desktop (please complete the following information):

Additional context running debug

DEBUG=NRCHKB*,HAP-NodeJS*,Accessory,HAPServer,EventedHTTPServer node-red

I get a lot of these first in the debug output:

  NRCHKB:HAPServiceNode Starting Parent Service Pool 1 +6ms
  NRCHKB:AccessoryUtils Looking for accessory with service subtype '172f1edd-389b-4c45-96d4-47e37a130118'... +0ms
  NRCHKB:AccessoryUtils ... didn't find it. Adding new accessory with name 'Pool 1' and UUID '1316cdc7-e142-4a55-9a93-fea8fce35aa5' +0ms
  NRCHKB:HAPServiceNode Starting Parent Service Pool 2 +6ms
  NRCHKB:AccessoryUtils Looking for accessory with service subtype 'fd02bca6-d5c5-4777-9d45-73cea71e4b6d'... +0ms
  NRCHKB:AccessoryUtils ... didn't find it. Adding new accessory with name 'Pool 2' and UUID '4a78594b-60fa-470d-a192-cb14e75910e6' +1ms

Then a lot of these:

(node:30289) UnhandledPromiseRejectionWarning: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:286:27)
    at Bridge.Accessory._this.addBridgedAccessories (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:311:23)
    at Object.getOrCreate (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/utils/AccessoryUtils.js:80:20)
    at configure (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:118:40)
    at preInit.init (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:38:13)
    at /home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:28:18
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:30289) 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: 21)
Shaquu commented 3 years ago

Not sure how many bridges do you have already. If not much and unpair and pair is not complex then stop node-red and clear homekit-persist folder from ~/.node-red

If problem persist then please share the flow.

Also consider upgrading node-red. You could also try using our dev version.

macinspak commented 3 years ago

OK, split off homebridge and that's now on a separate raspberry. Also ran

sudo apt-get remove avahi-daemon

upgraded to:

Node version: v14.15.4 NPM version: 6.14.10 NodeRed version: v1.2.7 NRCHKB Plugin Version: 1.2.0

Restarted node with: DEBUG=Accessory,HAPServer,EventedHTTPServer node-red-pi --trace-warnings

and still no dice, getting a lot of these:

8 Jan 11:25:15 - [info] Started flows
(node:2234) UnhandledPromiseRejectionWarning: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:286:27)
    at Bridge.Accessory._this.addBridgedAccessories (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:311:23)
    at Object.getOrCreate (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/utils/AccessoryUtils.js:80:20)
    at configure (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:118:40)
    at preInit.init (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:38:13)
    at /home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:28:18
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:2234) Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:286:27)
    at Bridge.Accessory._this.addBridgedAccessories (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:311:23)
    at Object.getOrCreate (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/utils/AccessoryUtils.js:80:20)
    at configure (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:118:40)
    at preInit.init (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:38:13)
    at /home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:28:18
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

When I search for "Cannot add a bridged Accessory with the same UUID as another bridged Accessory" it ALWAYS shows an issue with a UUID, but this error I am getting seems to be ALL ":null" - so why would it be trying to add a bunch of accessories with "null" for a UUID?

Where are they persisted? Can I delete that file or look at it to work out why it suddenly broke? Remember, I was running this fine for a year, it just suddenly broke and nothing I do seems to fix it.

Thanks.

Shaquu commented 3 years ago

Hey, like I mentioned, try to clear homekit-persist

macinspak commented 3 years ago

Sorry, forgot to mention I did that already. It didn’t help. It just seems weird it’s saying “null” is the uuid.

I am trying everything I can before removing and rebuilding the HomeKit bridge nodes.

Is it worth trying to remove just the bridges first and replace them? And maybe one at a time to try? Or do I need to rebuild everything I your opinion?

Sent from my iPad

On 8 Jan 2021, at 6:32 pm, Tadeusz Wyrzykowski notifications@github.com wrote:

 Hey, like I mentioned, try to clear homekit-persist

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

macinspak commented 3 years ago

OK, more debugging.

in HAPServiceNode.js, just before:

accessory = AccessoryUtils.getOrCreate(bridge, {
                name: node.name,
                UUID: accessoryUUID,
                manufacturer: node.manufacturer,
                serialNo: node.serialNo,
                model: node.model,
                firmwareRev: node.firmwareRev,
                hardwareRev: node.hardwareRev,
                softwareRev: node.softwareRev,
            }, subtypeUUID);

I added:

debug("%j", {
                name: node.name,
                UUID: accessoryUUID,
                manufacturer: node.manufacturer,
                serialNo: node.serialNo,
                model: node.model,
                firmwareRev: node.firmwareRev,
                hardwareRev: node.hardwareRev,
                softwareRev: node.softwareRev,
            });

to confirm all arguments being passed.

when I run it now, I get these:

  NRCHKB:HAPServiceNode Starting Parent Service Pool 7 +3ms
  NRCHKB:HAPServiceNode {"name":"Pool 7","UUID":"bee75013-69d3-4ce8-9b85-2c478417e9b3","manufacturer":"Smarthome","serialNo":"Pool7","model":"1","firmwareRev":"","hardwareRev":"","softwareRev":""} +2ms
  NRCHKB:AccessoryUtils Looking for accessory with service subtype 'd88747aa-90d6-46d3-acc6-586dbd131cc1'... +0ms
  NRCHKB:AccessoryUtils ... didn't find it. Adding new accessory with name 'Pool 7' and UUID 'bee75013-69d3-4ce8-9b85-2c478417e9b3' +0ms

Which indicates the UUID is correctly being sent through. After the call, I get the UnhandledPromiseRejection:

(node:3135) UnhandledPromiseRejectionWarning: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:286:27)

If you look at that code, you can see it's a simple iterative equality search:

    // check for UUID conflict
    for (var index in this.bridgedAccessories) {
      var existing = this.bridgedAccessories[index];
      if (existing.UUID === accessory.UUID)
        throw new Error("Cannot add a bridged Accessory with the same UUID as another bridged Accessory: " + existing.UUID);
    }

The weird thing is, the first call to this has zero accessories, but it has a single 'NaN' index. So the check always fails on each accessory being added and throws an error each time, but the array grows! [NaN] -> [0, NaN] -> [0, 1, NaN] ->.. etc

That's why it's throwing the errors I reported earlier.

I temporarily "fixed" (hacked) it to get past that check, though it's a worry the bridge has one "NaN" accessory. And I put in some debug to work out the accessory being added:

{
   "_events":{

   },
   "_eventsCount":0,
   "displayName":"Pool 7",
   "UUID":"bee75013-69d3-4ce8-9b85-2c478417e9b3",
   "aid":null,
   "_isBridge":false,
   "bridged":false,
   "bridgedAccessories":[

   ],
   "reachable":true,
   "category":1,
   "services":[
      {
         "_events":{

         },
         "_eventsCount":2,
         "displayName":"",
         "UUID":"0000003E-0000-1000-8000-0026BB765291",
         "iid":null,
         "name":null,
         "characteristics":[
            {
               "_events":{

               },
               "_eventsCount":2,
               "displayName":"Identify",
               "UUID":"00000014-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":false,
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"bool",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pw"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":1,
               "displayName":"Manufacturer",
               "UUID":"00000020-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":"Smarthome",
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"string",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":1,
               "displayName":"Model",
               "UUID":"00000021-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":"1",
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"string",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":1,
               "displayName":"Name",
               "UUID":"00000023-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":"Pool 7",
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"string",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":1,
               "displayName":"Serial Number",
               "UUID":"00000030-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":"Pool7",
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"string",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":1,
               "displayName":"Firmware Revision",
               "UUID":"00000052-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":"0.0.0",
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"string",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            }
         ],
         "optionalCharacteristics":[
            {
               "_events":{

               },
               "_eventsCount":0,
               "displayName":"Accessory Flags",
               "UUID":"000000A6-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":0,
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"uint32",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr",
                     "ev"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":0,
               "displayName":"App Matching Identifier",
               "UUID":"000000A4-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":null,
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"tlv8",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":0,
               "displayName":"Configured Name",
               "UUID":"000000E3-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":"",
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"string",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr",
                     "pw",
                     "ev"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":0,
               "displayName":"Firmware Revision",
               "UUID":"00000052-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":"",
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"string",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":0,
               "displayName":"Hardware Revision",
               "UUID":"00000053-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":"",
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"string",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":0,
               "displayName":"Software Revision",
               "UUID":"00000054-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":"",
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"string",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            },
            {
               "_events":{

               },
               "_eventsCount":0,
               "displayName":"Product Data",
               "UUID":"00000220-0000-1000-8000-0026BB765291",
               "iid":null,
               "value":null,
               "status":null,
               "eventOnlyCharacteristic":false,
               "subscriptions":0,
               "props":{
                  "format":"data",
                  "unit":null,
                  "minValue":null,
                  "maxValue":null,
                  "minStep":null,
                  "perms":[
                     "pr"
                  ]
               }
            }
         ],
         "isHiddenService":false,
         "isPrimaryService":false,
         "linkedServices":[

         ]
      }
   ],
   "shouldPurgeUnusedIDs":true,
   "controllers":{

   },
   "_setupID":null,
   "controllerStorage":{
      "initialized":false,
      "fileCreated":false,
      "purgeUnidentifiedAccessoryData":true,
      "trackedControllers":[

      ],
      "controllerData":{

      },
      "accessoryUUID":"bee75013-69d3-4ce8-9b85-2c478417e9b3"
   }
}

Now I also deleted the "homekit-persist" folder and removed the bridge in the flows and deployed all flows. It complained of no bridge for each accessory, but didn't throw any errors. I then rebooted.

It get's past the null UUID issue now, but even with the new bridges and the deleted homekit persist and the replaced bridge, I get this error:

(node:3775) UnhandledPromiseRejectionWarning: TypeError: accessory.on is not a function
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:297:23)
    at Bridge.Accessory._this.addBridgedAccessories (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:315:23)
    at Object.getOrCreate (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/utils/AccessoryUtils.js:80:20)
    at configure (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:118:40)
    at preInit.init (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:38:13)
    at /home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:28:18
    at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:3775) TypeError: accessory.on is not a function
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:297:23)
    at Bridge.Accessory._this.addBridgedAccessories (/home/pi/.node-red/node_modules/hap-nodejs/dist/lib/Accessory.js:315:23)
    at Object.getOrCreate (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/utils/AccessoryUtils.js:80:20)
    at configure (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:118:40)
    at preInit.init (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:38:13)
    at /home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:28:18

which is now beyond me. I don't get how the accessory I am adding can be missing the "on" function. Is it somehow being corrupted when homekit-bridged is creating the object as an accessory?

Any thoughts?

Shaquu commented 3 years ago

@macinspak is it possible that you have two Bridge config nodes with the same name?

// Update. I just checked. Two Bridges with the same name are not causing this issue. Can you share your flow?

Shaquu commented 3 years ago

@macinspak It is possibly resolved in hap-nodejs beta (addBridgedAccessory code changed a little) I was trying to run one from master, and it was written bad.

You can try it on our canary branch: https://www.npmjs.com/package/node-red-contrib-homekit-bridged/v/1.3.0-canary.0 npm i node-red-contrib-homekit-bridged@1.3.0-canary.0

macinspak commented 3 years ago

OK, I can't get anywhere with this.

I tried the canary branch, got some different issues with serial number being too short and such, but resolved those and it was still failing.

I then deleted all nodes and config nodes for homekit bridged and got to a vanilla install. Created a new bridge and it deploys fine (though not seen by homekit app and cannot pair or find it) and then I add an accessory and it starts throwing errors again!

I can't work it out, it was working fine before.

Flow:

[{"id":"b823608e.9747f","type":"mqtt out","z":"e6d22196.bc1ac","name":"","topic":"switch/EnsuiteSwitch/cmnd/POWER3","qos":"1","retain":"true","broker":"44bdbb14.7e6274","x":830,"y":540,"wires":[]},{"id":"a2d156f4.0061a8","type":"function","z":"e6d22196.bc1ac","name":"On/Off","func":"msg.payload = {\n    \"On\": msg.payload == \"ON\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":190,"y":480,"wires":[["bec8afcc.b86ec"]]},{"id":"ef0f1e5e.0cc51","type":"switch","z":"e6d22196.bc1ac","name":"From Homekit","property":"hap","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":380,"y":540,"wires":[["dbea081.b3df4f8"]]},{"id":"dbea081.b3df4f8","type":"function","z":"e6d22196.bc1ac","name":"On/Off","func":"msg.payload = (msg.payload && msg.payload.On) ? \"ON\" : \"OFF\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":570,"y":540,"wires":[["b823608e.9747f","8c3adedd.89e7d"]]},{"id":"8c3adedd.89e7d","type":"debug","z":"e6d22196.bc1ac","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":730,"y":480,"wires":[]},{"id":"bec8afcc.b86ec","type":"homekit-service","z":"e6d22196.bc1ac","isParent":true,"hostType":"0","bridge":"8cb8961e.cbe378","accessoryId":"","parentService":"","name":"EnsuiteGlass","serviceName":"Switch","topic":"switch","filter":false,"manufacturer":"NRCHKB","model":"78635987","serialNo":"Default Serial Number","firmwareRev":"1.130.29","hardwareRev":"1.130.29","softwareRev":"1.130.29","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{}","waitForSetupMsg":false,"outputs":2,"x":370,"y":480,"wires":[["ef0f1e5e.0cc51"],[]]},{"id":"44bdbb14.7e6274","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"8cb8961e.cbe378","type":"homekit-bridge","bridgeName":"Homered","pinCode":"123-44-925","port":"","allowInsecureRequest":false,"manufacturer":"Andrew","model":"1.130.29","serialNo":"75976539","firmwareRev":"1.130.29","hardwareRev":"1.130.29","softwareRev":"1.130.29","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":true}]

any ideas?

Oh, and it has never recreated the homekit-persist folder. presumably because it has never managed to create accessories?

Shaquu commented 3 years ago

Okay, good information that your flow works for me. It looks like it is your setup issue (maybe some files are corrupted?) Maybe you can launch it on clean rpi installation? Or in docker?

macinspak commented 3 years ago

OK, I deleted the node_modules and reset to all supported releases, then npm i

so the only things I left in place were the cred.json and flows.json essentially (and settings.json)

the flows run fine, even if I create the bridge node it does not throw errors. But it does not seem to write homekit_persist either (with no accessories) (to be clear, homekit_persist is completely empty, writable and owned by the right process - and remains empty after anything I do - but I did clear it to try and debug this, so when it was working it was persisting stuff)

The moment I add an accessory, it throws this (with some extra debugging):

NRCHKB:HAPHostNode Setting name to Homered +0ms
  NRCHKB:HAPHostNode Creating Bridge with name 'Homered' and UUID 'f01002cf-958b-4a49-8c39-bca1d69ad92b' +3ms
15 Jan 11:06:17 - [info] [AnamicoLightFxChristmas:2c7415d7.8b8eaa] festive = false
15 Jan 11:06:17 - [info] Started flows
  NRCHKB:HAPServiceNode Starting Parent Service EnsuiteGlass +0ms
  NRCHKB:AccessoryUtils Looking for accessory with service subtype '6292cb7d-6739-4b6f-b454-87667040c721'... +0ms
  NRCHKB:AccessoryUtils ... didn't find it. Adding new accessory with name 'EnsuiteGlass' and UUID '174dffc0-d0b5-48c6-8c3d-3ea511935dce' +0ms

  HAP-NodeJS:Accessory accessory = { ... "displayName": "EnsuiteGlass", "UUID": "174dffc0-d0b5-48c6-8c3d-3ea511935dce" ...}
  HAP-NodeJS:Accessory _this = { ... "bridgedAccessories": [] ... }
  HAP-NodeJS:Accessory existing[NaN] = undefined
  HAP-NodeJS:Accessory accessory = undefined
  HAP-NodeJS:Accessory _this = { ... "displayName": "EnsuiteGlass", "UUID": "174dffc0-d0b5-48c6-8c3d-3ea511935dce" ...}
  HAP-NodeJS:Accessory existing[0] = { ... "displayName": "EnsuiteGlass", "UUID": "174dffc0-d0b5-48c6-8c3d-3ea511935dce" ...}
  HAP-NodeJS:Accessory existing[NaN] = undefined

(node:21528) UnhandledPromiseRejectionWarning: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/hap-nodejs/src/lib/Accessory.ts:439:10)
    at Bridge.Accessory._this.addBridgedAccessories (/home/pi/.node-red/node_modules/hap-nodejs/src/lib/Accessory.ts:471:8)
    at Object.getOrCreate (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/utils/AccessoryUtils.js:73:18)
    at preInit.configure (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:128:49)
    at preInit.init (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:61:23)
    at /home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:52:18
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:21528) Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/hap-nodejs/src/lib/Accessory.ts:439:10)
    at Bridge.Accessory._this.addBridgedAccessories (/home/pi/.node-red/node_modules/hap-nodejs/src/lib/Accessory.ts:471:8)
    at Object.getOrCreate (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/utils/AccessoryUtils.js:73:18)
    at preInit.configure (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:128:49)
    at preInit.init (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:61:23)
    at /home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:52:18
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:21528) [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.
    at emitDeprecationWarning (internal/process/promises.js:180:11)
    at processPromiseRejections (internal/process/promises.js:249:13)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)

Which seems for a single accessory, it seems to call "addBridgedAccessory" twice to add it? It actually shows on the second time around as it is already in the bridge as a bridgedAccessory, so it will always find it as a duplicate and always fail? The error however is reporting on "UUID: undefined" as it seems to be reporting on the last index accessory which is at index "NaN" in the array (which exists before the first call somehow) and the accessory is also undefined. So it's not showing the UUID of the single accessory.

at this point, I check homekit-persist and it is still empty, even if I remove the accessory and redeploy or restart node-red.

If I remove the accessory and redeploy all flows. I get this debug:

  NRCHKB:HAPHostNode Setting name to Homered +10m
  NRCHKB:HAPHostNode Creating Bridge with name 'Homered' and UUID 'f01002cf-958b-4a49-8c39-bca1d69ad92b' +4ms

And nothing else, so there is definitely only one accessory being added, when I add a single accessory, it just calls twice and of course find it's a duplicate on the second call.

About the only other thing I can put it down to is the flows.json is corrupted, but I've looked for "hiding" nodes in there and found none, and the flows all work perfectly without the accessory. Or it's an operating system level issue? But what would make NRCHKB attempt to add the same accessory twice?

Just another point, if I add 3 accessories, it tries to add ALL 3 twice, I know that because I get 3 times the errors (one for each), but the "bridgedAccessories" object array on the bridge grows as each accessory is successfully added the first time on each set of 2 calls.

Any other ideas?

Shaquu commented 3 years ago

This is very specific issue, I see it for the first time. I am still investigating what might be wrong.

It's more like HAP-NodeJS is doing it twice not NRCHKB.

Can you run npm list in node-red directory?

macinspak commented 3 years ago
pi@homered:~/node $ npm list
node-red-project@0.0.1 /home/pi/.node-red
├── @node-red-contrib-themes/midnight-red@1.4.7
├─┬ node-red-contrib-alarm@1.2.1
│ └─┬ async@2.6.1
│   └── lodash@4.17.11
├─┬ node-red-contrib-arlo@0.0.4
│ └─┬ node-arlo@1.3.2
│   ├── debug@2.6.9 deduped
│   └── request@2.88.0 deduped
├─┬ node-red-contrib-august-home@0.0.1
│ ├─┬ request@2.88.0
│ │ ├── aws-sign2@0.7.0
│ │ ├── aws4@1.8.0
│ │ ├── caseless@0.12.0
│ │ ├─┬ combined-stream@1.0.7
│ │ │ └── delayed-stream@1.0.0
│ │ ├── extend@3.0.2
│ │ ├── forever-agent@0.6.1
│ │ ├─┬ form-data@2.3.3
│ │ │ ├── asynckit@0.4.0
│ │ │ ├── combined-stream@1.0.7 deduped
│ │ │ └── mime-types@2.1.21 deduped
│ │ ├─┬ har-validator@5.1.0
│ │ │ ├─┬ ajv@5.5.2
│ │ │ │ ├── co@4.6.0
│ │ │ │ ├── fast-deep-equal@1.1.0
│ │ │ │ ├── fast-json-stable-stringify@2.0.0
│ │ │ │ └── json-schema-traverse@0.3.1
│ │ │ └── har-schema@2.0.0
│ │ ├─┬ http-signature@1.2.0
│ │ │ ├── assert-plus@1.0.0
│ │ │ ├─┬ jsprim@1.4.1
│ │ │ │ ├── assert-plus@1.0.0 deduped
│ │ │ │ ├── extsprintf@1.3.0
│ │ │ │ ├── json-schema@0.2.3
│ │ │ │ └─┬ verror@1.10.0
│ │ │ │   ├── assert-plus@1.0.0 deduped
│ │ │ │   ├── core-util-is@1.0.2 deduped
│ │ │ │   └── extsprintf@1.3.0 deduped
│ │ │ └─┬ sshpk@1.15.1
│ │ │   ├─┬ asn1@0.2.4
│ │ │   │ └── safer-buffer@2.1.2 deduped
│ │ │   ├── assert-plus@1.0.0 deduped
│ │ │   ├─┬ bcrypt-pbkdf@1.0.2
│ │ │   │ └── tweetnacl@0.14.5 deduped
│ │ │   ├─┬ dashdash@1.14.1
│ │ │   │ └── assert-plus@1.0.0 deduped
│ │ │   ├─┬ ecc-jsbn@0.1.2
│ │ │   │ ├── jsbn@0.1.1 deduped
│ │ │   │ └── safer-buffer@2.1.2 deduped
│ │ │   ├─┬ getpass@0.1.7
│ │ │   │ └── assert-plus@1.0.0 deduped
│ │ │   ├── jsbn@0.1.1
│ │ │   ├── safer-buffer@2.1.2
│ │ │   └── tweetnacl@0.14.5
│ │ ├── is-typedarray@1.0.0
│ │ ├── isstream@0.1.2
│ │ ├── json-stringify-safe@5.0.1
│ │ ├─┬ mime-types@2.1.21
│ │ │ └── mime-db@1.37.0
│ │ ├── oauth-sign@0.9.0
│ │ ├── performance-now@2.1.0
│ │ ├── qs@6.5.2
│ │ ├── safe-buffer@5.1.2
│ │ ├─┬ tough-cookie@2.4.3
│ │ │ ├── psl@1.1.29
│ │ │ └── punycode@1.4.1
│ │ ├─┬ tunnel-agent@0.6.0
│ │ │ └── safe-buffer@5.1.2 deduped
│ │ └── uuid@3.3.2
│ └─┬ request-promise-native@1.0.5
│   ├─┬ request-promise-core@1.1.1
│   │ └── lodash@4.17.11 deduped
│   ├── stealthy-require@1.1.1
│   └── tough-cookie@2.4.3 deduped
├─┬ node-red-contrib-bravia@1.2.0
│ └─┬ bravia@1.3.3
│   ├─┬ node-ssdp@4.0.1
│   │ ├── async@2.6.1 deduped
│   │ ├── bluebird@3.5.2 deduped
│   │ ├─┬ debug@3.2.7
│   │ │ └── ms@2.1.3
│   │ ├── extend@3.0.2 deduped
│   │ └── ip@1.1.5 deduped
│   ├─┬ request@2.88.2
│   │ ├── aws-sign2@0.7.0 deduped
│   │ ├── aws4@1.8.0 deduped
│   │ ├── caseless@0.12.0 deduped
│   │ ├── combined-stream@1.0.7 deduped
│   │ ├── extend@3.0.2 deduped
│   │ ├── forever-agent@0.6.1 deduped
│   │ ├── form-data@2.3.3 deduped
│   │ ├─┬ har-validator@5.1.5
│   │ │ ├─┬ ajv@6.12.6
│   │ │ │ ├── fast-deep-equal@3.1.3
│   │ │ │ ├── fast-json-stable-stringify@2.0.0 deduped
│   │ │ │ ├── json-schema-traverse@0.4.1
│   │ │ │ └── uri-js@4.2.2 deduped
│   │ │ └── har-schema@2.0.0 deduped
│   │ ├── http-signature@1.2.0 deduped
│   │ ├── is-typedarray@1.0.0 deduped
│   │ ├── isstream@0.1.2 deduped
│   │ ├── json-stringify-safe@5.0.1 deduped
│   │ ├── mime-types@2.1.21 deduped
│   │ ├── oauth-sign@0.9.0 deduped
│   │ ├── performance-now@2.1.0 deduped
│   │ ├── qs@6.5.2 deduped
│   │ ├── safe-buffer@5.1.2 deduped
│   │ ├─┬ tough-cookie@2.5.0
│   │ │ ├── psl@1.1.29 deduped
│   │ │ └── punycode@2.1.1
│   │ ├── tunnel-agent@0.6.0 deduped
│   │ └── uuid@3.3.2 deduped
│   └── xml2js@0.4.23 deduped
├── node-red-contrib-debounce@0.0.2
├─┬ node-red-contrib-denon@0.1.5
│ ├─┬ debug@3.2.6
│ │ └── ms@2.1.1
│ ├─┬ denon-avr@0.0.6 (git+https://github.com/estbeetoo/denon-avr.git#8aada5d4a38ef9efc20791b30e43362fd42358b4)
│ │ └─┬ telnet-client@0.7.0
│ │   └── bluebird@3.0.5
│ └─┬ machina@1.1.2
│   └── lodash@3.10.1
├─┬ node-red-contrib-homekit-bridged@1.2.0
│ ├─┬ debug@4.3.1
│ │ └── ms@2.1.2
│ └─┬ hap-nodejs@0.7.10
│   ├─┬ bonjour-hap@3.6.2
│   │ ├── array-flatten@2.1.2
│   │ ├─┬ deep-equal@2.0.5
│   │ │ ├─┬ call-bind@1.0.2
│   │ │ │ ├── function-bind@1.1.1 deduped
│   │ │ │ └── get-intrinsic@1.0.2 deduped
│   │ │ ├─┬ es-get-iterator@1.1.1
│   │ │ │ ├── call-bind@1.0.2 deduped
│   │ │ │ ├── get-intrinsic@1.0.2 deduped
│   │ │ │ ├── has-symbols@1.0.1
│   │ │ │ ├── is-arguments@1.1.0 deduped
│   │ │ │ ├── is-map@2.0.2
│   │ │ │ ├── is-set@2.0.2
│   │ │ │ ├── is-string@1.0.5
│   │ │ │ └── isarray@2.0.5
│   │ │ ├─┬ get-intrinsic@1.0.2
│   │ │ │ ├── function-bind@1.1.1 deduped
│   │ │ │ ├── has@1.0.3 deduped
│   │ │ │ └── has-symbols@1.0.1
│   │ │ ├─┬ is-arguments@1.1.0
│   │ │ │ └── call-bind@1.0.2 deduped
│   │ │ ├── is-date-object@1.0.2
│   │ │ ├─┬ is-regex@1.1.1
│   │ │ │ └── has-symbols@1.0.1
│   │ │ ├── isarray@2.0.5
│   │ │ ├─┬ object-is@1.1.4
│   │ │ │ ├── call-bind@1.0.2 deduped
│   │ │ │ └── define-properties@1.1.3 deduped
│   │ │ ├── object-keys@1.1.1
│   │ │ ├─┬ object.assign@4.1.2
│   │ │ │ ├── call-bind@1.0.2 deduped
│   │ │ │ ├── define-properties@1.1.3 deduped
│   │ │ │ ├── has-symbols@1.0.1
│   │ │ │ └── object-keys@1.1.1 deduped
│   │ │ ├─┬ regexp.prototype.flags@1.3.0
│   │ │ │ ├── define-properties@1.1.3 deduped
│   │ │ │ └─┬ es-abstract@1.17.7
│   │ │ │   ├─┬ es-to-primitive@1.2.1
│   │ │ │   │ ├── is-callable@1.2.2 deduped
│   │ │ │   │ ├── is-date-object@1.0.1 deduped
│   │ │ │   │ └── is-symbol@1.0.2 deduped
│   │ │ │   ├── function-bind@1.1.1 deduped
│   │ │ │   ├── has@1.0.3 deduped
│   │ │ │   ├── has-symbols@1.0.1
│   │ │ │   ├── is-callable@1.2.2
│   │ │ │   ├─┬ is-regex@1.1.1
│   │ │ │   │ └── has-symbols@1.0.1 deduped
│   │ │ │   ├── object-inspect@1.9.0 deduped
│   │ │ │   ├── object-keys@1.1.1 deduped
│   │ │ │   ├── object.assign@4.1.2 deduped
│   │ │ │   ├─┬ string.prototype.trimend@1.0.3
│   │ │ │   │ ├── call-bind@1.0.2 deduped
│   │ │ │   │ └── define-properties@1.1.3 deduped
│   │ │ │   └─┬ string.prototype.trimstart@1.0.3
│   │ │ │     ├── call-bind@1.0.2 deduped
│   │ │ │     └── define-properties@1.1.3 deduped
│   │ │ ├─┬ side-channel@1.0.4
│   │ │ │ ├── call-bind@1.0.2 deduped
│   │ │ │ ├── get-intrinsic@1.0.2 deduped
│   │ │ │ └── object-inspect@1.9.0
│   │ │ ├─┬ which-boxed-primitive@1.0.2
│   │ │ │ ├── is-bigint@1.0.1
│   │ │ │ ├─┬ is-boolean-object@1.1.0
│   │ │ │ │ └── call-bind@1.0.2 deduped
│   │ │ │ ├── is-number-object@1.0.4
│   │ │ │ ├── is-string@1.0.5 deduped
│   │ │ │ └─┬ is-symbol@1.0.3
│   │ │ │   └── has-symbols@1.0.1
│   │ │ ├─┬ which-collection@1.0.1
│   │ │ │ ├── is-map@2.0.2 deduped
│   │ │ │ ├── is-set@2.0.2 deduped
│   │ │ │ ├── is-weakmap@2.0.1
│   │ │ │ └── is-weakset@2.0.1
│   │ │ └─┬ which-typed-array@1.1.4
│   │ │   ├─┬ available-typed-arrays@1.0.2
│   │ │   │ └── array-filter@1.0.0
│   │ │   ├── call-bind@1.0.2 deduped
│   │ │   ├─┬ es-abstract@1.18.0-next.1
│   │ │   │ ├─┬ es-to-primitive@1.2.1
│   │ │   │ │ ├── is-callable@1.2.2 deduped
│   │ │   │ │ ├── is-date-object@1.0.1 deduped
│   │ │   │ │ └── is-symbol@1.0.2 deduped
│   │ │   │ ├── function-bind@1.1.1 deduped
│   │ │   │ ├── has@1.0.3 deduped
│   │ │   │ ├── has-symbols@1.0.1 deduped
│   │ │   │ ├── is-callable@1.2.2
│   │ │   │ ├── is-negative-zero@2.0.1
│   │ │   │ ├─┬ is-regex@1.1.1
│   │ │   │ │ └── has-symbols@1.0.1 deduped
│   │ │   │ ├── object-inspect@1.9.0 deduped
│   │ │   │ ├── object-keys@1.1.1 deduped
│   │ │   │ ├── object.assign@4.1.2 deduped
│   │ │   │ ├── string.prototype.trimend@1.0.3 deduped
│   │ │   │ └── string.prototype.trimstart@1.0.3 deduped
│   │ │   ├── foreach@2.0.5
│   │ │   ├── function-bind@1.1.1 deduped
│   │ │   ├── has-symbols@1.0.1
│   │ │   └─┬ is-typed-array@1.1.4
│   │ │     ├── available-typed-arrays@1.0.2 deduped
│   │ │     ├── call-bind@1.0.2 deduped
│   │ │     ├─┬ es-abstract@1.18.0-next.1
│   │ │     │ ├─┬ es-to-primitive@1.2.1
│   │ │     │ │ ├── is-callable@1.2.2 deduped
│   │ │     │ │ ├── is-date-object@1.0.1 deduped
│   │ │     │ │ └── is-symbol@1.0.2 deduped
│   │ │     │ ├── function-bind@1.1.1 deduped
│   │ │     │ ├── has@1.0.3 deduped
│   │ │     │ ├── has-symbols@1.0.1 deduped
│   │ │     │ ├── is-callable@1.2.2
│   │ │     │ ├── is-negative-zero@2.0.1 deduped
│   │ │     │ ├─┬ is-regex@1.1.1
│   │ │     │ │ └── has-symbols@1.0.1 deduped
│   │ │     │ ├── object-inspect@1.9.0 deduped
│   │ │     │ ├── object-keys@1.1.1 deduped
│   │ │     │ ├── object.assign@4.1.2 deduped
│   │ │     │ ├── string.prototype.trimend@1.0.3 deduped
│   │ │     │ └── string.prototype.trimstart@1.0.3 deduped
│   │ │     ├── foreach@2.0.5 deduped
│   │ │     └── has-symbols@1.0.1
│   │ ├── ip@1.1.5 deduped
│   │ ├─┬ multicast-dns@7.2.2
│   │ │ ├─┬ dns-packet@4.2.0
│   │ │ │ ├── ip@1.1.5 deduped
│   │ │ │ └── safe-buffer@5.1.2 deduped
│   │ │ └── thunky@1.1.0
│   │ └── multicast-dns-service-types@1.1.0
│   ├── debug@4.3.1 deduped
│   ├── decimal.js@10.2.1
│   ├── fast-srp-hap@2.0.2
│   ├── futoin-hkdf@1.3.2
│   ├─┬ node-persist@0.0.11
│   │ ├─┬ mkdirp@0.5.5
│   │ │ └── minimist@1.2.5 deduped
│   │ └── q@1.1.2
│   └── tweetnacl@1.0.3
├─┬ node-red-contrib-huemagic@3.0.0
│ ├── async@3.2.0
│ ├─┬ color-namer@1.4.0
│ │ ├── chroma-js@1.4.1
│ │ └─┬ es6-weak-map@2.0.3
│ │   ├─┬ d@1.0.1
│ │   │ ├── es5-ext@0.10.53 deduped
│ │   │ └── type@1.2.0
│ │   ├─┬ es5-ext@0.10.53
│ │   │ ├── es6-iterator@2.0.3 deduped
│ │   │ ├── es6-symbol@3.1.3 deduped
│ │   │ └── next-tick@1.0.0
│ │   ├─┬ es6-iterator@2.0.3
│ │   │ ├── d@1.0.1 deduped
│ │   │ ├── es5-ext@0.10.53 deduped
│ │   │ └── es6-symbol@3.1.3 deduped
│ │   └─┬ es6-symbol@3.1.3
│ │     ├── d@1.0.1 deduped
│ │     └─┬ ext@1.4.0
│ │       └── type@2.1.0
│ ├── colornames@1.1.1
│ ├─┬ get-image-colors@4.0.0
│ │ ├─┬ chroma-js@2.1.0
│ │ │ └─┬ cross-env@6.0.3
│ │ │   └─┬ cross-spawn@7.0.3
│ │ │     ├── path-key@3.1.1
│ │ │     ├─┬ shebang-command@2.0.0
│ │ │     │ └── shebang-regex@3.0.0
│ │ │     └─┬ which@2.0.2
│ │ │       └── isexe@2.0.0
│ │ ├─┬ get-pixels@3.3.2
│ │ │ ├── data-uri-to-buffer@0.0.3
│ │ │ ├── jpeg-js@0.3.7
│ │ │ ├── mime-types@2.1.21 deduped
│ │ │ ├─┬ ndarray@1.0.19
│ │ │ │ ├── iota-array@1.0.0
│ │ │ │ └── is-buffer@1.1.6 deduped
│ │ │ ├─┬ ndarray-pack@1.2.1
│ │ │ │ ├─┬ cwise-compiler@1.1.3
│ │ │ │ │ └── uniq@1.0.1
│ │ │ │ └── ndarray@1.0.19 deduped
│ │ │ ├── node-bitmap@0.0.1
│ │ │ ├── omggif@1.0.10
│ │ │ ├─┬ parse-data-uri@0.2.0
│ │ │ │ └── data-uri-to-buffer@0.0.3 deduped
│ │ │ ├── pngjs@3.4.0
│ │ │ ├── request@2.88.0 deduped
│ │ │ └── through@2.3.8
│ │ ├─┬ get-rgba-palette@2.0.1
│ │ │ └── quantize@1.0.2
│ │ ├─┬ get-svg-colors@1.5.1
│ │ │ ├─┬ cheerio@0.22.0
│ │ │ │ ├─┬ css-select@1.2.0
│ │ │ │ │ ├── boolbase@1.0.0
│ │ │ │ │ ├── css-what@2.1.3
│ │ │ │ │ ├─┬ domutils@1.5.1
│ │ │ │ │ │ ├── dom-serializer@0.1.1 deduped
│ │ │ │ │ │ └── domelementtype@1.3.1 deduped
│ │ │ │ │ └─┬ nth-check@1.0.2
│ │ │ │ │   └── boolbase@1.0.0 deduped
│ │ │ │ ├─┬ dom-serializer@0.1.1
│ │ │ │ │ ├── domelementtype@1.3.1
│ │ │ │ │ └── entities@1.1.2 deduped
│ │ │ │ ├── entities@1.1.2
│ │ │ │ ├─┬ htmlparser2@3.10.1
│ │ │ │ │ ├── domelementtype@1.3.1 deduped
│ │ │ │ │ ├─┬ domhandler@2.4.2
│ │ │ │ │ │ └── domelementtype@1.3.1 deduped
│ │ │ │ │ ├── domutils@1.5.1 deduped
│ │ │ │ │ ├── entities@1.1.2 deduped
│ │ │ │ │ ├── inherits@2.0.3 deduped
│ │ │ │ │ └─┬ readable-stream@3.6.0
│ │ │ │ │   ├── inherits@2.0.3 deduped
│ │ │ │ │   ├─┬ string_decoder@1.3.0
│ │ │ │ │   │ └── safe-buffer@5.2.1
│ │ │ │ │   └── util-deprecate@1.0.2 deduped
│ │ │ │ ├── lodash.assignin@4.2.0
│ │ │ │ ├── lodash.bind@4.2.1
│ │ │ │ ├── lodash.defaults@4.2.0
│ │ │ │ ├── lodash.filter@4.6.0
│ │ │ │ ├── lodash.flatten@4.4.0
│ │ │ │ ├── lodash.foreach@4.5.0
│ │ │ │ ├── lodash.map@4.6.0
│ │ │ │ ├── lodash.merge@4.6.2
│ │ │ │ ├── lodash.pick@4.4.0
│ │ │ │ ├── lodash.reduce@4.6.0
│ │ │ │ ├── lodash.reject@4.6.0
│ │ │ │ └── lodash.some@4.6.0
│ │ │ ├── chroma-js@1.4.1 deduped
│ │ │ ├─┬ is-svg@3.0.0
│ │ │ │ └── html-comment-regex@1.1.2
│ │ │ ├── lodash.compact@3.0.1
│ │ │ └── lodash.uniq@4.5.0
│ │ └── pify@5.0.0
│ ├── hex-rgb@4.2.0
│ ├─┬ huejay@1.9.0
│ │ ├─┬ axios@0.18.0
│ │ │ ├─┬ follow-redirects@1.5.9
│ │ │ │ └─┬ debug@3.1.0
│ │ │ │   └── ms@2.0.0 deduped
│ │ │ └── is-buffer@1.1.6 deduped
│ │ ├── moment@2.29.1 deduped
│ │ └── sprintf-js@1.1.2
│ ├── moment@2.29.1
│ ├─┬ request@2.88.2
│ │ ├── aws-sign2@0.7.0 deduped
│ │ ├── aws4@1.8.0 deduped
│ │ ├── caseless@0.12.0 deduped
│ │ ├── combined-stream@1.0.7 deduped
│ │ ├── extend@3.0.2 deduped
│ │ ├── forever-agent@0.6.1 deduped
│ │ ├── form-data@2.3.3 deduped
│ │ ├─┬ har-validator@5.1.5
│ │ │ ├─┬ ajv@6.12.6
│ │ │ │ ├── fast-deep-equal@3.1.3
│ │ │ │ ├── fast-json-stable-stringify@2.0.0 deduped
│ │ │ │ ├── json-schema-traverse@0.4.1
│ │ │ │ └─┬ uri-js@4.2.2
│ │ │ │   └── punycode@2.1.1
│ │ │ └── har-schema@2.0.0 deduped
│ │ ├── http-signature@1.2.0 deduped
│ │ ├── is-typedarray@1.0.0 deduped
│ │ ├── isstream@0.1.2 deduped
│ │ ├── json-stringify-safe@5.0.1 deduped
│ │ ├── mime-types@2.1.21 deduped
│ │ ├── oauth-sign@0.9.0 deduped
│ │ ├── performance-now@2.1.0 deduped
│ │ ├── qs@6.5.2 deduped
│ │ ├── safe-buffer@5.1.2 deduped
│ │ ├─┬ tough-cookie@2.5.0
│ │ │ ├── psl@1.1.29 deduped
│ │ │ └── punycode@2.1.1
│ │ ├── tunnel-agent@0.6.0 deduped
│ │ └── uuid@3.3.2 deduped
│ └── rgb-hex@3.0.0
├─┬ node-red-contrib-light@1.0.0
│ ├── async@2.6.1 deduped
│ └─┬ color-convert@1.9.3
│   └── color-name@1.1.3
├─┬ node-red-contrib-light-fx@0.1.6
│ ├── async@2.6.1 deduped
│ └── color-convert@1.9.3 deduped
├─┬ node-red-contrib-nest@0.1.9
│ └── request@2.88.0 deduped
├─┬ node-red-contrib-node-lifx@0.10.1
│ ├── async@2.6.1 deduped
│ ├── color-convert@1.9.3 deduped
│ ├─┬ color-space@1.16.0
│ │ ├── hsluv@0.0.3
│ │ └─┬ mumath@3.3.4
│ │   └── almost-equal@1.1.0
│ ├── color-temp@0.0.2
│ ├─┬ enum@2.5.0
│ │ └── is-buffer@1.1.6
│ ├─┬ lifx-lan-client@1.0.2
│ │ ├── eventemitter3@2.0.3
│ │ └── lodash@4.17.11 deduped
│ └── lodash@4.17.19
├─┬ node-red-contrib-openhab2@1.1.8
│ ├─┬ @joeybaker/eventsource@0.3.0
│ │ └─┬ original@1.0.2
│ │   └─┬ url-parse@1.4.7
│ │     ├── querystringify@2.2.0
│ │     └── requires-port@1.0.0
│ ├─┬ bootstrap-multiselect@0.9.15
│ │ └── jquery@2.1.4
│ └─┬ request@2.88.2
│   ├── aws-sign2@0.7.0 deduped
│   ├── aws4@1.8.0 deduped
│   ├── caseless@0.12.0 deduped
│   ├── combined-stream@1.0.7 deduped
│   ├── extend@3.0.2 deduped
│   ├── forever-agent@0.6.1 deduped
│   ├── form-data@2.3.3 deduped
│   ├─┬ har-validator@5.1.5
│   │ ├─┬ ajv@6.12.6
│   │ │ ├── fast-deep-equal@3.1.3
│   │ │ ├── fast-json-stable-stringify@2.0.0 deduped
│   │ │ ├── json-schema-traverse@0.4.1
│   │ │ └── uri-js@4.2.2 deduped
│   │ └── har-schema@2.0.0 deduped
│   ├── http-signature@1.2.0 deduped
│   ├── is-typedarray@1.0.0 deduped
│   ├── isstream@0.1.2 deduped
│   ├── json-stringify-safe@5.0.1 deduped
│   ├── mime-types@2.1.21 deduped
│   ├── oauth-sign@0.9.0 deduped
│   ├── performance-now@2.1.0 deduped
│   ├── qs@6.5.2 deduped
│   ├── safe-buffer@5.1.2 deduped
│   ├─┬ tough-cookie@2.5.0
│   │ ├── psl@1.1.29 deduped
│   │ └── punycode@2.1.1
│   ├── tunnel-agent@0.6.0 deduped
│   └── uuid@3.3.2 deduped
├── node-red-contrib-play-audio@2.5.0
├─┬ node-red-contrib-slack@2.0.0
│ └─┬ @slack/client@4.12.0
│   ├─┬ @types/form-data@2.2.1
│   │ └── @types/node@12.0.2 deduped
│   ├─┬ @types/is-stream@1.1.0
│   │ └── @types/node@12.0.2 deduped
│   ├── @types/node@12.0.2
│   ├─┬ @types/p-cancelable@1.0.1
│   │ └── p-cancelable@1.0.0 deduped
│   ├── @types/p-queue@2.3.2
│   ├─┬ @types/p-retry@3.0.1
│   │ └── p-retry@3.0.1 deduped
│   ├── @types/retry@0.12.0
│   ├─┬ @types/ws@5.1.2
│   │ ├── @types/events@3.0.0
│   │ └── @types/node@12.0.2 deduped
│   ├── axios@0.18.0 deduped
│   ├── eventemitter3@3.1.2
│   ├── finity@0.5.4
│   ├── form-data@2.3.3 deduped
│   ├── is-stream@1.1.0
│   ├─┬ object.entries@1.1.0
│   │ ├─┬ define-properties@1.1.3
│   │ │ └── object-keys@1.1.1 deduped
│   │ ├─┬ es-abstract@1.13.0
│   │ │ ├─┬ es-to-primitive@1.2.0
│   │ │ │ ├── is-callable@1.1.4 deduped
│   │ │ │ ├── is-date-object@1.0.1
│   │ │ │ └─┬ is-symbol@1.0.2
│   │ │ │   └── has-symbols@1.0.0
│   │ │ ├── function-bind@1.1.1 deduped
│   │ │ ├── has@1.0.3 deduped
│   │ │ ├── is-callable@1.1.4
│   │ │ ├─┬ is-regex@1.0.4
│   │ │ │ └── has@1.0.3 deduped
│   │ │ └── object-keys@1.1.1 deduped
│   │ ├── function-bind@1.1.1
│   │ └─┬ has@1.0.3
│   │   └── function-bind@1.1.1 deduped
│   ├─┬ object.getownpropertydescriptors@2.0.3
│   │ ├── define-properties@1.1.3 deduped
│   │ └── es-abstract@1.13.0 deduped
│   ├─┬ object.values@1.1.0
│   │ ├── define-properties@1.1.3 deduped
│   │ ├── es-abstract@1.13.0 deduped
│   │ ├── function-bind@1.1.1 deduped
│   │ └── has@1.0.3 deduped
│   ├── p-cancelable@1.0.0
│   ├── p-queue@2.4.2
│   ├─┬ p-retry@3.0.1
│   │ └── retry@0.12.0 deduped
│   ├── retry@0.12.0
│   └─┬ ws@5.2.2
│     └── async-limiter@1.0.0
├─┬ node-red-contrib-sonoff-tasmota-enhanced@3.1.2
│ └─┬ debug@2.6.9
│   └── ms@2.0.0
├─┬ node-red-contrib-state-machine@1.2.0
│ └── javascript-state-machine@3.1.0
├─┬ node-red-contrib-tasmota@0.9.7
│ └─┬ mqtt@2.18.8
│   ├─┬ commist@1.1.0
│   │ ├── leven@2.1.0
│   │ └── minimist@1.2.5 deduped
│   ├─┬ concat-stream@1.6.2
│   │ ├── buffer-from@1.1.1
│   │ ├── inherits@2.0.3 deduped
│   │ ├─┬ readable-stream@2.3.7
│   │ │ ├── core-util-is@1.0.2 deduped
│   │ │ ├── inherits@2.0.3 deduped
│   │ │ ├── isarray@1.0.0
│   │ │ ├── process-nextick-args@2.0.1
│   │ │ ├── safe-buffer@5.1.2 deduped
│   │ │ ├─┬ string_decoder@1.1.1
│   │ │ │ └── safe-buffer@5.1.2 deduped
│   │ │ └── util-deprecate@1.0.2 deduped
│   │ └── typedarray@0.0.6
│   ├─┬ end-of-stream@1.4.4
│   │ └─┬ once@1.4.0
│   │   └── wrappy@1.0.2
│   ├─┬ es6-map@0.1.5
│   │ ├── d@1.0.1 deduped
│   │ ├── es5-ext@0.10.53 deduped
│   │ ├── es6-iterator@2.0.3 deduped
│   │ ├─┬ es6-set@0.1.5
│   │ │ ├── d@1.0.1 deduped
│   │ │ ├── es5-ext@0.10.53 deduped
│   │ │ ├── es6-iterator@2.0.3 deduped
│   │ │ ├─┬ es6-symbol@3.1.1
│   │ │ │ ├── d@1.0.1 deduped
│   │ │ │ └── es5-ext@0.10.53 deduped
│   │ │ └── event-emitter@0.3.5 deduped
│   │ ├── es6-symbol@3.1.3 deduped
│   │ └─┬ event-emitter@0.3.5
│   │   ├── d@1.0.1 deduped
│   │   └── es5-ext@0.10.53 deduped
│   ├─┬ help-me@1.1.0
│   │ ├─┬ callback-stream@1.1.0
│   │ │ ├── inherits@2.0.3 deduped
│   │ │ └── readable-stream@2.0.6 deduped
│   │ ├─┬ glob-stream@6.1.0
│   │ │ ├── extend@3.0.2 deduped
│   │ │ ├─┬ glob@7.1.6
│   │ │ │ ├── fs.realpath@1.0.0
│   │ │ │ ├─┬ inflight@1.0.6
│   │ │ │ │ ├── once@1.4.0 deduped
│   │ │ │ │ └── wrappy@1.0.2 deduped
│   │ │ │ ├── inherits@2.0.3 deduped
│   │ │ │ ├─┬ minimatch@3.0.4
│   │ │ │ │ └─┬ brace-expansion@1.1.11
│   │ │ │ │   ├── balanced-match@1.0.0
│   │ │ │ │   └── concat-map@0.0.1
│   │ │ │ ├── once@1.4.0 deduped
│   │ │ │ └── path-is-absolute@1.0.1
│   │ │ ├─┬ glob-parent@3.1.0
│   │ │ │ ├─┬ is-glob@3.1.0
│   │ │ │ │ └── is-extglob@2.1.1
│   │ │ │ └── path-dirname@1.0.2
│   │ │ ├── is-negated-glob@1.0.0
│   │ │ ├─┬ ordered-read-streams@1.0.1
│   │ │ │ └── readable-stream@2.0.6 deduped
│   │ │ ├─┬ pumpify@1.5.1
│   │ │ │ ├── duplexify@3.7.1 deduped
│   │ │ │ ├── inherits@2.0.3 deduped
│   │ │ │ └─┬ pump@2.0.1
│   │ │ │   ├── end-of-stream@1.4.4 deduped
│   │ │ │   └── once@1.4.0 deduped
│   │ │ ├─┬ readable-stream@2.3.7
│   │ │ │ ├── core-util-is@1.0.2 deduped
│   │ │ │ ├── inherits@2.0.3 deduped
│   │ │ │ ├── isarray@1.0.0
│   │ │ │ ├── process-nextick-args@2.0.1
│   │ │ │ ├── safe-buffer@5.1.2 deduped
│   │ │ │ ├─┬ string_decoder@1.1.1
│   │ │ │ │ └── safe-buffer@5.1.2 deduped
│   │ │ │ └── util-deprecate@1.0.2 deduped
│   │ │ ├── remove-trailing-separator@1.1.0
│   │ │ ├─┬ to-absolute-glob@2.0.2
│   │ │ │ ├─┬ is-absolute@1.0.0
│   │ │ │ │ ├─┬ is-relative@1.0.0
│   │ │ │ │ │ └─┬ is-unc-path@1.0.0
│   │ │ │ │ │   └── unc-path-regex@0.1.2
│   │ │ │ │ └── is-windows@1.0.2
│   │ │ │ └── is-negated-glob@1.0.0 deduped
│   │ │ └─┬ unique-stream@2.3.1
│   │ │   ├── json-stable-stringify-without-jsonify@1.0.1
│   │ │   └─┬ through2-filter@3.0.0
│   │ │     ├── through2@2.0.5 deduped
│   │ │     └── xtend@4.0.2 deduped
│   │ ├─┬ through2@2.0.5
│   │ │ ├─┬ readable-stream@2.3.7
│   │ │ │ ├── core-util-is@1.0.2 deduped
│   │ │ │ ├── inherits@2.0.3 deduped
│   │ │ │ ├── isarray@1.0.0
│   │ │ │ ├── process-nextick-args@2.0.1
│   │ │ │ ├── safe-buffer@5.1.2 deduped
│   │ │ │ ├─┬ string_decoder@1.1.1
│   │ │ │ │ └── safe-buffer@5.1.2 deduped
│   │ │ │ └── util-deprecate@1.0.2 deduped
│   │ │ └── xtend@4.0.2 deduped
│   │ └── xtend@4.0.2 deduped
│   ├── inherits@2.0.3
│   ├── minimist@1.2.5
│   ├─┬ mqtt-packet@5.6.1
│   │ ├─┬ bl@1.2.3
│   │ │ ├─┬ readable-stream@2.3.7
│   │ │ │ ├── core-util-is@1.0.2 deduped
│   │ │ │ ├── inherits@2.0.3 deduped
│   │ │ │ ├── isarray@1.0.0
│   │ │ │ ├── process-nextick-args@2.0.1 deduped
│   │ │ │ ├── safe-buffer@5.1.2 deduped
│   │ │ │ ├─┬ string_decoder@1.1.1
│   │ │ │ │ └── safe-buffer@5.1.2 deduped
│   │ │ │ └── util-deprecate@1.0.2 deduped
│   │ │ └── safe-buffer@5.1.2 deduped
│   │ ├── inherits@2.0.3 deduped
│   │ ├── process-nextick-args@2.0.1
│   │ └── safe-buffer@5.1.2 deduped
│   ├─┬ pump@3.0.0
│   │ ├── end-of-stream@1.4.4 deduped
│   │ └── once@1.4.0 deduped
│   ├─┬ readable-stream@2.3.7
│   │ ├── core-util-is@1.0.2
│   │ ├── inherits@2.0.3 deduped
│   │ ├── isarray@1.0.0
│   │ ├── process-nextick-args@2.0.1
│   │ ├── safe-buffer@5.1.2 deduped
│   │ ├─┬ string_decoder@1.1.1
│   │ │ └── safe-buffer@5.1.2 deduped
│   │ └── util-deprecate@1.0.2
│   ├── reinterval@1.1.0
│   ├─┬ split2@2.2.0
│   │ └── through2@2.0.5 deduped
│   ├─┬ websocket-stream@5.5.2
│   │ ├─┬ duplexify@3.7.1
│   │ │ ├── end-of-stream@1.4.4 deduped
│   │ │ ├── inherits@2.0.3 deduped
│   │ │ ├── readable-stream@2.0.6 deduped
│   │ │ └── stream-shift@1.0.1
│   │ ├── inherits@2.0.3 deduped
│   │ ├─┬ readable-stream@2.3.7
│   │ │ ├── core-util-is@1.0.2 deduped
│   │ │ ├── inherits@2.0.3 deduped
│   │ │ ├── isarray@1.0.0
│   │ │ ├── process-nextick-args@2.0.1
│   │ │ ├── safe-buffer@5.1.2 deduped
│   │ │ ├─┬ string_decoder@1.1.1
│   │ │ │ └── safe-buffer@5.1.2 deduped
│   │ │ └── util-deprecate@1.0.2 deduped
│   │ ├── safe-buffer@5.1.2 deduped
│   │ ├─┬ ws@3.3.3
│   │ │ ├── async-limiter@1.0.0 deduped
│   │ │ ├── safe-buffer@5.1.2 deduped
│   │ │ └── ultron@1.1.1
│   │ └── xtend@4.0.2 deduped
│   └── xtend@4.0.2
├─┬ node-red-contrib-zblight@1.0.1
│ └─┬ xbee-api@0.6.0
│   ├── buffer-builder@0.2.0
│   ├── buffer-reader@0.0.3
│   └── safe-buffer@5.0.1
├─┬ node-red-dashboard@2.23.2
│ ├─┬ compression@1.7.4
│ │ ├─┬ accepts@1.3.7
│ │ │ ├─┬ mime-types@2.1.27
│ │ │ │ └── mime-db@1.44.0
│ │ │ └── negotiator@0.6.2
│ │ ├── bytes@3.0.0
│ │ ├─┬ compressible@2.0.18
│ │ │ └── mime-db@1.44.0
│ │ ├── debug@2.6.9 deduped
│ │ ├── on-headers@1.0.2
│ │ ├── safe-buffer@5.1.2 deduped
│ │ └── vary@1.1.2
│ ├─┬ gridstack@0.6.4
│ │ └── jquery@2.1.4 deduped
│ ├─┬ serve-static@1.14.1
│ │ ├── encodeurl@1.0.2
│ │ ├── escape-html@1.0.3
│ │ ├── parseurl@1.3.3
│ │ └─┬ send@0.17.1
│ │   ├── debug@2.6.9 deduped
│ │   ├── depd@1.1.2 deduped
│ │   ├── destroy@1.0.4
│ │   ├── encodeurl@1.0.2 deduped
│ │   ├── escape-html@1.0.3 deduped
│ │   ├── etag@1.8.1
│ │   ├── fresh@0.5.2
│ │   ├─┬ http-errors@1.7.3
│ │   │ ├── depd@1.1.2 deduped
│ │   │ ├── inherits@2.0.4
│ │   │ ├── setprototypeof@1.1.1
│ │   │ ├── statuses@1.5.0
│ │   │ └── toidentifier@1.0.0
│ │   ├── mime@1.6.0
│ │   ├── ms@2.1.1
│ │   ├── on-finished@2.3.0 deduped
│ │   ├── range-parser@1.2.1
│ │   └── statuses@1.5.0
│ └─┬ socket.io@2.3.0
│   ├─┬ debug@4.1.1
│   │ └── ms@2.1.2
│   ├─┬ engine.io@3.4.2
│   │ ├── accepts@1.3.7 deduped
│   │ ├── base64id@2.0.0
│   │ ├── cookie@0.3.1
│   │ ├─┬ debug@4.1.1
│   │ │ └── ms@2.1.2
│   │ ├─┬ engine.io-parser@2.2.0
│   │ │ ├── after@0.8.2
│   │ │ ├── arraybuffer.slice@0.0.7
│   │ │ ├── base64-arraybuffer@0.1.5 deduped
│   │ │ ├── blob@0.0.5
│   │ │ └── has-binary2@1.0.3 deduped
│   │ └── ws@7.3.1
│   ├─┬ has-binary2@1.0.3
│   │ └── isarray@2.0.1
│   ├── socket.io-adapter@1.1.2
│   ├─┬ socket.io-client@2.3.0
│   │ ├── backo2@1.0.2
│   │ ├── base64-arraybuffer@0.1.5
│   │ ├── component-bind@1.0.0
│   │ ├── component-emitter@1.2.1
│   │ ├─┬ debug@4.1.1
│   │ │ └── ms@2.1.2
│   │ ├─┬ engine.io-client@3.4.3
│   │ │ ├── component-emitter@1.3.0
│   │ │ ├── component-inherit@0.0.3
│   │ │ ├─┬ debug@4.1.1
│   │ │ │ └── ms@2.1.2
│   │ │ ├── engine.io-parser@2.2.0 deduped
│   │ │ ├── has-cors@1.1.0 deduped
│   │ │ ├── indexof@0.0.1 deduped
│   │ │ ├── parseqs@0.0.5 deduped
│   │ │ ├── parseuri@0.0.5 deduped
│   │ │ ├─┬ ws@6.1.4
│   │ │ │ └── async-limiter@1.0.0 deduped
│   │ │ ├── xmlhttprequest-ssl@1.5.5
│   │ │ └── yeast@0.1.2
│   │ ├── has-binary2@1.0.3 deduped
│   │ ├── has-cors@1.1.0
│   │ ├── indexof@0.0.1
│   │ ├── object-component@0.0.3
│   │ ├─┬ parseqs@0.0.5
│   │ │ └─┬ better-assert@1.0.2
│   │ │   └── callsite@1.0.0
│   │ ├─┬ parseuri@0.0.5
│   │ │ └── better-assert@1.0.2 deduped
│   │ ├─┬ socket.io-parser@3.3.0
│   │ │ ├── component-emitter@1.2.1 deduped
│   │ │ ├─┬ debug@3.1.0
│   │ │ │ └── ms@2.0.0
│   │ │ └── isarray@2.0.1 deduped
│   │ └── to-array@0.1.4
│   └─┬ socket.io-parser@3.4.1
│     ├── component-emitter@1.2.1 deduped
│     ├─┬ debug@4.1.1
│     │ └── ms@2.1.2
│     └── isarray@2.0.1 deduped
├── node-red-node-pi-gpio@1.1.1
├── node-red-node-ping@0.2.1
├── node-red-node-random@0.2.0
├─┬ node-red-node-serialport@0.10.3
│ └─┬ serialport@8.0.8
│   ├─┬ @serialport/binding-mock@8.0.6
│   │ ├─┬ @serialport/binding-abstract@8.0.6
│   │ │ └─┬ debug@4.1.1
│   │ │   └── ms@2.1.2
│   │ └─┬ debug@4.1.1
│   │   └── ms@2.1.2
│   ├─┬ @serialport/bindings@8.0.8
│   │ ├── @serialport/binding-abstract@8.0.6 deduped
│   │ ├── @serialport/parser-readline@8.0.6 deduped
│   │ ├─┬ bindings@1.5.0
│   │ │ └── file-uri-to-path@1.0.0
│   │ ├─┬ debug@4.1.1
│   │ │ └── ms@2.1.2
│   │ ├── nan@2.14.1
│   │ └─┬ prebuild-install@5.3.5
│   │   ├── detect-libc@1.0.3
│   │   ├── expand-template@2.0.3
│   │   ├── github-from-package@0.0.0
│   │   ├── minimist@1.2.5 deduped
│   │   ├── mkdirp@0.5.5 deduped
│   │   ├── napi-build-utils@1.0.2
│   │   ├─┬ node-abi@2.19.1
│   │   │ └── semver@5.7.1
│   │   ├── noop-logger@0.1.1
│   │   ├─┬ npmlog@4.1.2
│   │   │ ├─┬ are-we-there-yet@1.1.5
│   │   │ │ ├── delegates@1.0.0
│   │   │ │ └── readable-stream@2.0.6 deduped
│   │   │ ├── console-control-strings@1.1.0
│   │   │ ├─┬ gauge@2.7.4
│   │   │ │ ├── aproba@1.2.0
│   │   │ │ ├── console-control-strings@1.1.0 deduped
│   │   │ │ ├── has-unicode@2.0.1
│   │   │ │ ├── object-assign@4.1.1
│   │   │ │ ├── signal-exit@3.0.3
│   │   │ │ ├─┬ string-width@1.0.2
│   │   │ │ │ ├── code-point-at@1.1.0
│   │   │ │ │ ├─┬ is-fullwidth-code-point@1.0.0
│   │   │ │ │ │ └── number-is-nan@1.0.1
│   │   │ │ │ └── strip-ansi@3.0.1 deduped
│   │   │ │ ├── strip-ansi@3.0.1 deduped
│   │   │ │ └─┬ wide-align@1.1.3
│   │   │ │   └── string-width@1.0.2 deduped
│   │   │ └── set-blocking@2.0.0
│   │   ├── pump@3.0.0 deduped
│   │   ├─┬ rc@1.2.8
│   │   │ ├── deep-extend@0.6.0
│   │   │ ├── ini@1.3.5
│   │   │ ├── minimist@1.2.5 deduped
│   │   │ └── strip-json-comments@2.0.1
│   │   ├─┬ simple-get@3.1.0
│   │   │ ├─┬ decompress-response@4.2.1
│   │   │ │ └── mimic-response@2.1.0
│   │   │ ├── once@1.4.0 deduped
│   │   │ └── simple-concat@1.0.1
│   │   ├─┬ tar-fs@2.1.0
│   │   │ ├── chownr@1.1.4
│   │   │ ├── mkdirp-classic@0.5.3
│   │   │ ├── pump@3.0.0 deduped
│   │   │ └─┬ tar-stream@2.1.3
│   │   │   ├─┬ bl@4.0.3
│   │   │   │ ├─┬ buffer@5.6.0
│   │   │   │ │ ├── base64-js@1.3.1
│   │   │   │ │ └── ieee754@1.1.13
│   │   │   │ ├── inherits@2.0.4
│   │   │   │ └── readable-stream@3.6.0 deduped
│   │   │   ├── end-of-stream@1.4.4 deduped
│   │   │   ├── fs-constants@1.0.0
│   │   │   ├── inherits@2.0.3 deduped
│   │   │   └─┬ readable-stream@3.6.0
│   │   │     ├── inherits@2.0.3 deduped
│   │   │     ├─┬ string_decoder@1.3.0
│   │   │     │ └── safe-buffer@5.2.1
│   │   │     └── util-deprecate@1.0.2 deduped
│   │   ├── tunnel-agent@0.6.0 deduped
│   │   └── which-pm-runs@1.0.0
│   ├── @serialport/parser-byte-length@8.0.6
│   ├── @serialport/parser-cctalk@8.0.6
│   ├── @serialport/parser-delimiter@8.0.6
│   ├─┬ @serialport/parser-readline@8.0.6
│   │ └── @serialport/parser-delimiter@8.0.6 deduped
│   ├── @serialport/parser-ready@8.0.6
│   ├── @serialport/parser-regex@8.0.6
│   ├─┬ @serialport/stream@8.0.6
│   │ └─┬ debug@4.1.1
│   │   └── ms@2.1.2
│   └─┬ debug@4.1.1
│     └── ms@2.1.2
├── node-red-node-smooth@0.1.2
└─┬ node-red-node-wemo@0.1.17
  ├─┬ body-parser@1.14.2
  │ ├── bytes@2.2.0
  │ ├── content-type@1.0.4
  │ ├─┬ debug@2.2.0
  │ │ └── ms@0.7.1
  │ ├── depd@1.1.2
  │ ├─┬ http-errors@1.3.1
  │ │ ├── inherits@2.0.3 deduped
  │ │ └── statuses@1.5.0
  │ ├── iconv-lite@0.4.13
  │ ├─┬ on-finished@2.3.0
  │ │ └── ee-first@1.1.1
  │ ├── qs@5.2.0
  │ ├─┬ raw-body@2.1.7
  │ │ ├── bytes@2.4.0
  │ │ ├── iconv-lite@0.4.13 deduped
  │ │ └── unpipe@1.0.0
  │ └─┬ type-is@1.6.18
  │   ├── media-typer@0.3.0
  │   └─┬ mime-types@2.1.27
  │     └── mime-db@1.44.0
  ├── ip@1.0.2
  ├─┬ node-ssdp@3.2.5
  │ ├── async@2.6.1 deduped
  │ ├── bluebird@3.5.2
  │ ├── debug@2.6.9 deduped
  │ ├── extend@3.0.2 deduped
  │ └── ip@1.1.5
  ├── q@1.4.1
  ├─┬ request@2.74.0
  │ ├── aws-sign2@0.6.0
  │ ├── aws4@1.8.0 deduped
  │ ├─┬ bl@1.1.2
  │ │ └─┬ readable-stream@2.0.6
  │ │   ├── core-util-is@1.0.2 deduped
  │ │   ├── inherits@2.0.3 deduped
  │ │   ├── isarray@1.0.0
  │ │   ├── process-nextick-args@1.0.7
  │ │   ├── string_decoder@0.10.31
  │ │   └── util-deprecate@1.0.2 deduped
  │ ├── caseless@0.11.0
  │ ├── combined-stream@1.0.7 deduped
  │ ├── extend@3.0.2 deduped
  │ ├── forever-agent@0.6.1 deduped
  │ ├─┬ form-data@1.0.1
  │ │ ├── async@2.6.1 deduped
  │ │ ├── combined-stream@1.0.7 deduped
  │ │ └── mime-types@2.1.21 deduped
  │ ├─┬ har-validator@2.0.6
  │ │ ├─┬ chalk@1.1.3
  │ │ │ ├── ansi-styles@2.2.1
  │ │ │ ├── escape-string-regexp@1.0.5
  │ │ │ ├─┬ has-ansi@2.0.0
  │ │ │ │ └── ansi-regex@2.1.1
  │ │ │ ├─┬ strip-ansi@3.0.1
  │ │ │ │ └── ansi-regex@2.1.1 deduped
  │ │ │ └── supports-color@2.0.0
  │ │ ├── commander@2.20.3
  │ │ ├─┬ is-my-json-valid@2.20.5
  │ │ │ ├─┬ generate-function@2.3.1
  │ │ │ │ └── is-property@1.0.2
  │ │ │ ├─┬ generate-object-property@1.2.0
  │ │ │ │ └── is-property@1.0.2 deduped
  │ │ │ ├── is-my-ip-valid@1.0.0
  │ │ │ ├── jsonpointer@4.1.0
  │ │ │ └── xtend@4.0.2 deduped
  │ │ └─┬ pinkie-promise@2.0.1
  │ │   └── pinkie@2.0.4
  │ ├─┬ hawk@3.1.3
  │ │ ├─┬ boom@2.10.1
  │ │ │ └── hoek@2.16.3 deduped
  │ │ ├─┬ cryptiles@2.0.5
  │ │ │ └── boom@2.10.1 deduped
  │ │ ├── hoek@2.16.3
  │ │ └─┬ sntp@1.0.9
  │ │   └── hoek@2.16.3 deduped
  │ ├─┬ http-signature@1.1.1
  │ │ ├── assert-plus@0.2.0
  │ │ ├── jsprim@1.4.1 deduped
  │ │ └── sshpk@1.15.1 deduped
  │ ├── is-typedarray@1.0.0 deduped
  │ ├── isstream@0.1.2 deduped
  │ ├── json-stringify-safe@5.0.1 deduped
  │ ├── mime-types@2.1.21 deduped
  │ ├── node-uuid@1.4.8
  │ ├── oauth-sign@0.8.2
  │ ├── qs@6.2.3
  │ ├── stringstream@0.0.6
  │ ├─┬ tough-cookie@2.3.4
  │ │ └── punycode@1.4.1 deduped
  │ └── tunnel-agent@0.4.3
  ├─┬ url@0.11.0
  │ ├── punycode@1.3.2
  │ └── querystring@0.2.0
  ├─┬ util@0.10.4
  │ └── inherits@2.0.3 deduped
  └─┬ xml2js@0.4.23
    ├── sax@1.2.4
    └── xmlbuilder@11.0.1

Also happens with node-red-contrib-homekit-bridged@1.3.0-dev.29

Shaquu commented 3 years ago

Okay, new idea. First share full logs of node-red starting (since you start it until all bridges are deployed). Then check how many node-red processes are running.

macinspak commented 3 years ago

Done.

Start command: DEBUG=NRCHKB*,Accessory,HAPServer,EventedHTTPServer,HAP-NodeJS* node-red-pi --trace-warnings

Initial startup node processes (just after executing, while booting up:

root@homered:/home/pi# ps -ef | grep node
pi        7105  7292 96 13:46 pts/0    00:00:02 node --trace-warnings /usr/local/lib/node_modules/node-red/bin/../red.js

Debug output from start until after initiated:

pi@homered:~/node $ DEBUG=NRCHKB*,Accessory,HAPServer,EventedHTTPServer,HAP-NodeJS* node-red-pi --trace-warnings
16 Jan 13:47:02 - [info] 

Welcome to Node-RED
===================

16 Jan 13:47:02 - [info] Node-RED version: v1.2.7
16 Jan 13:47:02 - [info] Node.js  version: v14.15.4
16 Jan 13:47:02 - [info] Linux 4.14.71-v7+ arm LE
16 Jan 13:47:03 - [info] Loading palette nodes
  NRCHKB RED settings available +0ms
  NRCHKB HAPStorage path set to  /home/pi/.node-red/homekit-persist +2ms
  NRCHKB:api Initialize ServiceAPI +0ms
  NRCHKB:api Initialize NRCHKBVersionAPI +180ms
  NRCHKB:api Running version: 1.2.0 +0ms
  NRCHKB:api Evaluated as: 1.2.0 +1ms
  NRCHKB Registering homekit-service type +0ms
  NRCHKB Registering homekit-bridge type +0ms
16 Jan 13:47:10 - [info] Dashboard version 2.23.2 started at /ui
16 Jan 13:47:11 - [info] Settings file  : /home/pi/.node-red/settings.js
16 Jan 13:47:11 - [info] Context store  : 'default' [module=localfilesystem]
16 Jan 13:47:11 - [info] User directory : /home/pi/.node-red
16 Jan 13:47:11 - [warn] Projects disabled : editorTheme.projects.enabled=false
16 Jan 13:47:11 - [info] Flows file     : /home/pi/.node-red/flows_homered.json
16 Jan 13:47:11 - [info] Server now running at https://127.0.0.1:1880/
16 Jan 13:47:11 - [info] Starting flows
node id  a8512fc_55f94d
SecuritySystemCurrentState_a8512fc_55f94d
node id  13624ae2_88d695
SecuritySystemCurrentState_13624ae2_88d695
16 Jan 13:47:11 - [info] [openhab2-controller:OpenHAB2] {"id":"a21f148e.e0c9c8","type":"openhab2-controller","name":"OpenHAB2","protocol":"http","host":"localhost","port":"8080","path":"","username":"","password":"","_users":["7a1c490a.379558","2f7c4766.2fda88","4a577593.cbe18c","b29ace2.0a6fb3","29665223.7b8eae"]}
  NRCHKB:HAPBridgeNode Setting name to Homered +0ms
  NRCHKB:HAPBridgeNode Creating Bridge with name 'Homered' and UUID 'f01002cf-958b-4a49-8c39-bca1d69ad92b' +3ms
16 Jan 13:47:14 - [info] [AnamicoLightFxChristmas:2c7415d7.8b8eaa] festive = false
16 Jan 13:47:14 - [info] Started flows
  NRCHKB:HAPServiceNode Starting Parent Service Ensuite Glass +0ms
  NRCHKB:AccessoryUtils Looking for accessory with service subtype '1803449b-0cc0-4cd7-8139-6e853b07d5e3'... +0ms
  NRCHKB:AccessoryUtils ... didn't find it. Adding new accessory with name 'Ensuite Glass' and UUID '55a4856d-b41c-4b98-a0dc-2179d307a5ff' +0ms
(node:7105) UnhandledPromiseRejectionWarning: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/node_modules/hap-nodejs/dist/lib/Accessory.js:288:27)
    at Bridge.Accessory._this.addBridgedAccessories (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/node_modules/hap-nodejs/dist/lib/Accessory.js:313:23)
    at Object.getOrCreate (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/utils/AccessoryUtils.js:80:20)
    at configure (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:118:40)
    at preInit.init (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:38:13)
    at /home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:28:18
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:7105) Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined
    at Bridge.Accessory._this.addBridgedAccessory (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/node_modules/hap-nodejs/dist/lib/Accessory.js:288:27)
    at Bridge.Accessory._this.addBridgedAccessories (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/node_modules/hap-nodejs/dist/lib/Accessory.js:313:23)
    at Object.getOrCreate (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/utils/AccessoryUtils.js:80:20)
    at configure (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:118:40)
    at preInit.init (/home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:38:13)
    at /home/pi/.node-red/node_modules/node-red-contrib-homekit-bridged/build/lib/HAPServiceNode.js:28:18
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:7105) [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.
    at emitDeprecationWarning (internal/process/promises.js:180:11)
    at processPromiseRejections (internal/process/promises.js:249:13)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
16 Jan 13:47:14 - [info] [AnamicoAlarmStateChanged:267c7008.e3d4a] new State
16 Jan 13:47:14 - [info] [AnamicoAlarmStateChanged:267c7008.e3d4a] {
  "initialState": true,
  "payload": {
    "SecuritySystemCurrentState": 3,
    "alarmState": "Off",
    "SecuritySystemAlarmType": 0,
    "isAlarm": false
  }
}
... and more unrelated debug stuff

Once running, here is the process list:

root@homered:/home/pi# ps -ef | grep node
pi        7105  7292 22 13:46 pts/0    00:00:28 node-red

so only the one node-red process.

Just as a side question, if you put a debug in the addBridgedAccessory in hap-nodejs, do you see the same "NaN" and the same 2 calls? Or is that unique to my installation? Maybe then it can be narrowed down to my config or something.

If I modify lib/HAPServiceNode.js and add this at line 134:

debug("getOrCreate Service: %j", {
            name: node.name,
            UUID: subtypeUUID,
            serviceName: node.serviceName,
            config: config
        });
        const service = ServiceUtils.getOrCreate(accessory, {...

and this at line 118:

debug("getOrCreate Accessory: %j", {
                name: node.name,
                UUID: accessoryUUID,
                manufacturer: node.manufacturer,
                serialNo: node.serialNo,
                model: node.model,
                firmwareRev: node.firmwareRev,
                hardwareRev: node.hardwareRev,
                softwareRev: node.softwareRev,
        });
            accessory = AccessoryUtils.getOrCreate(bridge, { ...

I get this:

  NRCHKB:HAPServiceNode Starting Parent Service Ensuite Glass +0ms
  NRCHKB:HAPServiceNode getOrCreate Accessory: {"name":"Ensuite Glass","UUID":"55a4856d-b41c-4b98-a0dc-2179d307a5ff","manufacturer":"NRCHKB","serialNo":"Default Serial Number","model":"0.130.29","firmwareRev":"0.130.29","hardwareRev":"0.130.29","softwareRev":"0.130.29"} +12ms
  NRCHKB:AccessoryUtils Looking for accessory with service subtype '1803449b-0cc0-4cd7-8139-6e853b07d5e3'... +0ms
  NRCHKB:AccessoryUtils ... didn't find it. Adding new accessory with name 'Ensuite Glass' and UUID '55a4856d-b41c-4b98-a0dc-2179d307a5ff' +1ms
(node:7332) UnhandledPromiseRejectionWarning: Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: undefined

So NRCHKB is definitely only calling it once.

macinspak commented 3 years ago

Any thoughts?

macinspak commented 3 years ago

Okay, new idea. First share full logs of node-red starting (since you start it until all bridges are deployed). Then check how many node-red processes are running.

Hi @Shaquu,I gather busy with the latest version testing. Did you have any more thoughts on this issue?

Shaquu commented 3 years ago

@macinspak It is very difficult to investigate it as it is some edge case. Can your try running nodered only on a different device?

macinspak commented 3 years ago

OK, looks like hap-nodejs might be the culprit.

Am I correct in assuming NRCHKB is extending arrays with an "isEqual" prototype function?

Inside hap-nodejs, they iterate the array content with:

for object in array {
}

Which will iterate over the array AND any prototype functions. So it is trying to add the "isEqual" function as an accessory.

Should be a simple patch.

Shaquu commented 3 years ago

Great work, I will try to support you with your branch build etc later this week.

macinspak commented 3 years ago

Thanks, it’s more the typescript and getting object casting wrong, I can help of I can see an example of how it should be written.

I also am uncertain how to properly generate the build folder and have it available to deploy short of zipping it up and using sftp or such.

If you want to just work in the repo I’ll add you as a contributor.

Sent from my iPhone

On 9 Feb 2021, at 8:01 pm, Tadeusz Wyrzykowski notifications@github.com wrote:

 Great work, I will try to support you with your branch build etc later this week.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Shaquu commented 3 years ago

@macinspak can it be closed as it was merged to hap-nodejs main branch? It will be released on our side in 1.3.0

macinspak commented 3 years ago

Oh sorry, sure. I haven’t tested, but if there are any issues with it, we just raise another ticket.

On Sun, 28 Mar 2021 at 8:23 am, Tadeusz Wyrzykowski < @.***> wrote:

@macinspak https://github.com/macinspak can it be closed as it was merged to hap-nodejs main branch? It will be released on our side in 1.3.0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/359#issuecomment-808810762, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHK2LDRLG5A2VO7OTD64NTTFZLHBANCNFSM4VQBHGYQ .