HomeKit major issue - need help to restore

Hi:
I have been using Homekit binding for a couple of years and made no change to the setup for the past 30 days. Yesterday I noticed one of my Heater/Cooler shows target mode “null” in Home app, and I tried to fix it by changing the mode a couple of time from Home app, eventually the accessory is in “Updating” then “No Response” state. I have seen similar problems in the past when some of my complex accessories (heater/cooler with many items linked) mixed some channels with wrong items. For example a Heater/Cooler can suddenly link fan rotation speed to target temperature item, usually this only affect 1 accessory and can be fixed by deleting and re-creating the accessory (item file).
However yesterday it was different, all accessories exposed by OpenHAB bridge shows “Updating” then “No Reponse”, I have 50 accessories exposed by single bridge instance. So what I have tried:

  1. Restart OpenHAB
  2. Clean cache tmp then restart OpenHAB
  3. Restart server (my NAS)
  4. Restart all network components
  5. Disable Dummy accessory mode
  6. Change port of the Homekit bridge
    (I have enabled TRACE in log file but couldn’t find any errors or warnings that could indicate where is the problem)
    None of the above solves the issue, so I was in great panic mode as many of the exposed accessories are critical for automations to run (the heating system, ventilation system etc.) I find since newer version OpenHAB support multiple instances of HomeKit bridge, so I started to move accessories from the main default bridge to other instances, and immediately they start to work again with the new bridge instance.
    However I only manage to partially restore the functionality and now I’m encountered with problem deleting the unresponsive accessories from the old bridge instance:
  • Home app doesn’t provide the option to delete individual accessory from the bridge, I don’t know if it’s HomeKit limitation or something else
  • I disable dummy mode and thought that HomeKit binding will “remove” the accessories that have been moved from the main instance to other instances, but it didn’t work, all 50 accessories are still exposed despite many of them now moved to another instance
  • No matter how many ways I try, I can’t seem to move the Irrigation System to other instance, I have tagged both the Irrigation System and Valves, when I try to add the bridge to HomeKit it says the bridge is incompliant (something like that).

I don’t know what happened with my setup as it worked fine in the past week with no issue and suddenly everything stops working. Since I have now started to migrate to multiple bridge instances I’d continue the path to minimize single accessory that could potentially bring down many others. However I can’t seem to migrate everything (Irrigation System for example), and also couldn’t find a way to remove the old accessories which are already moved to new HomeKit bridge instances. So I create this post and really hope somebody can help me to get out of it. Thank you in advance!

I’ve used homekit as the gui for my family members for a few years just for the convenience of an integration point that’s already on their phones, siri, carplay, etc… iPad as the ‘hub’ and openhab bridge.

But it’s slowly getting harder and harder to use. Sharing, remote access, automations, presence detection have all slowly gone away. I can still use it on my own phone, but I’ve pretty much given up on it.

That being said have you tried restarting your homekit hub device? iPad, homepod, etc. ?

FYI, having gone through the cleaning cache, deleting HomeKit.json, changing the port etc. routine, I don’t know how many times in the past with openHAB 2.5, I finally came across

and it has been running flawlessly for years with my OH 2.5 setup, adding links to new items only required a restart of it and all was fine.

Now having changed over to openHAB 4.3.3 I thought I’d give the built in HomeKit
integration another chance again, but unfortunately I have to say that the problems started again straight away.

So back to OpenHAB2 - Complete with 4.3.3, set it up once and now it is running and running and doing what it is supposed to do, without any hiccups.

I just wish the two could merge to bring a native HomeKit support to openHAB which actually works without all the hassle and frustration :wink:

IF… you are ready to try a BETA plugin, The Matter plugin can replace the HomeKit plugin.
One advantage of using the Matter plugin is that it is bidirectional, in addition to exposing OH items to Apple Home, Apple Home accessories can be exposed to OH.

Since Apple is embracing Matter, it is a “native” plugin.

Yes I did restart ATV and also tried to move the hub to my HomePod, the issue is still there. I think some accessory get in error state and mixed the characteristics with others and causing all accessories down.
I mainly use HomeKit as GUI, try to move most automations to OpenHAB (there is very limited automation in HK anyways). However I have device with unknown protocol and only work with HK, so unfortunately it’s still my default solution for front-end (also more wife and kids friendly).

I did use this long time ago, even contributed some bug fixes there, but the support is abandoned and the author wrote that he prefers the build-in HK integration so I migrated everything to OH.
I’m in general happy with it and the coverage is great for what I need, I think the only thing it doesn’t support is TV remote (HomeBridge is more complete in that regard). I have from time to time experience stability issues, and I find sometimes channels can be mixed up, but overall I’d say it’s very stable.

I use the Matter plugin as well, it’s very promising and I will from now on only buy Matter devices, the coverage is also going to be great (for example the robot vacuum support in Apple HomeKit is via Matter). I think eventually it will replace HomeKit however there are still native Apple features only on Homekit.

I think I found the accessory that caused all the issues. I have remove the definition and then prune the dummy accessories, everything on my main bridge is online now. However I don’t understand what’s wrong with the accessory. Maybe @yfre appreciate your input on this (sorry to ping you). The below definition worked fine for more than 1 month, and there has been no change made since:


Group                   gRiceCookerHomekit
                        "Rice Cooker"
                        (gRiceCooker)
                        {homekit="IrrigationSystem"}
String                  riceCookerProgramMode
                        (gRiceCookerHomekit)
                        {homekit="ProgramMode"}
Switch                  riceCookerEnabled
                        (gRiceCookerHomekit)
                        {homekit="Active,InUseStatus"}
Number                  riceCookerTotalRemaining
                        (gRiceCookerHomekit)
                        {homekit="RemainingDuration"}

Group                   gSlowCook
                        "Slow Cook Rice"
                        (gRiceCookerHomekit)
                        {homekit="Valve"[ServiceIndex=1]}
Switch                  slowCookActive
                        (gSlowCook)
                        {homekit="ActiveStatus,InUseStatus"}
Number                  slowCookDuration
                        (gSlowCook)
                        {homekit="Duration"}
Number                  slowCookRemainingDuration
                        (gSlowCook)
                        {homekit="RemainingDuration"}

Group                   gFastCook
                        "Fast Cook Rice"
                        (gRiceCookerHomekit)
                        {homekit="Valve"[ServiceIndex=2]}
Switch                  fastCookActive
                        (gFastCook)
                        {homekit="ActiveStatus, InUseStatus"}
Number                  fastCooktDuration
                        (gFastCook)
                        {homekit="Duration"}
Number                  fastCookRemainingDuration
                        (gFastCook)
                        {homekit="RemainingDuration"}

Group                   gWarmUp
                        "Warm Up Rice"
                        (gRiceCookerHomekit)
                        {homekit="Valve"[ServiceIndex=3]}
Switch                  warmUpActive
                        (gWarmUp)
                        {homekit="ActiveStatus,InUseStatus"}
Number                  warmUpDuration
                        (gWarmUp)
                        {homekit="Duration"}
Number                  warmUpRemainingDuration
                        (gWarmUp)
                        {homekit="RemainingDuration"}

The services:

Services:
  Service Type: AccessoryInformationService (0000003E-0000-1000-8000-0026BB765291)
    Characteristics:
      IdentifyCharacteristic: {"iid":0,"type":"14","perms":["pw"],"format":"bool"}
      ManufacturerCharacteristic: {"iid":0,"type":"20","perms":["pr"],"format":"string","value":"none","maxLen":255}
      ModelCharacteristic: {"iid":0,"type":"21","perms":["pr"],"format":"string","value":"none","maxLen":255}
      NameCharacteristic: {"iid":0,"type":"23","perms":["pr"],"format":"string","value":"Rice Cooker","maxLen":255}
      SerialNumberCharacteristic: {"iid":0,"type":"30","perms":["pr"],"format":"string","value":"gRiceCookerHomekit","maxLen":255}
      FirmwareRevisionCharacteristic: {"iid":0,"type":"52","perms":["pr"],"format":"string","value":"none","maxLen":255}
  Service Type: IrrigationSystemService (000000CF-0000-1000-8000-0026BB765291)
    Characteristics:
      ActiveCharacteristic: {"iid":0,"type":"B0","perms":["pr","pw","ev"],"format":"int","value":0,"valid-values":[0,1]}
      InUseCharacteristic: {"iid":0,"type":"D2","perms":["pr","ev"],"format":"int","value":0,"valid-values":[0,1]}
      ProgramModeCharacteristic: {"iid":0,"type":"D1","perms":["pr","ev"],"format":"int","value":0,"valid-values":[0,1,2]}
      RemainingDurationCharacteristic: {"iid":0,"type":"D4","perms":["pr","ev"],"format":"int","value":17,"minValue":0,"maxValue":3600,"minStep":1,"unit":"s"}
    Linked Services:
    Service Type: ValveService (000000D0-0000-1000-8000-0026BB765291)
      Characteristics:
        ActiveCharacteristic: {"iid":0,"type":"B0","perms":["pr","pw","ev"],"format":"int","value":0,"valid-values":[0,1]}
        InUseCharacteristic: {"iid":0,"type":"D2","perms":["pr","ev"],"format":"int","value":0,"valid-values":[0,1]}
        ValveTypeCharacteristic: {"iid":0,"type":"D5","perms":["pr","ev"],"format":"int","value":1,"valid-values":[0,1,2,3]}
        RemainingDurationCharacteristic: {"iid":0,"type":"D4","perms":["pr","ev"],"format":"int","value":3,"minValue":0,"maxValue":3600,"minStep":1,"unit":"s"}
        ServiceLabelIndexCharacteristic: {"iid":0,"type":"CB","perms":["pr"],"format":"int","value":2,"minValue":0,"maxValue":100,"minStep":1,"unit":"%"}
        SetDurationCharacteristic: {"iid":0,"type":"D3","perms":["pr","pw","ev"],"format":"int","value":1800,"minValue":0,"maxValue":3600,"minStep":1,"unit":"s"}
        NameCharacteristic: {"iid":0,"type":"23","perms":["pr"],"format":"string","value":"Fast Cook Rice","maxLen":255}
    Service Type: ValveService (000000D0-0000-1000-8000-0026BB765291)
      Characteristics:
        ActiveCharacteristic: {"iid":0,"type":"B0","perms":["pr","pw","ev"],"format":"int","value":0,"valid-values":[0,1]}
        InUseCharacteristic: {"iid":0,"type":"D2","perms":["pr","ev"],"format":"int","value":0,"valid-values":[0,1]}
        ValveTypeCharacteristic: {"iid":0,"type":"D5","perms":["pr","ev"],"format":"int","value":1,"valid-values":[0,1,2,3]}
        RemainingDurationCharacteristic: {"iid":0,"type":"D4","perms":["pr","ev"],"format":"int","value":-7,"minValue":0,"maxValue":3600,"minStep":1,"unit":"s"}
        ServiceLabelIndexCharacteristic: {"iid":0,"type":"CB","perms":["pr"],"format":"int","value":1,"minValue":0,"maxValue":100,"minStep":1,"unit":"%"}
        SetDurationCharacteristic: {"iid":0,"type":"D3","perms":["pr","pw","ev"],"format":"int","value":3600,"minValue":0,"maxValue":3600,"minStep":1,"unit":"s"}
        NameCharacteristic: {"iid":0,"type":"23","perms":["pr"],"format":"string","value":"Slow Cook Rice","maxLen":255}
    Service Type: ValveService (000000D0-0000-1000-8000-0026BB765291)
      Characteristics:
        ActiveCharacteristic: {"iid":0,"type":"B0","perms":["pr","pw","ev"],"format":"int","value":0,"valid-values":[0,1]}
        InUseCharacteristic: {"iid":0,"type":"D2","perms":["pr","ev"],"format":"int","value":0,"valid-values":[0,1]}
        ValveTypeCharacteristic: {"iid":0,"type":"D5","perms":["pr","ev"],"format":"int","value":1,"valid-values":[0,1,2,3]}
        RemainingDurationCharacteristic: {"iid":0,"type":"D4","perms":["pr","ev"],"format":"int","value":17,"minValue":0,"maxValue":3600,"minStep":1,"unit":"s"}
        ServiceLabelIndexCharacteristic: {"iid":0,"type":"CB","perms":["pr"],"format":"int","value":3,"minValue":0,"maxValue":100,"minStep":1,"unit":"%"}
        SetDurationCharacteristic: {"iid":0,"type":"D3","perms":["pr","pw","ev"],"format":"int","value":1800,"minValue":0,"maxValue":3600,"minStep":1,"unit":"s"}
        NameCharacteristic: {"iid":0,"type":"23","perms":["pr"],"format":"string","value":"Warm Up Rice","maxLen":255}
  Service Type: ServiceLabelService (000000CC-0000-1000-8000-0026BB765291)
    Characteristics:
      ServiceLabelNamespaceCharacteristic: {"iid":0,"type":"CD","perms":["pr"],"format":"int","value":1,"valid-values":[0,1]}

It creates only 1 accessory however in Home app it’s not there. I have now moved this to a new instance to be sure it’s not due to some cache issue. If I add the accessory before pairing, it complain the bridge is not compliant. If I pair first, then add the accessory it’s not visible in Home app. The strange thing is I made it to work 5-6 weeks ago and it worked very well, and then suddenly it stops working

have you update iOS in that time? maybe apple has additional checks.
often Apple does not like NULL or empty values.
try to set a values to all items before adding it in home app

Hi @yfre

Thank you! Last week I upgraded my iOS from 18.3.1 to 18.3.2, and after upgrade it worked fine until 2 days ago. So the root cause seems to be the irrigation system, when I removed it all accessories become responsive.
What I have tried:
Remove the items for irrigation system, run the command to prune dummy accessories, check by list command it’s indeed removed, re-add the items, and even though I have prune the dummy accessories, the log says the dummy accessory is now found, however in HomeKit it’s never exposed. And I got the same result with the following additional changes:

  1. Remove and move the irrigation system to another instance (configured from scratch)
  2. Rename the group that contains definition, rename the description, for some reason it still thinks the same accessory and tell me that now the dummy accessory is found.
    What worked at last is that I change the group names, and also names of all items, and finally it’s in HomeKit.

So based on my test, I think there is some residual which is not removed by pruning dummy accessories, and the strange part is that changing group name doesn’t unlink to the “residual” dummy accessory. Changing the item names did help to unlink from the “residual” accessory, so could it be pruning doesn’t remove the item under the group and that caused Oh still think the irrigation system exists and therefore not to expose it (or expose with same id and HomeKit already remembers)?
I also noticed some glitches when adding the irrigation system to Home app: whenever I change the settings of individual valve (name, duration), it say failed to edit the accessory, however the change still takes effect, I also noticed the same with I added this 6 weeks ago. No impact on functionality though. I use it as a time down for my rice cooker and it always worked fine

Thanks @smitopher, that does sound interesting, even if currently I’m only interested in a one-way direction, exposing openHAB items to HomeKit. Are there details for textually setting up and configuring the BETA plugin, or is it currently all UI driven?

1 Like

Hi @somy

your configuration looks correct.

typically if you still see in home devices you have removed or renamed, then you have homekit bridge, e.g. apple tv, running at home. home app speaks to bridge to get devices and sometimes bridge is not up to date with openHAB.

recommendation there is to deactivate or switch off bridge for a day or two. and check what you see in home app if bridges are off.

1 Like

Thanks that could very well be the case.