NorthernMan54 / homebridge-alexa

Expose your homebridge controlled devices to Amazon Alexa.

Home Page:https://www.homebridge.ca

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Homebridge auth failed, invalid PIN %s', pin, deviceID, body, err, response.body

sigb1n opened this issue · comments

commented

Getting this error. I confirmed PIN is valid though.

Can you enable the debug option in the plugin config, restart homebridge, and share the log around the error. it should give more details on the error.

commented

Here you go.

[1/11/2023, 10:56:32 AM] [Alexa] alexaDiscovery - returned 12 devices
2023-01-11T02:56:32.195Z alexa:Messages INFO: DeviceList - The following devices are allow => [ 'Front Door' ]
2023-01-11T02:56:32.196Z alexa:Messages INFO: DeviceList - allow => Front Door
2023-01-11T02:56:32.196Z alexa:Messages INFO: DeviceList - allow => Front Door
2023-01-11T02:56:32.196Z alexa:Messages INFO: DeviceList - allow => Front Door
2023-01-11T02:56:32.196Z alexa:Messages INFO: DeviceList - allow => Front Door
2023-01-11T02:56:32.196Z alexaActions Event Register 0E:D4:77:B2:55:2C -> {
characteristics: [ { aid: 3, iid: 11, ev: true }, { aid: 3, iid: 117, ev: true } ]
}
2023-01-11T02:56:32.199Z alexaActions Event Register 0E:C7:4F:EF:70:75 -> {
characteristics: [ { aid: 2, iid: 11, ev: true }, { aid: 2, iid: 117, ev: true } ]
}

/homebridge/node_modules/homebridge-alexa/node_modules/hap-node-client/HAPNodeJSClient.js:458
debug('Homebridge auth failed, invalid PIN %s', pin, deviceID, body, err, response.body);
^
ReferenceError: pin is not defined
at HAPNodeJSClient. (/homebridge/node_modules/homebridge-alexa/node_modules/hap-node-client/HAPNodeJSClient.js:458:61)
at eventedHttpClient.f [as callback] (/homebridge/node_modules/homebridge-alexa/node_modules/once/once.js:25:25)
at Socket. (/homebridge/node_modules/homebridge-alexa/node_modules/hap-node-client/lib/eventedHttpClient.js:71:16)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)

Tks for reporting this

Looking at the log, it is failing when attempting to register a device for routines/events on the homebridge instance '0E:C7:4F:EF:70:75', and it is failing with an authentication error. The error handler for the authentication error is having an issue and is causing the larger error.

I will need to do a patch to fix the error message handler, give me about 18 hours to post a fix.

As a workaround, you can disable routines in your config and this code will not be executed.

Are you sure about the pin being correct ? This is against instance 0E:C7:4F:EF:70:75

commented

Thanks. Will do. Yes. PIN is 100% correct. It's been working before.

If you update to the latest version the reference error mentioned in the original error should be resolved, and it should just indicate invalid PIN for that instance ( when routines are enabled ).

Looking at the log, do you have child bridges or multiple instances of homebridge running ? Do they all have the same pin ?

commented

All good. Working now. Thanks!