Search code examples
iosswifthomekit

isExecuting on HMActionSets always false


So far, I have implemented an application where I can create HMActionSets, and they get added to HomeKit, and they can also be executed, too (The values change accordingly in the Accessory Simulator). However, I'm facing a strange problem: whenever I call

func executeActionSet(HMActionSet, completionHandler: (Error?) -> Void)

(I get back no error, and the actionset has been actually executed). However, then I go back and look through my HMHome.actionSets array again, and check the

isExecuting

attribute -> But then it is always false.

Do you have any idea what I might be doing wrong?


Solution

  • Sadly, I couldn't figure out why this attribute is always false. However, I found a workaround if you want to know if a scene is being executed at the moment or not:

    Simply go through all of the HMActions of the HMActionSet, check if the targetValue of the HMAction is the same as the current value of the associated characteristic, and only if all of the specified characteristics and values are the same, then you can say: HMActionSet XYZ is being executed. Apparently, that's how the official Home App also does it. (Found on the Apple Developer Forum for HomeKit)