Hi
Ideally:
2 Plugin -> HomeKitLink issues:
1.
Ideally your plugin will need to report the state of the alarm, or alarm partition in homekit security format - and as a device state within your plugin.
Eg.
Joe had started with Simplisafe plugin - although we haven’t finished integration as yet.
https://github.com/FlyingDiver/Indigo-S ... evices.xml & state conversion here:
- Code: Select all
HK_ALARM_STAY_ARMED = 0
HK_ALARM_AWAY_ARMED = 1
HK_ALARM_NIGHT_ARMED = 2
HK_ALARM_DISARMED = 3
HK_ALARM_TRIGGERED = 4
HOMEKIT_STATE = {
simplipy.system.SystemStates.ALARM: HK_ALARM_TRIGGERED,
simplipy.system.SystemStates.ALARM_COUNT: HK_ALARM_TRIGGERED,
simplipy.system.SystemStates.AWAY: HK_ALARM_AWAY_ARMED,
simplipy.system.SystemStates.AWAY_COUNT: HK_ALARM_AWAY_ARMED,
simplipy.system.SystemStates.ENTRY_DELAY: HK_ALARM_AWAY_ARMED,
simplipy.system.SystemStates.ERROR: HK_ALARM_DISARMED,
simplipy.system.SystemStates.HOME: HK_ALARM_STAY_ARMED,
simplipy.system.SystemStates.HOME_COUNT: HK_ALARM_STAY_ARMED,
simplipy.system.SystemStates.OFF: HK_ALARM_DISARMED,
simplipy.system.SystemStates.TEST: HK_ALARM_DISARMED,
simplipy.system.SystemStates.UNKNOWN: HK_ALARM_DISARMED,
}
- Code: Select all
<State id="homekit_state" defaultValue="">
<ValueType>Number</ValueType>
<TriggerLabel>HomeKit State</TriggerLabel>
<ControlPageLabel>HomeKit State</ControlPageLabel>
</State>
2.
You will within your plugin a ActionGroup that ideally responses to homekit states for HK plugin to change states.
https://github.com/FlyingDiver/Indigo-S ... ctions.xml- Code: Select all
<Action id="homekit_set_mode" uiPath="hidden">
<CallbackMethod>homekit_set_mode</CallbackMethod>
</Action>
<Action id="set_mode" deviceFilter="self.system">
<Name>Set Mode</Name>
<CallbackMethod>action_set_mode</CallbackMethod>
<ConfigUI>
<Field id="mode" type="menu" defaultValue="away">
<Label>Mode:</Label>
<List>
<Option value="off">Off</Option>
<Option value="home">Home</Option>
<Option value="away">Away</Option>
</List>
</Field>
</ConfigUI>
</Action>
3/
I’ll need to add support to HomeKitLink to recognise and support your security device type, running the above action when off, home or away selected.
Hopefully makes sense.
Glenn
Sent from my iPad using Tapatalk