HomeKit Binding: my experiments

Hello openHAB-Users,

first: openHAB is really great! It is fantastic to combine all those protocols!

With OpenHABian (version unknown), iOS 11 beta:

Januar 2017: Homekit pairing wasn’t working.
April (?) - Dezember 2017: suddenly it worked. We really liked it, at most the easy setup of Timers with the smartphone. Everything worked perfectly: sharing, voice control via Siri, remote control. Thank you! :slight_smile:

Then, i moved to a virtual Ubuntu machine with OH 2.2. HomeKit didn’t worked - sometimes the pairing process was successful, all items were discovered correctly, it was possible to switch the physical devices on an off. But after a small time, all devices got the red tag “no response/keine Antwort”. Reboot, repairing doesn’t helped.

Tried downgrading to 2.1: same problem.
Upgrading to the latest 2.3 Snapshot build: same behavior: pairing worked, switching items from “on” to “off” an back worked(! ):slight_smile: , then all devices got the red tag. Tried again, with removing both AppleTVs from the network, deleting all HomeKit settings. No success. I have no idea what to do now.

My workaround: get used to the rule/automation setting via the Web PaperUI and looking for this “homebridge” project. But the author of this program states, he will be happy, if his project isn’t necessary anymore.

So, this is my experience so far. Liked the HomeKit really, but now, i can’t do more than waiting.

Best regards!

Richard

Edit: It sounds like we have the same problem (pairing and using worked at first, then loosing functionality):

Hi @rrichard,

seems to be some quite frustrating experiences. I was suffering also some issues with homekit integration in the past. Now I’m working with a fairly stable setup via node-red. There is a thread that gets you started with the same:

Hello Matthias,

thank you for your hint!

Tried out one last time to reset my Homekit (misc-homekit - 2.3.0.SNAPSHOT) binding in OpenHAB, but it (or the part on the apple side) failed again. So i decided to follow your suggestion.

Next experiment with Node-RED:

  • Installed Node-RED on the same Ubuntu 16.04 machine which runs OpenHAB 2.3, as a package, as described on the site https://nodered.org/docs/getting-started/installation and https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

  • Version with “node -v” is v8.9.4

  • “sudo npm install -g --unsafe-perm node-red”

  • started “node-red” on the console and browsed to :1880 and it worked.

  • Had a little struggle with the automated startup on every boot, the manuals describes several methods.

  • Found working path with “which node-red”

  • sudo nano /etc/systemd/system/node-red.service (put configuration in this file), sudo systemctl enable node-red, sudo systemctl start node-red, sudo systemctl status node-red seemed to be running.

  • installed the “Node-RED to OpenHAB coupling/binding” package node-red-contrib-openhab2@1.1.3
    with “npm install node-red-contrib-openhab2”

  • restart service, then a section “home automation” at the left bottom on the Node-RED homepage appears with a green “Openhab” icon.

  • Same procedures for the “Node-RED to HomeKit coupling/binding” “sudo apt-get install libavahi-compat-libdnssd-dev” and “npm install node-red-contrib-homekit” . There is now a section “advanced” with an … orange … “Homekit” icon. Huh.

  • Then i created a “flow” on the Node-RED with the function to read a message coming from HomeKit, convert and send it to OpenHAB. Deployed the flow (icon on the upper right side). Coupling with the Home-App on the iOS was fast and easy.

There is a Node-RED to KNX binding, but i did not used that

So, now i was able to switch a outlet with the Home App. Happy? NO! Because over night, Home lost the connection like the other Homekit binding i described in my first post. Problem: switching worked, then a red tag with “No Answer” appears in the Home-App. Restarting, re-deploying help for two minutes, then the connection was lost again.

Conclusion: i learned a lot, Node-RED is really powerful (downside: “simply” controlling a outlet demands to create a “flow” with five steps). For me it looks like the problem lies within Apple (or my AVM Fritzbox Network), because different approaches led to the same problem.

Wasted time? Yes an no: this Node-RED solution could (perhaps) be easier then the OpenHAB Rule Engine. I don’t know yet.

Best regards

Richard

Think i found the solution. How often i have red this sentence.

Changed the network setting of the virtual machine which runs openhab within KVM: from macvtap to bridging mode.

Deleted the “home” on Apple Homekit App. (And switch off AppleTV)

Then, in OpenHAB:

Disabled ipv6

sudo find / -name "*homekit*"
sudo rm /opt/openhab2/userdata/config/org/openhab/homekit.config

also removed from /conf/services/ any homekit configuration file.

Within the OpenHAB Console:

smarthome:homekit clearPairings
smarthome:homekit allowUnauthenticated true

Reboot.

Repair.

Huh Hah.

1 Like