ebaauw / homebridge-deconz

Homebridge plugin for deCONZ
Apache License 2.0
135 stars 7 forks source link

deconz discover: Cannot read properties of undefined (reading 'name') #117

Closed edwinveger closed 1 year ago

edwinveger commented 1 year ago

Hi, on a new installation of homebridge-deconz I'm getting the following error when running deconz discover.

pi@homebridge:/var/lib/homebridge $ deconz discover -S
deconz: fatal: unhandled rejection: TypeError: Cannot read properties of undefined (reading 'name')
    at Discovery.<anonymous> (/var/lib/homebridge/node_modules/homebridge-deconz/cli/deconz.js:453:50)
    at Discovery.emit (node:events:513:28)
    at /var/lib/homebridge/node_modules/homebridge-deconz/lib/Deconz/Discovery.js:162:18
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

I have Raspberry Pi 2B with a Conbee ii USB stick. I've installed the Homebridge image with Raspberry Pi Imager. On homebridge.local:4530 I can see the Conbee as Phoscon-GW, so deconz itself appears to work (I have also paired a light which I can control from Phoscon). But the homebridge plugin cannot find the gateway, I'm getting a warning: 0000000000000000: not a RaspBee/ConBee mac address log message every 5 minutes. Hence I was trying to discover the gateway myself to update the config JSON, but encountered this issue.

pi@homebridge:/var/lib/homebridge $ deconz config
deconz: localhost: request 1: GET /config
deconz: warning: localhost: request 1: http status 404 Not Found
deconz: fatal: localhost: deCONZ gateway not found

More information:

Is there something I should configure differently, or is this a bug?

ebaauw commented 1 year ago

warning: 0000000000000000: not a RaspBee/ConBee mac address

The deCONZ gateway hasn't initialised properly, and reports all 0s instead of the ZIgbee mac address of the RaspBee or ConBee. This is an issue with deCONZ, but I don't know what causes this.

TypeError: Cannot read properties of undefined (reading 'name')

That's actually a bug in the error handler. It tries to log 0000000000000000: not a RaspBee/ConBee mac address, but this error is not the result of a request, so it cannot get the name of the server the request was sent to.

ebaauw commented 1 year ago

Fixed in v1.0.7.

edwinveger commented 1 year ago

Thanks for the quick response and fixing the bug 👍🏻

I'll continue to investigate why the deCONZ gateway isn't fully up.