Apollon77 / ioBroker.homekit-controller

Pair and control HomeKit devices directly
MIT License
16 stars 8 forks source link
hap homekit iobroker

Logo

ioBroker.homekit-controller

Number of Installations (latest) Number of Installations (stable) NPM version

Test and Release Translation status Downloads

This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers. For more details and for information how to disable the error reporting see Sentry-Plugin Documentation! Sentry reporting is used starting with js-controller 3.0.

homekit-controller adapter for ioBroker

This adapter allows you to pair and directly control devices with the "works with HomeKit" Logo that cna be used with Apple Home. The adapter supports IP/WLAN devices and also BLE (Bluetooth LE) devices. The adapter works completely local in your network.

The adapter is not ...

... offering ioBroker devices or states to be controlled by an Apple Home app/system. If you want this direction please use the yahka adapter.

... supporting Thread "only" based devices. The Homekit Thread specifications are not yet publicly available. From the current knowledge all devices on the market also support BLE or WLAN, so the adapter will simply not use Thread but other ways to communicate.

How to use the adapter

The adapter listens for available devices in your network.

There are three "types" of detected devices:

After pairing the supported states are read out from the device and objects and states are created. All known data points defined in the HomeKit standard should be named in a human-readable way. If you see UUIDs as names then the device manufacturer added self-defined data. If it is known what they provide this could be added to the adapter (e.g. as the ones added for Elgato devices) to show up as named in next version.

The data points are created with proper states and, if available, also correct roles. Else generic roles are used.

Identify information

Devices that are not paired with any controller have an admin.identify state that can be triggered with true. In this case the relevant device should identify itself (e.g. a lamp should blink or such, so that it can be identified). This function is only available as long as the device is not paired with an controller.

Pairing information

To pair the device with this adapter instance you need to provide the pin which is shown on the device, or a lable or such. The PIN is 8 numbers beside a QR-Code. The numbers need to be entered in the format 123-45-678 (also when the dashes are not printed on the label or shown on screen!)

Right now the PIN needs to be entered into the admin.pairWithPin state - an Admin UI will follow soon.

After pairing the device to this instance it is NOT possible to also add the device to Apple Home app or such in parallel.

There might be cases that are still problematic for pairing because I was only able to test with a very few devices, so please report issues, and I will support with instructions to get the needed debugging data.

Unpairing information

To unpair just trigger the admin.unpair state with "true" and the unpair process will be executed - an Admin UI will follow soon.

Special notes for use of IP devices

IP devices are discovered using UDP packages, so your host need to be in the same network as the devices. There is currently no real way around it because the MDNS record used contains important information for the pairing process. Especially when using Docker you need to find ways (host mode, macvlan, ...) to see the UDP packages.

The main challenge for WLAN based IP devices without controls or a screen is to get them into your WLAN network. Most likely there is a manufacturer specific Mobile app to add the devices initially to your network. If this initial process also pairs the device with Apple Home you might need to unpair it afterwards (e.g. https://www.macrumors.com/how-to/delete-homekit-device/). After this it should be in your WLAN and available to pair with this adapter.

Once an IP device is paired and the IP stays the same the adapter directly connects to the device on start. SO best pin the IP in your router. If the IP has changed then the connection should be established on next discovery and the IP should be updated.

Special notes for use of BLE devices

By default, BLE is disabled in the adapter settings. After enabling the devices that are reachable can be discovered.

Because of the limitations of Bluetooth devices no "real-time updates" of state changes are available. The devices will report "important state changes" (e.g. the "On" state changes) by special packages that will trigger an immediate data refresh. Additionally, data are refreshed in the defined data polling intervals. Do not set them too short!

After a restart of the adapter bluetooth devices can not be connected directly - the system needs to receive at least one discovery package from the device to get the needed connection details. This mean BLE devices might be available a bit delayed.

Troubleshooting

Known incompatible devices

If you have issues pairing the device with this adapter please try to pair it with the normal iOS Apple Home App. If this does not work then something is weird with the device and then also this adapter can not help. Pot try a reset, but else there is not chance.

This is currently that way for some Tado Door Locks as example. They need to be paired using the Tado App which is somehow registering the device into Apple Home, but not via an official pair process.

Additional also Nuki 3 Locks (BLE) are not possible to pair because they use Hardware Authentication components that are not publicly documented by Apple.

For Netatmo a user found out how pairing could be possible when it had issue. See https://github.com/Apollon77/ioBroker.homekit-controller/issues/233#issuecomment-1311983379

Other potential issues to check before opening a ticket

for BLE devices
General advices

Debugging

When you have issues and want to report an Issue (see below) then enhanced debug log is always helpful.

Resources and Links

TODO

Changelog

0.5.10 (2024-01-26)

0.5.9 (2023-11-23)

0.5.8 (2023-02-27)

0.5.7 (2023-01-27)

0.5.6 (2023-01-05)

0.5.5 (2022-12-31)

0.5.3 (2022-12-22)

0.5.2 (2022-12-22)

0.5.1 (2022-06-10)

0.5.0 (2022-06-08)

0.4.4 (2022-05-06)

0.4.3 (2022-01-25)

0.4.2 (2022-01-25)

0.4.1 (2022-01-21)

0.4.0 (2022-01-21)

0.3.3 (2021-10-26)

0.3.1 (2021-10-25)

0.3.0 (2021-10-24)

0.2.0 (2021-10-23)

0.1.0 (2021-10-19)

0.0.x

License

MIT License

Copyright (c) 2021-2024 Ingo Fischer github@fischer-ka.de

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.