NorthernMan54 / homebridge-alexa

Expose your homebridge controlled devices to Amazon Alexa.
https://www.homebridge.ca
442 stars 77 forks source link

Alexa failing recognition with PIN and insecure errors #511

Closed BuckarooToo closed 2 years ago

BuckarooToo commented 2 years ago

I am trying the plugin for the first time (and want to see this work within the limited trial period).

When trying discovery, homebridge-alexa found some of my HomeKit devices, but not all. Here is a sample of the terminal output:

2022-04-04T00:36:41.636Z hapNodeJSClient HAP Device discovered iHome SmartMonitor-AAD92B 2022-04-04T00:36:41.656Z hapNodeJSClient HAP Discover failed iSS50 -> http://192.168.87.65:80 invalid PIN or homebridge is not running in insecure mode with -I 2022-04-04T00:36:41.678Z hapNodeJSClient HAP Device discovered iDevices Switch (2) 2022-04-04T00:36:41.735Z hapNodeJSClient HAP Device discovered Switch 00046771 2022-04-04T00:36:41.736Z hapNodeJSClient HAP Device discovered Switch 00114859 2022-04-04T00:36:41.748Z hapNodeJSClient HAP Discover failed IDEV0001 -> http://192.168.87.239:80 invalid PIN or homebridge is not running in insecure mode with -I 2022-04-04T00:36:41.749Z hapNodeJSClient HAP Discover failed IDEV0001 -> http://192.168.87.197:80 invalid PIN or homebridge is not running in insecure mode with -I

I have verified that Homebridge is running in insecure mode (I'm running via the Alpine Linux image from oznu in Docker on a Synology with DSM 7 - I had to add HOMEBRIDGE_INSECURE to the environment variables, and the output say that the -I variable is being passed), and the PIN for my single instance of homebridge has always been the default (031-45-154).

Any suggestions? Now that iDevices and iHome are dropping their support for Alexa discovery, I'm connecting those devices directly to HomeKit and hoping your plug-in will discover them. No luck yet ...

NorthernMan54 commented 2 years ago

What Homebridge plugin are you using for iHome and iDevices ? The plugin only works for homebridge devices, and unfortunately not native HomeKit devices.

BuckarooToo commented 2 years ago

Ah, that might explain it. But ... some of my iDevices and iHome devices are recognized in Alexa (those that were recognized by Alexa previous to those companies turning their services off), and some are not (those added to HomeKit after those companies' services were turned off). Looking at the homebridge-alexa skill in the Alexa app, the skill recognizes the devices recognized in Alexa as well (e.g., iDevices and iHome), and I'm not using a homebridge plugin for them.

BuckarooToo commented 2 years ago

Looks like the way to do this is through the use of dummy switches (homebridge plug-ins) that I can use to control my actual switches. This seems to work. But I'm curious as to why the switches some of the switches from each company work and others don't, since I would think that homebridge-alexa would be working at the HomeKit level. I can only guess that my previously recognized switches are still being recognized as Alexa devices but homebridge-alexa is not recognizing them at all.

NorthernMan54 commented 2 years ago

Homebridge-alexa does work at the HomeKit level, and it uses the same API as HomeKit devices, that is why the discovery phase identifies native HomeKit devices. But as the native HomeKit devices are secured the error message appears.

As to why your devices are still working after they shut them down, I suspect that they haven't fully turned things off yet, and so far only turned off discovery, but existing devices are still working. Once they complete the shutdown....

The dummy switch approach is a valid approach to enable native HomeKit devices to be exposed thru the homebridge-alexa plugin

BuckarooToo commented 2 years ago

Thanks much! I look forward to exploring!