Control smart-home accessories and commission Matter devices using HomeKit and MatterSupport. Use when managing homes/rooms/accessories, creating action sets or triggers, reading accessory characteristics, onboarding Matter devices, or building a third-party smart-home ecosystem app.
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Control home automation accessories and commission Matter devices into an app ecosystem. HomeKit manages the home/room/accessory hierarchy, characteristics, and automation triggers; MatterSupport handles ecosystem device commissioning.
NSHomeKitUsageDescription to Info.plist._matter._tcp, _matterc._udp, _matterd._udp), and set the extension's principal class to MatterAddDeviceExtensionRequestHandler.HomeKit loads asynchronously. Maintain a single HMHomeManager instance and await the homeManagerDidUpdateHomes(_:) delegate callback before accessing homes or primaryHome.
HMHomeManager -> HMHome -> HMRoom -> HMAccessory -> HMService -> HMCharacteristicimport HomeKit
final class HomeStore: NSObject, HMHomeManagerDelegate {
let manager = HMHomeManager()
override init() {
super.init()
manager.delegate = self
}
func homeManagerDidUpdateHomes(_ manager: HMHomeManager) {
// Safe to read homes and accessories
let primary = manager.primaryHome
}
}Interact with accessory services (e.g. lights, thermostats) via HMCharacteristic:
func setLightPower(_ characteristic: HMCharacteristic, isOn: Bool) async throws {
guard characteristic.characteristicType == HMCharacteristicTypePowerState else { return }
try await characteristic.writeValue(isOn)
}
func readTemperature(_ characteristic: HMCharacteristic) async throws -> Double? {
try await characteristic.readValue()
return characteristic.value as? Double
}Group changes into scenes and automate execution:
// Create an action set (scene)
func createNightScene(home: HMHome, lightAction: HMCharacteristicWriteAction<Bool>) async throws {
let actionSet = try await home.addActionSet(withName: "Good Night")
try await actionSet.addAction(lightAction)
}
// Event-based automation
func addTrigger(home: HMHome, trigger: HMEventTrigger) async throws {
try await home.addTrigger(trigger)
try await trigger.enable(true)
}Use MatterSupport to onboard Matter devices into your ecosystem:
import MatterSupport
let topology = MatterAddDeviceRequest.Topology(ecosystemName: "MyHome", homes: [home])
let request = MatterAddDeviceRequest(topology: topology)
try await request.perform()The system invokes your MatterAddDeviceExtensionRequestHandler subclass in the extension target to complete pairing.
homes synchronously at launch: manager.homes is empty until homeManagerDidUpdateHomes fires._matter._tcp, _matterc._udp, and _matterd._udp in NSBonjourServices.characteristic.writeValue(_:) rather than mutating state locally.NSHomeKitUsageDescription present in target Info.plistHMHomeManager instantiated once and guarded until homeManagerDidUpdateHomes fireswriteValue(_:) with error handlingtrigger.enable(true) after creationthienqo/ios-skills
6bf8b62
Canonical home
since May 23, 2026
Also appears in
on Sep 6, 2026
since May 22, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.