Giter Club home page Giter Club logo

homekit-adapter's Introduction

homekit-adapter

HomeKit device adapter for WebThings Gateway

Supported Devices

NOTE: Devices typically need to be unpaired from Android/iOS before using them with the gateway.

Tested and Working

Untested but Should Work

Most other WiFi and BLE devices should work.

Installation

This add-on can be installed through the UI, via Settings -> Add-ons -> +.

Usage

Devices should be automatically discovered by the add-on. From the main Things screen, click the + button in the lower right. You will be asked for the PIN for your device, which is usually on a sticker.

If your device instead displays a PIN on-screen during the pairing process, you will need to enter 000-00-000. After it gives you an invalid PIN error, you should then enter the PIN displayed on your screen.

Troubleshooting

If you're having issues pairing, some of the following steps may help.

  • Pair the device with iOS and update the firmware. You will have to then unpair or reset the device before attempting to pair with the gateway again.
  • Perform a hard reset on the device.
    • This typically requires you to hold a button on the device for 10-15 seconds. See device manual.

If you're having errors with Bluetooth devices in particular:

  • The Raspberry Pi Bluetooth and WiFi devices are on the same chip. As such, they can cause interference with one another. As such, they can conflict with one another and cause lots of timeouts/disconnections. To resolve these issues, it is recommended that you connect your Raspberry Pi via ethernet and disable the WiFi connection. For instructions on how to do so, see here.

homekit-adapter's People

Contributors

mrstegeman avatar benfrancis avatar dhylands avatar mozilla-github-standards avatar

Stargazers

Max01203 avatar Patryk Laurent avatar Alexander Koz. avatar Yvan Sraka avatar Juri Grabowski avatar  avatar Michael C. Stewart avatar Patrick Arminio avatar  avatar Jason Lee avatar ᵺ avatar Mauricio Uribe avatar Satish Bhat avatar Anton Dvorson avatar Cameron Lewis avatar Kevin Anderson avatar Trent Rand avatar Peter Davis avatar  avatar Jake Hartnell avatar Frank Fang avatar

Watchers

 avatar James Cloos avatar Juri Grabowski avatar

homekit-adapter's Issues

Can’t pair with starling hub

I currently have homebridge paired with the HomeKit addon and working great. I purchased the starling hub so that I would basically have full nest integration. Whenever I try to pair it with my webthings server it says the PIN is invalid. The logs show this:

2020-03-10 19:43:21.971 INFO : homekit-adapter: Found IP device: {
2020-03-10 19:43:21.972 INFO : homekit-adapter: name: 'Starling Home Hub 4DB8',
2020-03-10 19:43:21.972 INFO : homekit-adapter: address: '10.0.0.67',
2020-03-10 19:43:21.972 INFO : homekit-adapter: port: 45685,
2020-03-10 19:43:21.972 INFO : homekit-adapter: 'c#': 2,
2020-03-10 19:43:21.973 INFO : homekit-adapter: ff: 0,
2020-03-10 19:43:21.973 INFO : homekit-adapter: id: '06:80:4D:2A:F8:8F',
2020-03-10 19:43:21.973 INFO : homekit-adapter: md: 'Starling Home Hub',
2020-03-10 19:43:21.973 INFO : homekit-adapter: pv: '1.1',
2020-03-10 19:43:21.973 INFO : homekit-adapter: 's#': 1,
2020-03-10 19:43:21.974 INFO : homekit-adapter: sf: 1,
2020-03-10 19:43:21.974 INFO : homekit-adapter: ci: 2
2020-03-10 19:43:21.974 INFO : homekit-adapter: }
2020-03-10 19:43:21.975 INFO : homekit-adapter: Error loading device 06:80:4D:2A:F8:8F: Error: no pairing data available
2020-03-10 19:43:21.976 INFO : homekit-adapter: at /etc/webthings-gateway/addons/homekit-adapter/lib/homekit-device.js:105:15
2020-03-10 19:43:21.976 INFO : homekit-adapter: at processTicksAndRejections (internal/process/task_queues.js:94:5)

I was able to pair it with home assistant and with HomeKit without any issues. Do you think this is an issue with the HomeKit addon or with the starling hub?

Thanks!

Where can I find the pin I need to submit?

I have done some searching but I can't find anything on the internet. I'm also new to this so sorry if its a dumb question... But where can I find the pin? I've been trying to add my hue lights, 2 smart sockets from aliexpress and an LED strip

TimeoutOverflowWarning with gateway 1.1.0-alpha.2

See WebThingsIO/gateway#3029:
I did run the OTA update to 1.1.0-alpha.2 on my Raspberry Pi 3 gateway setup, and since then, I get the following lines in the log:

2022-12-06 15:38:50.984 ERROR  : homekit-adapter: (node:26985) TimeoutOverflowWarning: 118536858373.96907 does not fit into a 32-bit signed integer.
2022-12-06 15:38:50.986 ERROR  : homekit-adapter: Timeout duration was set to 1.
2022-12-06 15:38:50.987 ERROR  : homekit-adapter: (node:26985) TimeoutOverflowWarning: 125600609384.66571 does not fit into a 32-bit signed integer.
2022-12-06 15:38:50.989 ERROR  : homekit-adapter: Timeout duration was set to 1.
2022-12-06 15:38:50.990 ERROR  : homekit-adapter: (node:26985) TimeoutOverflowWarning: 132255596803.10953 does not fit into a 32-bit signed integer.
2022-12-06 15:38:50.991 ERROR  : homekit-adapter: Timeout duration was set to 1.
2022-12-06 15:38:50.992 ERROR  : homekit-adapter: (node:26985) TimeoutOverflowWarning: 141466921038.08353 does not fit into a 32-bit signed integer.
2022-12-06 15:38:50.994 ERROR  : homekit-adapter: Timeout duration was set to 1.
2022-12-06 15:38:50.995 ERROR  : homekit-adapter: (node:26985) TimeoutOverflowWarning: 146803712000 does not fit into a 32-bit signed integer.
2022-12-06 15:38:50.996 ERROR  : homekit-adapter: Timeout duration was set to 1.

This sounds a little bit like if a JS timestamp value (which is in microseconds!) is being tried to be written into a seconds-based field without the required division by 1000.

Crash loop

The homekit adapter is stuck in a crash loop for me. All the logs say is the following:

2018-10-11 22:19:44.379 homekit: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
2018-10-11 22:19:44.429 homekit: Loading add-on for homekit-adapter from /home/pi/.mozilla-iot/addons/homekit-adapter
2018-10-11 22:19:51.168 homekit: Unhandled Rejection
2018-10-11 22:19:51.182 Plugin: homekit-adapter died, code = 1 restarting...

This is with the gateway on v0.6.0 and the adapter on 0.3.0 on an rpi with an extra BT radio plugged in.

Doesn't show up in Addon list

Hello!

I was trying to install this adapter to test it out but it doesn't appear to be installable via the UI.

Do I have to enable a flag or something? Or should I somehow manually install this?

Any help would be appreciated!

Thanks,
Lukas

Failing to add Homebridge

[I'm new to this, and I'm not a programmer]

I'm trying to add Homebridge
When I do this in AddOns>Settings>Homekit>Configure
I get this error:

2018-12-03 12:13:00.359 INFO   : Loading add-on: homekit-adapter
2018-12-03 12:13:03.826 INFO   : homekit: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
2018-12-03 12:13:04.014 INFO   : homekit: Loading add-on for homekit-adapter from /home/pi/.mozilla-iot/addons/homekit-adapter
2018-12-03 12:13:13.586 INFO   : homekit: Found IP device: { name: 'Homebridge-CAD8',
2018-12-03 12:13:13.607 INFO   : homekit:   address: '192.168.1.191',
2018-12-03 12:13:13.618 INFO   : homekit:   port: 51826,
2018-12-03 12:13:13.631 INFO   : homekit:   'c#': 4,
2018-12-03 12:13:13.641 INFO   : homekit:   ff: 0,
2018-12-03 12:13:13.651 INFO   : homekit:   id: 'CC:22:3D:E3:CE:30',
2018-12-03 12:13:13.661 INFO   : homekit:   md: 'Homebridge',
2018-12-03 12:13:13.670 INFO   : homekit:   pv: '1.0',
2018-12-03 12:13:13.679 INFO   : homekit:   's#': 1,
2018-12-03 12:13:13.692 INFO   : homekit:   sf: 0,
2018-12-03 12:13:13.702 INFO   : homekit:   ci: 2 }
2018-12-03 12:13:13.728 INFO   : homekit: Error loading device CC:22:3D:E3:CE:30: Key not found
2018-12-03 12:13:13.874 INFO   : homekit: Pairing failed for device CC:22:3D:E3:CE:30: TypeError: Cannot read property '0' of undefined
2018-12-03 12:13:13.889 INFO   : homekit: Pairing failed for device CC:22:3D:E3:CE:30: TypeError: Cannot read property '0' of undefined

When I try it with Add Things, I get this error:
Incorrect PIN in the web UI (not true)

and this output:

2018-12-03 12:14:29.486 INFO   : Opened a new things socket
2018-12-03 12:14:29.512 INFO   : About to call startPairing on HomeKitAdapter
2018-12-03 12:14:29.556 INFO   : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing started
2018-12-03 12:14:55.511 INFO   : AdapterProxy: setPin: 031-45-154 for: homekit-CC:22:3D:E3:CE:30
2018-12-03 12:14:55.563 INFO   : homekit: Pairing failed for device CC:22:3D:E3:CE:30: TypeError: Cannot read property '0' of undefined
2018-12-03 12:14:55.576 ERROR  : homekit: AddonManagerProxy: Failed to set PIN for device homekit-CC:22:3D:E3:CE:30
2018-12-03 12:14:55.588 ERROR  : homekit: TypeError: Cannot read property '0' of undefined
2018-12-03 12:14:55.593 ERROR  : homekit:     at Promise (/home/pi/.mozilla-iot/addons/homekit-adapter/node_modules/hap-controller/lib/protocol/pairing-protocol.js:186:36)
2018-12-03 12:14:55.598 ERROR  : homekit:     at new Promise (<anonymous>)
2018-12-03 12:14:55.602 ERROR  : homekit:     at PairingProtocol.parsePairSetupM2 (/home/pi/.mozilla-iot/addons/homekit-adapter/node_modules/hap-controller/lib/protocol/pairing-protocol.js:178:12)
2018-12-03 12:14:55.607 ERROR  : homekit:     at pairingProtocol.buildPairSetupM1.then.then (/home/pi/.mozilla-iot/addons/homekit-adapter/node_modules/hap-controller/lib/transport/ip/http-client.js:77:35)
2018-12-03 12:14:55.614 ERROR  : homekit:     at <anonymous>
2018-12-03 12:14:55.619 ERROR  : homekit:     at process._tickCallback (internal/process/next_tick.js:189:7)
2018-12-03 12:14:55.629 ERROR  : Failed to set PIN for homekit-CC:22:3D:E3:CE:30: undefined
2018-12-03 12:15:29.521 INFO   : Pairing timeout
2018-12-03 12:15:29.528 ERROR  : Thing was not added
2018-12-03 12:15:29.532 ERROR  : addNewThing cancelled
2018-12-03 12:15:29.543 INFO   : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing cancelled

failed to set pin for eve motion sensor?

Hi,

I'm using raspberry pi3 with the latest gateway and Homekit & Web Things Addon.

I'm trying to connect elgato eve motion sensor but it is always giving failed to set pin error.

  1. Connect eve motion sensor to iPhone. Updated eve motion sensor firmware. Confirmed motion sensor working. Removed sensor from the accessory.
  2. Started gateway, install Web things and homekit addon.
  3. New Things, device "Eve Motion C9F0" detected.

Tried step 3 with different below configuration. All steps failed.

  1. Passed pin "XXX-XX-XXX" failed. Tried pin "XXXXXXXX" failed.
  2. Turn OFF - ON rpi bluetooth - failed to connect to sensor.
  3. Disable - Enable HomeKit Addon - failed to connect to sensor.
  4. RESET the sensor - failed
2019-07-26 12:28:21.069 INFO   : homekit: Loading add-on for homekit-adapter from /home/pi/.mozilla-iot/addons/homekit-adapter
2019-07-26 12:28:22.175 INFO   : thing-url: Starting mDNS discovery
2019-07-26 12:28:25.434 INFO   : homekit: Found BLE device: { CoID: 76,
2019-07-26 12:28:25.438 INFO   : homekit:   TY: 6,
2019-07-26 12:28:25.441 INFO   : homekit:   AIL: 49,
2019-07-26 12:28:25.444 INFO   : homekit:   SF: 1,
2019-07-26 12:28:25.448 INFO   : homekit:   DeviceID: 'xx:xx:xx:xx:xx:xx',
2019-07-26 12:28:25.451 INFO   : homekit:   ACID: 10,
2019-07-26 12:28:25.454 INFO   : homekit:   GSN: 1,
2019-07-26 12:28:25.457 INFO   : homekit:   CN: 2,
2019-07-26 12:28:25.461 INFO   : homekit:   CV: 2 }
2019-07-26 12:28:25.466 INFO   : homekit: Error loading device xx:xx:xx:xx:xx:xx: Key not found
2019-07-26 12:28:26.199 INFO   : Checking for add-on updates...
2019-07-26 12:28:27.803 INFO   : Finished updating add-ons
2019-07-26 12:28:41.667 INFO   : About to call startPairing on ThingURLAdapter
2019-07-26 12:28:41.672 INFO   : About to call startPairing on HomeKitAdapter
2019-07-26 12:28:41.682 INFO   : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing started
2019-07-26 12:28:43.195 INFO   : Opened a new things socket
2019-07-26 12:28:56.940 INFO   : AdapterProxy: setPin: XXX-XX-XXX for: homekit-xx:xx:xx:xx:xx:xx
2019-07-26 12:29:20.397 INFO   : homekit: Pairing failed for device xx:xx:xx:xx:xx:xx: Timeout
2019-07-26 12:29:20.402 ERROR  : homekit: AddonManagerProxy: Failed to set PIN for device homekit-xx:xx:xx:xx:xx:xx
2019-07-26 12:29:20.407 ERROR  : homekit: undefined
2019-07-26 12:29:20.419 ERROR  : Failed to set PIN for homekit-xx:xx:xx:xx:xx:xx: undefined
2019-07-26 12:29:25.672 ERROR  : Thing was not added
2019-07-26 12:29:25.675 ERROR  : addNewThing cancelled
2019-07-26 12:29:25.683 INFO   : thing-url: Adapter: ThingURLAdapter id thing-url-adapter pairing cancelled
2019-07-26 12:29:25.686 INFO   : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing cancelled
2019-07-26 12:29:27.199 INFO   : About to call startPairing on ThingURLAdapter
2019-07-26 12:29:27.203 INFO   : About to call startPairing on HomeKitAdapter
2019-07-26 12:29:27.214 INFO   : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing started
2019-07-26 12:29:28.223 INFO   : Opened a new things socket
2019-07-26 12:29:38.189 INFO   : AdapterProxy: setPin: XXXXXXXX for: homekit-xx:xx:xx:xx:xx:xx
2019-07-26 12:29:46.370 INFO   : homekit: Pairing failed for device xx:xx:xx:xx:xx:xx: M4: Error: 2
2019-07-26 12:29:46.374 ERROR  : homekit: AddonManagerProxy: Failed to set PIN for device homekit-xx:xx:xx:xx:xx:xx
2019-07-26 12:29:46.376 ERROR  : homekit: undefined
2019-07-26 12:29:46.380 ERROR  : Failed to set PIN for homekit-xx:xx:xx:xx:xx:xx: undefined
2019-07-26 12:30:27.209 INFO   : Pairing timeout
2019-07-26 12:30:27.214 ERROR  : Thing was not added
2019-07-26 12:30:27.217 ERROR  : addNewThing cancelled

NOTE: Configure "Web Thing" Addon, setting bluetoothEnabled to false (unchecked) - No bluetoothEnabled setting available. Only url check available.

Error with hue keypad

Now that hue hub pairing works (well, it claims the pin is wrong, but it actually works...) I'm running into the next issue: the keypads seem to have a different value enum than what the adapter expects:

2020-11-04 00:52:06.152 INFO   : homekit-adapter: [Device 2E:5A:D9:1D:11:32] Found characteristic: public.hap.characteristic.input-event
2020-11-04 00:52:06.152 INFO   : homekit-adapter: {
2020-11-04 00:52:06.152 INFO   : homekit-adapter:   "type": "73",
2020-11-04 00:52:06.152 INFO   : homekit-adapter:   "iid": 588410585204,
2020-11-04 00:52:06.152 INFO   : homekit-adapter:   "value": null,
2020-11-04 00:52:06.152 INFO   : homekit-adapter:   "format": "uint8",
2020-11-04 00:52:06.152 INFO   : homekit-adapter:   "minValue": 0,
2020-11-04 00:52:06.152 INFO   : homekit-adapter:   "maxValue": 0,
2020-11-04 00:52:06.152 INFO   : homekit-adapter:   "minStep": 1,
2020-11-04 00:52:06.152 INFO   : homekit-adapter:   "perms": [
2020-11-04 00:52:06.152 INFO   : homekit-adapter:     "pr",
2020-11-04 00:52:06.152 INFO   : homekit-adapter:     "ev"
2020-11-04 00:52:06.152 INFO   : homekit-adapter:   ]
2020-11-04 00:52:06.152 INFO   : homekit-adapter: }
2020-11-04 00:52:06.152 INFO   : homekit-adapter: Error loading device 2E:5A:D9:1D:11:32: Error: Invalid enum value
2020-11-04 00:52:06.152 INFO   : homekit-adapter:     at HomeKitProperty.fromHap (/home/node/.mozilla-iot/addons/homekit-adapter/lib/property-utils.js:15:11)
2020-11-04 00:52:06.152 INFO   : homekit-adapter:     at HomeKitProperty.setCachedValue (/home/node/.mozilla-iot/addons/homekit-adapter/lib/homekit-property.js:51:20)
2020-11-04 00:52:06.152 INFO   : homekit-adapter:     at new HomeKitProperty (/home/node/.mozilla-iot/addons/homekit-adapter/lib/homekit-property.js:41:10)
2020-11-04 00:52:06.152 INFO   : homekit-adapter:     at HomeKitDevice.addProperty (/home/node/.mozilla-iot/addons/homekit-adapter/lib/homekit-device.js:1486:20)
2020-11-04 00:52:06.152 INFO   : homekit-adapter:     at HomeKitDevice.parseAccessories (/home/node/.mozilla-iot/addons/homekit-adapter/lib/homekit-device.js:367:33)
2020-11-04 00:52:06.152 INFO   : homekit-adapter:     at /home/node/.mozilla-iot/addons/homekit-adapter/lib/homekit-device.js:282:21
2020-11-04 00:52:06.152 INFO   : homekit-adapter:     at processTicksAndRejections (internal/process/task_queues.js:97:5)

Which presumably means the enum in https://github.com/WebThingsIO/homekit-adapter/blob/master/lib/homekit-device.js#L1479-L1502 has a value that the keypad doesn't support?

Eve Flare and Eve Light Strip fail to set color or brightness

I have both an Eve Flare (Bluetooth HomeKit) and an Eve Light Strip (WiFi HomeKit), and on both, when trying to set hue or saturation, that fails completely, while setting brightness always sets it to 0 and an external tool is needed to set it back to 100% (or any other value). On/Off works reliably (minus the known BT shenanigans).
Logs do not actually tell about any errors.

I'm attaching a log from booting that has all the properties found for those two devices (lines unrelated to those devices are cut out).
gateway-20200306.log

Homekit adapter in permanent crash looop after upgrade to 0.5.0

Hi
I have a couple of RPI running Mozilla-IOT 0.9.2 with homekit 0.5.0
I have 6 EVE window / door sensors - none of them now gets a change to update as the following repeating code is found on all my servers:
2019-09-22 09:57:36.542 INFO : homekit: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
2019-09-22 09:57:36.584 INFO : homekit: Loading add-on for homekit-adapter from /home/pi/.mozilla-iot/addons/homekit-adapter
2019-09-22 09:57:38.657 INFO : homekit: Found BLE device: { CoID: 76,
2019-09-22 09:57:38.659 INFO : homekit: TY: 6,
2019-09-22 09:57:38.660 INFO : homekit: AIL: 49,
2019-09-22 09:57:38.662 INFO : homekit: SF: 0,
2019-09-22 09:57:38.664 INFO : homekit: DeviceID: '5b:42:c9:a0:2a:45',
2019-09-22 09:57:38.666 INFO : homekit: ACID: 10,
2019-09-22 09:57:38.667 INFO : homekit: GSN: 13411,
2019-09-22 09:57:38.669 INFO : homekit: CN: 1,
2019-09-22 09:57:38.670 INFO : homekit: CV: 2 }
2019-09-22 09:57:38.673 ERROR : homekit: /home/pi/.mozilla-iot/addons/homekit-adapter/lib/homekit-adapter.js:193
2019-09-22 09:57:38.674 ERROR : homekit: device.promise.then(() => {
2019-09-22 09:57:38.675 ERROR : homekit: ^
2019-09-22 09:57:38.676 ERROR : homekit:
2019-09-22 09:57:38.678 ERROR : homekit: TypeError: Cannot read property 'then' of undefined
2019-09-22 09:57:38.679 ERROR : homekit: at HomeKitAdapter.addBLEDevice (/home/pi/.mozilla-iot/addons/homekit-adapter/lib/homekit-adapter.js:193:22)
2019-09-22 09:57:38.680 ERROR : homekit: at BLEDiscovery.bleDiscovery.on (/home/pi/.mozilla-iot/addons/homekit-adapter/lib/homekit-adapter.js:223:12)
2019-09-22 09:57:38.681 ERROR : homekit: at emitOne (events.js:116:13)
2019-09-22 09:57:38.682 ERROR : homekit: at BLEDiscovery.emit (events.js:211:7)
2019-09-22 09:57:38.683 ERROR : homekit: at BLEDiscovery._handleDiscover (/home/pi/.mozilla-iot/addons/homekit-adapter/node_modules/hap-controller/lib/transport/ble/ble-discovery.js:109:10)
2019-09-22 09:57:38.684 ERROR : homekit: at emitOne (events.js:116:13)
2019-09-22 09:57:38.685 ERROR : homekit: at Noble.emit (events.js:211:7)
2019-09-22 09:57:38.686 ERROR : homekit: at Noble.onDiscover (/home/pi/.mozilla-iot/addons/homekit-adapter/node_modules/@abandonware/noble/lib/noble.js:178:10)
2019-09-22 09:57:38.687 ERROR : homekit: at emitMany (events.js:147:13)
2019-09-22 09:57:38.688 ERROR : homekit: at NobleBindings.emit (events.js:224:7)
2019-09-22 09:57:38.691 INFO : Plugin: homekit-adapter died, code = 1 restarting after 20000

Can anyone help me please as they are all useless at the moment.

I have tried this with buster and jessie and get the same error, and I have done a completely new install and this also failed.

I have also tried with internal and external bluetooth adapters.

The only way to get homekit to start is to disable all bluetooth which does defeat the object of monitoring BLE devices :-)

Failing to pair Eve Motion when filling the pin code

Hi,

I tried to pair a eve motion using the homekit-adapter for things gateway and the process failed when filling the pin code. I add the log just below, it seems that a variable is not well defined.

2018-12-08 19:40:31.628 Loading add-on: homekit-adapter
2018-12-08 19:40:32.507 homekit: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
2018-12-08 19:40:32.552 homekit: Loading add-on for homekit-adapter from /home/pi/.mozilla-iot/addons/homekit-adapter
2018-12-08 19:40:34.911 homekit: Found BLE device: { CoID: 76,
2018-12-08 19:40:34.911 homekit:   TY: 6,
2018-12-08 19:40:34.912 homekit:   AIL: 205,
2018-12-08 19:40:34.912 homekit:   SF: 1,
2018-12-08 19:40:34.912 homekit:   DeviceID: '3f:cc:b5:c9:71:30',
2018-12-08 19:40:34.912 homekit:   ACID: 10,
2018-12-08 19:40:34.912 homekit:   GSN: 4,
2018-12-08 19:40:34.912 homekit:   CN: 1,
2018-12-08 19:40:34.912 homekit:   CV: 2 }
2018-12-08 19:40:34.924 homekit: Error loading device 3f:cc:b5:c9:71:30: Key not found
2018-12-08 19:40:41.843 homekit: Pairing failed for device 3f:cc:b5:c9:71:30: TypeError: Cannot read property 'length' of undefined
2018-12-08 19:40:41.845 homekit: Pairing failed for device 3f:cc:b5:c9:71:30: TypeError: Cannot read property 'length' of undefined

Would you have any idea on how to work arround this problem ?

Thanks !

Eve Motion (or Room) won't pair on RPi3

Hi,

I've been trying to pair my Eve Room and Motion devices and I constantly get the "Incorrect PIN" error. I've looked into adapter's source code and made sure that I'm typing the pin in a correct format.
I get the error 100% of the time, unlike in this case: #30

Any help would be very appreciated. The ability to use Mozilla technology for HomeKit devices would be a godsend!

Thanks,
Karol

Also, here are the logs I got from the device:

2019-09-07 20:26:21.493 INFO   : Loading add-on: homekit-adapter
2019-09-07 20:26:22.268 INFO   : homekit: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
2019-09-07 20:26:22.316 INFO   : homekit: Loading add-on for homekit-adapter from /home/pi/.mozilla-iot/addons/homekit-adapter
2019-09-07 20:26:24.544 INFO   : homekit: Found IP device: { name: 'Philips hue - 4AFA59',
2019-09-07 20:26:24.547 INFO   : homekit:   address: '192.168.0.100',
2019-09-07 20:26:24.551 INFO   : homekit:   port: 8080,
2019-09-07 20:26:24.553 INFO   : homekit:   'c#': 33,
2019-09-07 20:26:24.556 INFO   : homekit:   ff: 1,
2019-09-07 20:26:24.558 INFO   : homekit:   id: 'D4:C8:13:DD:EA:F5',
2019-09-07 20:26:24.560 INFO   : homekit:   md: 'BSB002',
2019-09-07 20:26:24.562 INFO   : homekit:   pv: '1.1',
2019-09-07 20:26:24.565 INFO   : homekit:   's#': 1,
2019-09-07 20:26:24.567 INFO   : homekit:   sf: 0,
2019-09-07 20:26:24.569 INFO   : homekit:   ci: 2 }
2019-09-07 20:26:24.572 INFO   : homekit: Error loading device D4:C8:13:DD:EA:F5: Key not found
2019-09-07 20:26:24.573 INFO   : homekit: Found BLE device: { CoID: 76,
2019-09-07 20:26:24.575 INFO   : homekit:   TY: 6,
2019-09-07 20:26:24.577 INFO   : homekit:   AIL: 109,
2019-09-07 20:26:24.578 INFO   : homekit:   SF: 0,
2019-09-07 20:26:24.580 INFO   : homekit:   DeviceID: '34:04:e0:ac:9d:30',
2019-09-07 20:26:24.581 INFO   : homekit:   ACID: 7,
2019-09-07 20:26:24.583 INFO   : homekit:   GSN: 122,
2019-09-07 20:26:24.584 INFO   : homekit:   CN: 1,
2019-09-07 20:26:24.585 INFO   : homekit:   CV: 2 }
2019-09-07 20:26:24.587 INFO   : homekit: Error loading device 34:04:e0:ac:9d:30: Key not found
2019-09-07 20:26:24.986 INFO   : homekit: Found BLE device: { CoID: 76,
2019-09-07 20:26:24.988 INFO   : homekit:   TY: 6,
2019-09-07 20:26:24.990 INFO   : homekit:   AIL: 205,
2019-09-07 20:26:24.991 INFO   : homekit:   SF: 0,
2019-09-07 20:26:24.993 INFO   : homekit:   DeviceID: '28:17:e6:da:fc:c7',
2019-09-07 20:26:24.994 INFO   : homekit:   ACID: 10,
2019-09-07 20:26:24.995 INFO   : homekit:   GSN: 3,
2019-09-07 20:26:24.997 INFO   : homekit:   CN: 2,
2019-09-07 20:26:24.998 INFO   : homekit:   CV: 2 }
2019-09-07 20:26:25.001 INFO   : homekit: Error loading device 28:17:e6:da:fc:c7: Key not found
2019-09-07 20:26:26.920 INFO   : homekit: Found BLE device: { CoID: 76,
2019-09-07 20:26:26.923 INFO   : homekit:   TY: 6,
2019-09-07 20:26:26.924 INFO   : homekit:   AIL: 49,
2019-09-07 20:26:26.926 INFO   : homekit:   SF: 1,
2019-09-07 20:26:26.927 INFO   : homekit:   DeviceID: '72:45:ab:85:02:49',
2019-09-07 20:26:26.929 INFO   : homekit:   ACID: 10,
2019-09-07 20:26:26.931 INFO   : homekit:   GSN: 2,
2019-09-07 20:26:26.932 INFO   : homekit:   CN: 4,
2019-09-07 20:26:26.934 INFO   : homekit:   CV: 2 }
2019-09-07 20:26:26.936 INFO   : homekit: Error loading device 72:45:ab:85:02:49: Key not found
2019-09-07 20:26:28.807 INFO   : About to call startPairing on HomeKitAdapter
2019-09-07 20:26:28.845 INFO   : Opened a new things socket
2019-09-07 20:26:28.849 INFO   : homekit: Adapter: HomeKitAdapter id homekit-adapter pairing started
2019-09-07 20:26:32.982 INFO   : homekit: Found BLE device: { CoID: 76,
2019-09-07 20:26:32.984 INFO   : homekit:   TY: 6,
2019-09-07 20:26:32.986 INFO   : homekit:   AIL: 205,
2019-09-07 20:26:32.987 INFO   : homekit:   SF: 0,
2019-09-07 20:26:32.989 INFO   : homekit:   DeviceID: '97:bb:64:d2:bb:1b',
2019-09-07 20:26:32.990 INFO   : homekit:   ACID: 10,
2019-09-07 20:26:32.991 INFO   : homekit:   GSN: 120,
2019-09-07 20:26:32.993 INFO   : homekit:   CN: 2,
2019-09-07 20:26:32.994 INFO   : homekit:   CV: 2 }
2019-09-07 20:26:32.996 INFO   : homekit: Error loading device 97:bb:64:d2:bb:1b: Key not found
2019-09-07 20:26:42.922 INFO   : AdapterProxy: setPin: 478-80-431 for: homekit-72:45:ab:85:02:49
2019-09-07 20:27:05.443 INFO   : homekit: Pairing failed for device 72:45:ab:85:02:49: Timeout
2019-09-07 20:27:05.446 ERROR  : homekit: AddonManagerProxy: Failed to set PIN for device homekit-72:45:ab:85:02:49
2019-09-07 20:27:05.448 ERROR  : homekit: undefined
2019-09-07 20:27:05.450 ERROR  : Failed to set PIN for homekit-72:45:ab:85:02:49: undefined

Eve Window / Door Sensors pairing is not working

I have multiple gateways and multiple Eve Window / Door Sensors - there is now an issue with pairing new devices. Everything appears to be working for previously paired devices.

The summary is

  1. With a fresh install I am able to install 1 device only to the gateway provided that it was not powered up (aka battery was removed) when the gateway was started. However even this is temporary. After either rebooting the gateway or the rpi the device is never again recognised and remains as a "Custom Thing". From my logs it may be a race condition in that the device is seen in the logs before the Homekit adapter is loaded.

  2. I am unable to pair any device on a gateway that already has existing devices paired on it. I get a generic timeout error and no more information. The Web interface reports pin incorrect (although this is not consistent with the logs). As I have had the gateways for a while, the devices were paired with previous versions of the software (v5 of Homekit I think)

Detail:
I have tried the following combinations, all with the latest software Gateway 0.9.2 and Homekit 0.7.1.

  1. Stretch with on-board bluetooth (LAN only and Wifi only)
  2. Stretch with USB bluetooth (LAN only and Wifi only)
  3. Buster with on-board bluetooth on RPI 3 (LAN only and Wifi only)
  4. Buster with USB bluetooth on RPI3 (LAN only and Wifi only)
  5. Buster with on-board Bluetooth on RPI4 (LAN only and Wifi only)
  6. Buster with USB Bluetooth on RPI4 (LAN only and Wifi only)

All of the combinations result in the same outcomes - so I don't think its to do with the hardware. I have also move the sensors close to the rpi's and had them further away - again this makes no difference to the outcome.

I am attaching two logs

  • one is from the fresh install of Things Gateway - where you can see the first device pair and then subsequent devices do not pair
    -the second is from an existing gateway with multiple devices previously paired - you can see the pairing failure and that devices are found before the homekit adapter has loaded. I am not sure this is releveant - but it might be :-)

Thanks for looking at this :-)

Simon
run-app.log.2019-10-18-gateway5-existing_devices_added.txt
run-app.log.2019-10-18-was_a_fresh_install.txt

Updating the docs

After #22 I think the docs need further updating.

Looking at https://github.com/mozilla-iot/homekit-adapter/blob/master/README.md#configuration it references:

Click on the Configure button for the HomeKit add-on.

If I'm not mistaken this was removed in #22?

Edit: I think the entire configuration section requires updating now as there is "nothing" to configure

Edit2: I've no idea how to "connect" the gateway with my iPad Home/HomeKit app, adding docs for this would also be appreciated

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please reach out to [email protected].

(Message COC001)

Adapter still uses unsupported invisibile properties

The visible member of properties is being deprecated in gateway 1.1.

This adapter still sets the visible member on properties, but it's no longer serialised by the gateway-addon-node library so it causes things to break.

The adapter should remove invisible properties instead, rather than passing them onto the gateway.

randomly not work

I have pair a EVE MOTION, 70% of time works other 30% not work...
I can see this error in log:
2019-05-31 15:15:40.733 INFO : homekit: Error reading characteristics for device da:16:1c:79:57:b1: Disconnected

If I disable and enable add-on, it return working.

Unable to re-add homekit-compatible wifi device (LED light)

I have a Eve LED light strip, which connects via wifi and I have operated with the 0.x gateway via the HomeKit adapter for quite a while, and continued to use after upgrade to 1.0 recently.
After I recently installed updates on my routers, which made the wifi be offline for a while temporarily, the gateway only displayed the LED strip as "THING" instead of the usual lightbulb, and I could not turn it off via the gateway in any more (I had turned it on via the gateway before this change). The light strip has a static DHCP lease set up, so is getting the same IP address internally all the time, and I can actually ping it on that, so it seems to be up correctly.
So I tried to fix the situation and removed it from the gateway and tried to re-add it. It is listed in the devices I can add, but when I enter the PIN and click "Submit", nothing happens for a while and it does not get added to the gateway again - finally "Incorrect PIN" appears even though what I used is the PIN on the sticker of the device (and as I said, I had it connected before, so the PIN worked previously).
Looking at the logs, it looks like there's some connection issue (I replaced the digits of the actual PIN with * symbols instead):

2020-12-14 15:12:53.406 INFO   : Opened a new things socket
2020-12-14 15:12:53.626 INFO   : About to call startPairing on ThingURLAdapter
2020-12-14 15:12:53.628 INFO   : About to call startPairing on HomeKitAdapter
2020-12-14 15:13:08.744 INFO   : About to call startPairing on ThingURLAdapter
2020-12-14 15:13:08.752 INFO   : About to call startPairing on HomeKitAdapter
2020-12-14 15:13:09.248 INFO   : Opened a new things socket
2020-12-14 15:13:31.318 INFO   : AdapterProxy: setPin: ***-**-*** for: homekit-5D:63:29:AE:65:AC
2020-12-14 15:14:08.756 INFO   : Pairing timeout
2020-12-14 15:15:31.818 INFO   : AdapterProxy: setPin: ***-**-*** for: homekit-5D:63:29:AE:65:AC
2020-12-14 15:15:42.281 INFO   : homekit-adapter: Pairing failed for device 5D:63:29:AE:65:AC: undefined
2020-12-14 15:15:42.283 ERROR  : homekit-adapter: AddonManagerProxy: Failed to set PIN for device homekit-5D:63:29:AE:65:AC
2020-12-14 15:15:42.285 ERROR  : Failed to set PIN for homekit-5D:63:29:AE:65:AC: undefined
2020-12-14 15:17:45.162 INFO   : homekit-adapter: Pairing failed for device 5D:63:29:AE:65:AC: undefined
2020-12-14 15:17:45.163 ERROR  : homekit-adapter: AddonManagerProxy: Failed to set PIN for device homekit-5D:63:29:AE:65:AC
2020-12-14 15:17:45.165 ERROR  : Failed to set PIN for homekit-5D:63:29:AE:65:AC: undefined
2020-12-14 15:25:40.933 ERROR  : Error getting thing description for thing with id homekit-5D:63:29:AE:65:AC: Error: Unable to find thing with id: homekit-5D:63:29:AE:65:AC
    at /home/pi/mozilla-iot/gateway/build/webpack:/src/models/things.js:268:1
2020-12-14 15:25:41.802 ERROR  : Error getting thing description for thing with id homekit-5D:63:29:AE:65:AC: Error: Unable to find thing with id: homekit-5D:63:29:AE:65:AC
    at /home/pi/mozilla-iot/gateway/build/webpack:/src/models/things.js:268:1

Is there anything I can do to check and fix the connection (as I said, I can actually ping the IP of the light strip, even from the gateway) or is this an issue of the gateway?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.