I have several switchable sockets that offer the option of measuring current and power.
I connect these to Apple Home via openHAB using the HomeKit add-on.
As well as showing the switch status (Outlet.OnState characteristic in the HomeKit add-on), Apple HomeKit can display whether the outlet is in use (Outlet.InUseStatus characteristic in the HomeKit add-on).
The update of Outlet.InUseStatus does not work for me.
I have a towel warmer plugged into an outlet. I can turn off the outlet completely, or just turn off the towel warmer using its control.
If the outlet is turned on and the towel warmer is turned off via its control, I want to see in Apple Home that the outlet is turned on, but “Outlet is in use” (in the detailed view of the accessory in Apple Home) should be set to “No”.
So I suspect that the change in the value of the item with homekit="Outlet.InUseStatus" is not being propagated.
Measures
I have already restarted OpenHAB and cleared the cache using the command openhab-cli clean-cache.
My setup
openHAB: 5.0.3 - Release Build
org.openhab.io.homekit: 5.0.3
java: openjdk 21.0.9 2025-10-21 LTS
I control the Outlet.InUseStatus using a rule. This works perfectly and the changes appear in my openHAB sitemap as expected.
I have posted the ruleand the related items under Nice (?) rule in Python for updating the HomeKit characteristic “Outlet.InUseStatus”
items
Group gCurrentItems "Items für die Strommessung zum Setzen von InUseStatus"
Group g1_8_3__AMI_0416_03 "PA 1.8.3, MDT AMI-0416.03"
Group:Switch:OR(ON,OFF) gTowel_warmer "Handtuchwärmer (Accessory)" { homekit="Outlet" }
Switch ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1_OnState "Handtuchwärmer Schalten [%s]" (g1_8_3__AMI_0416_03, gTowel_warmer) { homekit="Outlet.OnState", channel="knx:device:mybridge1:knx2oh__1_8_3:ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1" }
Switch ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1_InUseStatus "Handtuchwärmer in Nutzung [%s]" (g1_8_3__AMI_0416_03, gTowel_warmer) { homekit="Outlet.InUseStatus" }
Switch ch1_8_3___MD__1_M__4_MI__1_O__2__4_R__2 "Handtuchwärmer Sperren [%s]" (g1_8_3__AMI_0416_03, gTowel_warmer) { channel="knx:device:mybridge1:knx2oh__1_8_3:ch1_8_3___MD__1_M__4_MI__1_O__2__4_R__2" }
Switch ch1_8_3___MD__1_M__4_MI__1_O__2__7_R__3 "Handtuchwärmer Status [%s]" (g1_8_3__AMI_0416_03, gTowel_warmer) { channel="knx:device:mybridge1:knx2oh__1_8_3:ch1_8_3___MD__1_M__4_MI__1_O__2__7_R__3" }
Number ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28 "Handtuchwärmer Strommesswert [%.1f mA]" (g1_8_3__AMI_0416_03, gTowel_warmer, gCurrentItems) { channel="knx:device:mybridge1:knx2oh__1_8_3:ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28" }
Switch ch1_8_3___MD__1_M__4_MI__1_O__2__17_R__25 "Handtuchwärmer Zähler zurücksetzen [%s]" (g1_8_3__AMI_0416_03, gTowel_warmer) { homekit="Switchable.OnState", expire="2s, command=OFF", channel="knx:device:mybridge1:knx2oh__1_8_3:ch1_8_3___MD__1_M__4_MI__1_O__2__17_R__25" }
Number ch1_8_3___MD__1_M__4_MI__1_O__2__18_R__26 "Handtuchwärmer Zähler Leistung [ %.1f Wh]" <energy> (g1_8_3__AMI_0416_03, gTowel_warmer) ["EnergySensor"] { channel="knx:device:mybridge1:knx2oh__1_8_3:ch1_8_3___MD__1_M__4_MI__1_O__2__18_R__26" }
Logging
I take a closer look at the accessory, the Outlet “Handtuchwärmer (Accessory)”:
openhab> openhab:homekit list | grep -i "Handtuchwärmer \(Accessory\)"
1583006506 Handtuchwärmer (Accessory)
openhab> openhab:homekit show 1583006506
1583006506 Handtuchwärmer (Accessory)
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":"Handtuchwärmer (Accessory)","maxLen":255}
SerialNumberCharacteristic: {"iid":0,"type":"30","perms":["pr"],"format":"string","value":"gTowel_warmer","maxLen":255}
FirmwareRevisionCharacteristic: {"iid":0,"type":"52","perms":["pr"],"format":"string","value":"none","maxLen":255}
Service Type: OutletService (00000047-0000-1000-8000-0026BB765291)
Characteristics:
OnCharacteristic: {"iid":0,"type":"25","perms":["pr","pw","ev"],"format":"bool","value":true}
OutletInUseCharacteristic: {"iid":0,"type":"26","perms":["pr","ev"],"format":"bool","value":true}
openhab>
Why is the iid always/for every characteristic 0 (…Characteristic: {"iid":0…)?
Is that intended?
I enabled logging
lopenhab> log:set TRACE org.openhab.io.homekit.internal
openhab> log:set TRACE io.github.hapjava
That is part of the output
(with tail -f /var/log/openhab/openhab.log | grep -e "1583006506" -e "getOutlets_4" -e "gTowel_warmer")
The following output is produced when I switch the outlet completely on and off (via the Outlet.OnState item), or when I only switch the consumer supplied by the outlet (what result in Set ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1_InUseStatus.
2025-12-19 14:31:19.973 [TRACE] [er.impl.http.HomekitClientConnection] - 200 GET /characteristics?id=1583006506.10
{"characteristics":[{"value":true,"aid":1583006506,"iid":10}]}
GET /characteristics?id=1583006506.9 HTTP/1.1
2025-12-19 14:31:34.738 [TRACE] [er.impl.http.HomekitClientConnection] - 200 GET /characteristics?id=1583006506.9
{"characteristics":[{"value":true,"aid":1583006506,"iid":9}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":0}]}
GET /characteristics?id=1844117567.11,1844117567.13,1844117567.10,1844117567.12,1844117567.9,743075141.10,743075141.9,882987885.9,930867408.10,930867408.9,1045385010.10,1045385010.9,1583006506.9,873608922.9,873608922.10,988126524.9,988126524.10 HTTP/1.1
2025-12-19 14:31:49.348 [TRACE] [er.impl.http.HomekitClientConnection] - 200 GET /characteristics?id=1844117567.11,1844117567.13,1844117567.10,1844117567.12,1844117567.9,743075141.10,743075141.9,882987885.9,930867408.10,930867408.9,1045385010.10,1045385010.9,1583006506.9,873608922.9,873608922.10,988126524.9,988126524.10
{"characteristics":[{"value":20.3,"aid":1844117567,"iid":11},{"value":0,"aid":1844117567,"iid":13},{"value":1,"aid":1844117567,"iid":10},{"value":21.5,"aid":1844117567,"iid":12},{"value":1,"aid":1844117567,"iid":9},{"value":100,"aid":743075141,"iid":10},{"value":100,"aid":743075141,"iid":9},{"value":false,"aid":882987885,"iid":9},{"value":100,"aid":930867408,"iid":10},{"value":100,"aid":930867408,"iid":9},{"value":100,"aid":1045385010,"iid":10},{"value":100,"aid":1045385010,"iid":9},{"value":true,"aid":1583006506,"iid":9},{"value":100,"aid":873608922,"iid":9},{"value":100,"aid":873608922,"iid":10},{"value":100,"aid":988126524,"iid":9},{"value":100,"aid":988126524,"iid":10}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":0}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
2025-12-19 14:32:00.895 [DEBUG] [omation.pythonscripting.getOutlets_4] - triggering item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28)
2025-12-19 14:32:01.093 [INFO ] [omation.pythonscripting.getOutlets_4] - Set ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1_InUseStatus -> ON (triggered by ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28=236)
2025-12-19 14:32:01.143 [INFO ] [ting.getOutlets_4.on_current_changed] - Rule executed in 369.8 ms [Item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28]
GET /characteristics?id=1583006506.10 HTTP/1.1
2025-12-19 14:32:10.358 [TRACE] [er.impl.http.HomekitClientConnection] - 200 GET /characteristics?id=1583006506.10
{"characteristics":[{"value":true,"aid":1583006506,"iid":10}]}
2025-12-19 14:32:13.964 [DEBUG] [omation.pythonscripting.getOutlets_4] - triggering item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28)
2025-12-19 14:32:14.003 [INFO ] [omation.pythonscripting.getOutlets_4] - Set ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1_InUseStatus -> OFF (triggered by ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28=0)
2025-12-19 14:32:14.082 [INFO ] [ting.getOutlets_4.on_current_changed] - Rule executed in 70.7 ms [Item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28]
2025-12-19 14:32:24.052 [DEBUG] [omation.pythonscripting.getOutlets_4] - triggering item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28)
2025-12-19 14:32:24.103 [INFO ] [omation.pythonscripting.getOutlets_4] - Set ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1_InUseStatus -> ON (triggered by ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28=236)
2025-12-19 14:32:24.128 [INFO ] [ting.getOutlets_4.on_current_changed] - Rule executed in 81.5 ms [Item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28]
{"characteristics":[{"aid":1583006506,"iid":9,"value":false}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":false}]}
2025-12-19 14:32:53.086 [TRACE] [impl.connections.SubscriptionManager] - Publishing change for 1583006506
2025-12-19 14:32:53.095 [TRACE] [impl.connections.SubscriptionManager] - Publishing change for 1583006506
{"characteristics":[{"aid":1583006506,"iid":9,"value":false}]}
{"characteristics":[{"aid":1583006506,"iid":10,"value":false}]}
2025-12-19 14:32:53.143 [DEBUG] [omation.pythonscripting.getOutlets_4] - triggering item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28)
2025-12-19 14:32:53.239 [INFO ] [omation.pythonscripting.getOutlets_4] - Set ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1_InUseStatus -> OFF (triggered by ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28=0)
2025-12-19 14:32:53.273 [INFO ] [ting.getOutlets_4.on_current_changed] - Rule executed in 140.5 ms [Item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28]
2025-12-19 14:32:54.195 [TRACE] [impl.connections.SubscriptionManager] - Publishing change for 1583006506
2025-12-19 14:32:54.235 [TRACE] [impl.connections.SubscriptionManager] - Publishing change for 1583006506
{"characteristics":[{"aid":1583006506,"iid":10,"value":true}]}
{"characteristics":[{"aid":1583006506,"iid":9,"value":true}]}
2025-12-19 14:32:55.193 [DEBUG] [omation.pythonscripting.getOutlets_4] - triggering item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28)
2025-12-19 14:32:55.323 [INFO ] [omation.pythonscripting.getOutlets_4] - Set ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1_InUseStatus -> ON (triggered by ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28=22)
2025-12-19 14:32:55.371 [INFO ] [ting.getOutlets_4.on_current_changed] - Rule executed in 233.7 ms [Item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28]
2025-12-19 14:32:55.925 [DEBUG] [omation.pythonscripting.getOutlets_4] - triggering item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28)
2025-12-19 14:32:55.978 [INFO ] [omation.pythonscripting.getOutlets_4] - Set ch1_8_3___MD__1_M__4_MI__1_O__2__0_R__1_InUseStatus -> ON (triggered by ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28=236)
2025-12-19 14:32:56.001 [INFO ] [ting.getOutlets_4.on_current_changed] - Rule executed in 81.6 ms [Item: ch1_8_3___MD__1_M__4_MI__1_O__2__12_R__28]
it appears that
2025-12-19 14:32:54.235 [TRACE] [impl.connections.SubscriptionManager] - Publishing change for 1583006506
{"characteristics":[{"aid":1583006506,"iid":9,"value":false}]}
{"characteristics":[{"aid":1583006506,"iid":10,"value":false}]}
tries to update Outlet.OnState and Outlet.InUseStatus.
But with no effect in the Apple Home GUI.
I guess 'iid':9 and 'iid':10 are the characteristics for Outlet.OnState and Outlet.InUseState.
Right?
But these ids do not show up with
openhab> openhab:homekit show 1583006506 .
Findings
I never noticed that only one of the two characteristics should be updated. I would have thought that was pretty likely. The two characteristics always went hand in hand. I thought the point was that Outlet.OnState and Outlet.InUseStatus could be set separately?!
Any idea what might be wrong?