HMHome PRO

HMHome represents a single HomeKit home and its full graph of rooms, accessories, scenes, zones, and users.


Read-only graph

PropertyTypeDescription
uuidstringStable HomeKit UUID.
namestringDisplay name.
isPrimarybooleanWhether this is the user's primary home (deprecated by Apple in iOS 16.1).
roomsHMRoom[]All rooms (including the default "entire-home" room).
accessoriesHMAccessory[]All accessories paired in this home.
actionSetsHMActionSet[]All scenes (user-defined + system: wakeUp / sleep / arrival / departure).
zonesHMZone[]Zones (user groupings of rooms).
serviceGroupsHMServiceGroup[]Service groups (read-only in v1).
currentUserHMUserThe current logged-in user.

Mutations

await home.rename("Cabin")

const room = await home.addRoom("Garage")
await home.removeRoom(room)

await home.addAndSetupAccessories()              // shows the system add-accessory UI
await home.removeAccessory(accessory)
await home.assignAccessoryToRoom(accessory, room)

const zone = await home.addZone("Upstairs")
await home.removeZone(zone)

await home.executeActionSet(scene)
const scene = await home.addUserActionSet("Movie Time")
await home.removeActionSet(scene)

builtinActionSets() returns the four system scenes:

const { wakeUp, sleep, homeArrival, homeDeparture } = home.builtinActionSets()
if (homeArrival) await home.executeActionSet(homeArrival)

Events

home.onAccessoriesChanged = list => { /* ... */ }
home.onRoomsChanged       = list => { /* ... */ }
home.onActionSetsChanged  = list => { /* ... */ }
home.onNameChanged        = name => { /* ... */ }