Hi,
I’ve been experimenting with the HomeKit Security System.
Two items are created - A current state item, and a target state item.
My items are:
HouseAlarm_State
HouseAlarm_TargetState
HouseAlarm_State
has the HomeKit Metadata tag CurrentSecuritySystemState
and HouseAlarm_TargetState
has the HomeKit Metadata tag TargetSecuritySystemState
Both are Strings. And each have a state desciption to change the display label STAY_ARM to HOME etc and adding the Command Options required for interacting with the item -
- STAY_ARM / AWAY_ARM / NIGHT_ARM / DISARMED / TRIGGERED for Current State item
- STAY_ARM / AWAY_ARM / NIGHT_ARM / DISARM for Target State item
Although these are the only mandatory tags listed in the docs, I seemed to need to add the SecuritySystem.Name tag to the Equipment level item, HouseAlarm
, to make the item show in Apple Home app on iOS.
Without this I was getting the following errors when I added all Metadata -
2022-02-15 20:11:21.085 [WARN ] [.accessories.HomekitAccessoryFactory] - Accessory of type SecuritySystem must have following characteristics [SECURITY_SYSTEM_CURRENT_STATE, SECURITY_SYSTEM_TARGET_STATE]. Found only [Item:HouseAlarm_State (Type=StringItem, State=NIGHT_ARM, Label=Mode, Category=alarm, Groups=[HouseAlarm, gSelection_ItemsToRestoreOnStartUp]) HomeKit type:SECURITY_SYSTEM HomeKit characteristic:SECURITY_SYSTEM_CURRENT_STATE]
and
2022-02-15 20:37:21.325 [WARN ] [.accessories.HomekitAccessoryFactory] - Accessory of type SecuritySystem must have following characteristics [SECURITY_SYSTEM_CURRENT_STATE, SECURITY_SYSTEM_TARGET_STATE]. Found only [Item:HouseAlarm_TargetState (Type=StringItem, State=DISARM, Label=Target Mode, Category=alarm, Tags=[Setpoint], Groups=[HouseAlarm]) HomeKit type:SECURITY_SYSTEM HomeKit characteristic:SECURITY_SYSTEM_TARGET_STATE]
Confusing at first to have two items (current and target), but the logic seems to be that timers can be added (for leaving the house before it arms etc), which makes the Apple Home app display things like “Arming…” and “Disarming…” during any time delays.
*HINT A rule must be created to update the Current state to be the same as the target state. Either immediately, or with an added delay.
This appears to be functionally working for me for the most part now. But I am still getting errors in the logs that make me think this isn’t setup correctly yet.
I am sending commands STAY_ARM
, NIGHT_ARM
, AWAY_ARM
, etc, and even though the desired action happpens, I am getting these error messages -
2022-02-16 11:42:33.778 [WARN ] [ssories.AbstractHomekitAccessoryImpl] - Wrong value STAY_ARM for CurrentSecuritySystemState characteristic of the item HouseAlarm_State. Expected one of following [HOME, AWAY, NIGHT, DISARMED, TRIGGERED]. Returning DISARMED.
This log doesn’t make sense. The rule I wrote sent STAY_ARM
to Current State when Target state changed to STAY_ARM
. Current State shouldn’t be expecting HOME, AWAY, NIGHT. It should be expecting STAY_ARM, AWAY_ARM, NIGHT_ARM etc Despite all of this, all items update as expected.
2022-02-15 20:36:35.816 [WARN ] [ssories.AbstractHomekitAccessoryImpl] - Wrong value DISARM for CurrentSecuritySystemState characteristic of the item HouseAlarm_TargetState. Expected one of following [STAY_ARM, AWAY_ARM, NIGHT_ARM, DISARMED, TRIGGERED]. Returning DISARMED.
This also doesn’t make any sense. The item HouseAlarm_TargetState was sent DISARMED, not DISARM. And it shouldn’t be expecting these commands that include DISARMED and TRIGGERED as these are the commands the item tagged with TargetSecuritySystemState, not CurrentSecuritySystemState. Again, despite these errors, the items appear to behave correctly by updating and sending states back and forth to the iOS Home app.
Another similar error was -
2022-02-15 22:21:27.986 [WARN ] [ssories.AbstractHomekitAccessoryImpl] - Wrong value DISARMED for TargetSecuritySystemState characteristic of the item HouseAlarm_TargetState. Expected one of following [STAY_ARM, AWAY_ARM, NIGHT_ARM, DISARM]. Returning DISARM.
Anyone have any thoughts on any of this?