Need to reset HomeKit pairing at every launch

David,

thank for the report. happy to hear that homekit works for you now.

this is why i hate this issue - it is difficult to re-produce and to catch… it appears suddenly and disappears again without any changes on the configuration.

Eugen,
I enabled logging according to your recommendation and caught the error. Are you interested in the logs?

Hi Florian,

sure, please share, maybe we will finally find the root cause and fix it.

Hi Eugen,

i have the same issue. After every re-boot i need to re-pair again. here is a trace log, i hope this sheds some light.

Homekit trace log.txt (101.5 KB)

I am on 3.1.0 M3

thanks. very interesting.
one question already: can you double check that you have only one homekit addon running? either via karaf
“list | grep -i homekit”
or UI

Hi Eugen,

just one.

can you try to deactivate the usage of openHAB in mDNS service.

i see these lines and it looks very strange… like multiple instance starting and stopping again and again. maybe it crashing for another reason, e.g. memory, space on sd card, access rights to directories

2021-04-16 13:42:37.098 .. Suitable mDNS client for IP /192.168.178.90 found and will be used for HomeKit
2021-04-16 13:48:35.073 ... stop debouncer
2021-04-16 13:48:37.206 .. - Suitable mDNS client for IP /192.168.178.90 found and will be used for HomeKit
2021-04-16 13:48:42.895 .. - stop debouncer
2021-04-16 13:48:45.015 .. - Suitable mDNS client for IP /192.168.178.90 found and will be used for HomeKit
2021-04-16 13:49:49.931 ... - stop debouncer
2021-04-16 13:49:52.149 ... - Create HomeKit server with dedicated mDNS server
2021-04-16 13:51:32.409 ... - stop debouncer
2021-04-16 13:51:34.575 .. - Suitable mDNS client for IP /192.168.178.90 found and will be used for HomeKit

it should be actually only one line, without “stop debouncer”.
e.g. on my side

021-04-16T15:25:48+00:00 oh openhab[17917] Create HomeKit server with dedicated mDNS server
2021-04-16T15:25:48+00:00 oh openhab[17917] Registering _hap._tcp.local. on port 9124

Hi Eugen,
here is the complete trace, Terminated at 12:31
Please let me know if you need more.Trace.txt (244.3 KB)

Hi Eugen,

i did some tests. I have commented this in the trace. Will send it with PM.

without mDNA there is no connection. With mDNA enabled i had to re-pair. After another restart of openHAB the connections stayed alive. Before i noticed that the homekit.json did not have any user included anymore. After re-pairing and re-start the users are still in the homekit.json. I have saved a copy and will see if the homekit users will disappear again from the file at some point. If that happens i notify you. i will keep trace on.

1 Like

Ok. I noticed, I do not need to do re-pairing, I only have to do a restart of openhab. If I do the restart the items will work again in the Apple Homekit app. If I do not make a restart of openhab all items in apples homekit app stay in “no answer”.

Florian,

can you try the different options for mDNS (use the one from openHAB or standalone), see my message above

Hi Eugen,

  1. I am running openhab 3 and homekit version 3.0.1. I looked in the UI but did noch find this mDNS setting. Is there a command line way?
  2. Yesterday the homekit connection was again lost during operation, are you interested in the log? Following behaviour:
    a) First restart (11:49 openhab_V2.log (1017.7 KB) ): no connection
    b) second restart (13:31 openhab_V3.log (202.3 KB) ): connection was there again, everything is working fine.
    So it seems not be a pairing problem. Should I issue another topic here within this community or should I leave it in here?
  3. Regarding memory, space, access rights, what kind of information do you need?
## CPU Usage = 9.69% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
##  CPU Load = 1m: 0.73, 5m: 0.56, 15m: 0.59
##    Memory = Free: 0.10GB (11%), Used: 0.84GB (89%), Total: 0.95GB
##      Swap = Free: 0.09GB (98%), Used: 0.00GB (2%), Total: 0.09GB
##      Root = Free: 0.69GB (9%), Used: 6.39GB (91%), Total: 7.41GB
  1. running “list | grep -i homekit” in Karaf results in:
    before first restart:
openhab> list | grep -i homekit
239 x Active x  80 x 3.0.1                   x openHAB Add-ons :: Bundles :: IO :: Homekit
openhab>

a) after first restart: result from list | grep -i homekit is empty
b) after second restart: result from list | grep -i homekit shows:

openhab> list | grep -i homekit
239 x Active x  80 x 3.0.1                   x openHAB Add-ons :: Bundles :: IO :: Homekit
openhab>

Hi Eugen, just to report that my homekit instance is still stable. homekit.json users are still there and no connection lost yet. Fingers crossed.

As a reminder, i am on 3.1.0 M3.

1 Like

Hi Eugen,
Homekit is losing connections on a daily basis. Is there something more, that I can do? I did not find the mDNS settings.

Hi Florian,

it is very strange that addon disappeared after first restart

as first, i would recommend to update to milestone build 3.1.0 M3. it fixes the issue with mDNS.

in order to update it, execute following commands in karaf

  1. list | grep -i homekit
    remember the id of the homekit add on
  2. update <addon_id> https://openhab.jfrog.io/artifactory/libs-milestone/org/openhab/addons/bundles/org.openhab.io.homekit/3.1.0.M3/org.openhab.io.homekit-3.1.0.M3.jar

it looks like this on my side

Hi Eugen,
yes very strange:

  1. list | grep -i homekit delivers empty
  2. list -s delivers:
    239 │ Active │ 80 │ 3.0.1 │ org.openhab.io.homekit
    240 │ Active │ 75 │ 3.0.1 │ org.openhab.transform.map
    241 │ Active │ 80 │ 3.0.1 │ org.openhab.ui.basic
    242 │ Active │ 80 │ 3.0.1 │ org.openhab.ui.habpanel
    243 │ Active │ 80 │ 3.0.1 │ org.openhab.ui.iconset.classic
    244 │ Active │ 80 │ 3.0.1 │ org.openhab.persistence.rrd4j
    245 │ Active │ 80 │ 3.0.1 │ org.openhab.binding.miio
    openhab> list | grep -i homekit
    openhab>
    `
  3. I did updated with
    openhab> update 239 https://openhab.jfrog.io/artifactory/libs-milestone/org/openhab/addons/bundles/org.openhab.io.homekit/3.1.0.M3/org.openhab.io.homekit-3.1.0.M3.jar
    and list -s now shows:
    239 │ Active │ 80 │ 3.1.0.M3 │ org.openhab.io.homekit
    list | grep -i homekit still delivers empty.

I will watch everything and let you know. Is there more I can provide?

Hi Eugen,
there was again a connection lost today. After restarting openhab with sudo shutdown -r restart,everything was fine again. Should I do a complete new installation of openhab with a fresh sd card image?

i cannot explain why “list | grep -i homekit” does not return anything.maybe something with grep. but if you do just “list” you should see homekit.

but before you do clean installation, please try different mDNS settings in homekit setting. now with M3 you should have them.
please make sure you also have set correct IP address in homekit settings via UI.

Ok. I did as you suggested:

  1. Wednesday: homekit was working, mDNS was turned OFF (slide control to the left as in image above)
  2. Thursday: homekit app in ios showed “no answer”, after that I turned mDNS ON (slide control to the right): homekit app in ios showed immediatly, that everything is fine
  3. after 2hours: homekit app in ios showed “no answer”, after that I turned mDNS OFF (slide control to the left): homekit app in ios showed immediatly, that everything is fine

Strange.
Network Interface in homekit is set correctly to 192.168.178.22
Openhab is running on port 8080
Phoscon GW is running on port 80
Port in homekit is set to 9123
I have Fritzbox 7530 and a Mesh repeater, Raspberry PI is connected via WLAN. No special settings for ports activated in Fritzbox

ok. that makes clear that the issue is with mDNS.
im aware of 2 related discussions

see here