OH

omarshahine/homeclaw

Developer tools
199 stars 28 forks Quality 86 Trend 21MIT

Control your Apple HomeKit smart home from AI assistants, the terminal, and automation tools.

Overview

Control your Apple HomeKit smart home from AI assistants, the terminal, and automation tools.

README

HomeClaw

Control your Apple HomeKit smart home from AI assistants, the terminal, and automation tools.

HomeClaw exposes your HomeKit accessories through a command-line tool, a stdio MCP server, and plugins for Claude Code and OpenClaw. It runs as a lightweight macOS menu bar app.

Screenshots

Settings — every preference in one place

CLI — every accessory, one command away

Terminal UI — for power users

Why HomeClaw?

Apple HomeKit has no public API, no CLI, and no way to integrate with AI assistants or automation pipelines. HomeClaw bridges that gap with a Mac Catalyst app that talks to HomeKit on your behalf and exposes a clean API surface.

  • Ask Claude or OpenClaw to “turn off all the lights” or “set the thermostat to 72”
  • Script your smart home from the terminal
  • Build automations that go beyond what the Home app offers
  • Search and control devices by name, room, category, or semantic type

Architecture

Claude Code --> Plugin (.claude-plugin/) --> stdio MCP server (Node.js) --+
Claude Desktop --> stdio MCP server (Node.js) ----------------------------+
OpenClaw --> Plugin (openclaw/) --> homeclaw-cli --------------------------+
                                                                          v
                                               Unix socket (JSON newline-delimited)
                                                                          |
                                               HomeClaw (Mac Catalyst app)
                                                 +-- HomeKitManager (direct, in-process)
                                                 +-- SocketServer (for CLI/MCP clients)
                                                 +-- macOSBridge.bundle (NSStatusItem menu bar)

Single-process design. Apple’s HMHomeManager requires a UIKit/Catalyst app with the HomeKit entitlement. By making the entire app Catalyst, HomeKit access is direct (no IPC), signing is unified (single archive), and App Store submission is clean. The macOSBridge plugin bundle provides the native macOS menu bar via NSStatusItem.

Native MCP for Hermes

HomeClaw must be running before connecting. In Settings → Integrations, enable Streamable HTTP MCP. This persistent setting is off by default; turning it off stops the HTTP listener without disabling existing stdio or Unix-socket clients. When enabled, the Catalyst app owns a loopback-only Streamable HTTP endpoint:

http://127.0.0.1:9090/mcp

Loopback binding prevents remote network access; no bearer token or shell launch is required. Readiness is available at http://127.0.0.1:9090/healthz. In Hermes, add:

mcp_servers:
  homeclaw:
    url: http://127.0.0.1:9090/mcp
    timeout: 120
    connect_timeout: 30

The stdio MCP server remains supported for Claude Desktop, Claude Code, and OpenClaw. Use the existing npm run build:mcp and stdio setup when a client cannot use native HTTP.

Native transport development checks

swift test covers the CLI package only. To build and execute the full native Catalyst HomeClawTests suite on macOS 26 or later:

npm install
node scripts/check-mcp-schema-parity.mjs
xcodegen generate
bash scripts/test-catalyst.sh

Project generation writes HomeClaw.xcodeproj/project.xcproj through Apple’s JSON converter. Install Xcode 27.2 or later alongside the pinned 27.1 build toolchain; the finalizer selects the converter per process and leaves the build pin and global developer-tools selection unchanged.

The test script saves the xcodebuild log and .xcresult under .build/catalyst-test-evidence/ and fails on empty or skipped test results. For a repeat run, set CATALYST_EVIDENCE_DIR to a fresh directory. Unit-test hosting suppresses live HomeKit, socket, and menu-bar startup; these tests are not proof of HomeKit provisioning or real accessory access.

lib/schemas.js is the canonical tool schema. The Swift descriptors are readable JSON and CI compares every descriptor against the Node export and the XCTest fixture. After an intentional schema edit, regenerate both reviewed copies with node scripts/check-mcp-schema-parity.mjs --write, then inspect their diff. The HTTP read-only allowlist remains separate and deny-by-default; adding a tool to the canonical schema does not expose it over HTTP.

Install

Marketing site with screenshots and full pitch: homeclaw.omarknows.app.

HomeClaw is live on the Mac App Store:

  1. Open in the Mac App Store and install
  2. Launch HomeClaw – grant HomeKit access when prompted
  3. The menu bar icon appears. Click it to see your connected homes.

App Store builds are fully signed and notarized, so HomeKit works without any developer account setup.

TestFlight Beta

Want early access to in-flight builds before they ship to the App Store?

  1. Join the TestFlight Beta
  2. Install HomeClaw from TestFlight
  3. Launch the app – grant HomeKit access when prompted

TestFlight builds are signed the same way as App Store builds, so HomeKit works out of the box. You’ll get new features (like the automations work in v1.0.1) before they hit the App Store.

After installing

Set up your AI integrations:

  • Claude Desktop – one-click install from Settings > Integrations, or add the MCP server config manually
  • Claude Code – install the plugin from GitHub
  • OpenClaw – one-click install from Settings > Integrations, or set up manually

Need a clean local configuration or want to remove the app? See reset or uninstall.

Build from Source

MCP Tools

The stdio MCP server wraps homeclaw-cli and exposes these tools:

Tool Description
homekit_status Check bridge connectivity and accessory count
homekit_accessories List, get details, search, or control accessories
homekit_rooms List rooms and their accessories
homekit_scenes List, get details, trigger, import, or delete scenes
homekit_device_map LLM-optimized device map with semantic types and aliases
homekit_manage Manage home structure: rename accessories, individual services, and rooms; set a switch/outlet’s Display As; list and manage accessory groups; create/remove rooms and zones, manage zone membership
homekit_automations Manage automations: list, create (button, sensor or time-of-day triggers with conditions, weekdays and auto-revert), edit in place, add conditions, link to scenes, enable/disable, plan accessory replacement
homekit_events Query recent HomeKit events (characteristic changes, reachability changes, scene triggers, control actions)
homekit_webhook Manage webhook configuration: setup (configure + auto-test), test, reset circuit breaker, status
homekit_config View or update configuration (set active home, filtering)

Connecting an MCP Client

Any MCP-compatible client can connect via the stdio server, which wraps homeclaw-cli and requires no authentication (the HomeClaw app must be running for the socket). Add this to your MCP client config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "homeclaw": {
      "command": "node",
      "args": ["/Applications/HomeClaw.app/Contents/Resources/mcp-server.js"]
    }
  }
}

The mcp-server.js is bundled inside the app. You can also use the Integrations tab in Settings to install this automatically.

CLI

The homeclaw-cli command-line tool communicates directly over the Unix domain socket. All read commands support --json for machine-readable output. Day-to-day commands also accept --home to target a specific HomeKit home without changing the configured default (config --default-home).

# List accessories
homeclaw-cli list
homeclaw-cli list --room "Kitchen"
homeclaw-cli list --category thermostat
homeclaw-cli list --home "Cabin" --room "Kitchen"   # Scope to a home (name or UUID)

# Control devices
homeclaw-cli set "Living Room Light" brightness 75
homeclaw-cli set "Front Door Lock" lock_target_state locked
homeclaw-cli set "Thermostat" target_temperature 72
homeclaw-cli set "Kitchen Light" power true --home "Cabin"

# Disambiguate when a characteristic exists on multiple services (e.g. bridged TVs)
homeclaw-cli set "TV" active 0 --service-type 000000D8-0000-1000-8000-0026BB765291

# Get detailed device info
homeclaw-cli get "Kitchen Light" --json
homeclaw-cli get "Kitchen Light" --home "Cabin"

# Search (optionally scoped to one home)
homeclaw-cli search "bedroom" --category lightbulb
homeclaw-cli search "lamp" --home "Cabin"

# Scenes
homeclaw-cli scenes
homeclaw-cli scenes --home "Cabin"
homeclaw-cli get-scene "Good Night" --json        # Full detail: all actions
homeclaw-cli trigger "Good Night"
homeclaw-cli trigger "Good Night" --home "Cabin"

# Scene management
homeclaw-cli delete-scene "Old Scene"
homeclaw-cli import-scene scene.json --dry-run   # Preview before creating
homeclaw-cli import-scene scene.json              # Create scene from JSON
homeclaw-cli assign-rooms rooms.json --dry-run    # Preview room assignments
homeclaw-cli assign-rooms rooms.json              # Bulk-assign accessories to rooms

# Home management
homeclaw-cli rename "Front Door" "Front Door Lock"          # Rename accessory
homeclaw-cli rename "Dual Relay" "Downlight 2" --service-name "Switch 2"  # Rename one gang's tile
homeclaw-cli set-display-as "Dual Relay" light --service-index 1         # Display As: light / fan / switch / outlet / default
homeclaw-cli groups                                          # Home app accessory groups and members
homeclaw-cli groups create "Ceiling Lights" "Downlight 1"   # One tile for several lights (same kind)
homeclaw-cli groups add "Ceiling Lights" "Stairs LED"       # Also: remove / rename / delete, --dry-run
homeclaw-cli rename-room "Bedroom" "Primary Bedroom"        # Rename room
homeclaw-cli create-room "Nursery"                          # Create room
homeclaw-cli remove-room "Old Room"                         # Remove room
homeclaw-cli remove-accessory "Broken Sensor"               # Remove accessory
homeclaw-cli create-zone "Upstairs"                         # Create zone
homeclaw-cli remove-zone "Old Zone"                         # Remove zone
homeclaw-cli add-room-to-zone "Bedroom" "Upstairs"          # Add room to zone
homeclaw-cli remove-room-from-zone "Bedroom" "Upstairs"     # Remove room from zone
homeclaw-cli rename "Front Door" "New Name" --dry-run       # Preview any mutation

# Automations (button programming)
homeclaw-cli automations                                     # List all automations
homeclaw-cli automations get ""                # Detail view

# Scene-based: trigger an existing scene
homeclaw-cli automations create --name "Gym Lights" \
  --accessory "Gym Button" --scene "Gym On" --press single

# Inline actions: use UUIDs for target accessories to avoid name collisions
homeclaw-cli automations create --name "Sarah's Room Open" \
  --accessory "Office Button" \
  --action "BE21C139-413A-50F9-B97F-B9BDA06302A8:power:true" \
  --action "52195C6F-6FAA-5E52-AA56-840A6605EEAA:target_position:100" \
  --press single --service-index 1

# Multi-button preview
homeclaw-cli automations create --name "Open Blinds" \
  --accessory "Blinds Button" --scene "Open" \
  --service-index 1 --dry-run

# One gang of a multi-gang accessory: JSON row form (see "Targeting one gang" below)
homeclaw-cli automations create --name "Table Light Off" \
  --accessory "Dining Button" --press single \
  --action-json '{"accessory":"","property":"power","value":"false","service_index":2}'

homeclaw-cli automations delete ""             # Delete automation
homeclaw-cli automations enable ""             # Enable
homeclaw-cli automations disable ""            # Disable

# Edit in place (keeps the UUID; only the options passed change)
homeclaw-cli automations edit "Coffee Maker" --time 06:45 --days mon,tue,wed,thu,fri,sat
homeclaw-cli automations edit "Hall Motion" --time-after sunset --time-before sunrise --duration 300
homeclaw-cli automations edit "Porch Lights" --condition "Front Door:contact_state:0" --dry-run
homeclaw-cli automations edit "Porch Lights" --name "Porch at Dusk" --clear-duration

# Replacing an accessory: plan which automation actions move (writes nothing)
homeclaw-cli automations migrate-actions --replace-accessory "=[,]"
homeclaw-cli automations migrate-actions --replace-accessory "=" --automation "" --json
homeclaw-cli automations migrate-actions --replace-accessory "=" --apply  # Writes visible scenes only

# LLM-optimized device map
homeclaw-cli device-map
homeclaw-cli device-map --home "Cabin"

# Status and configuration
homeclaw-cli status
homeclaw-cli config --default-home "Main House"
homeclaw-cli config --filter-mode allowlist
homeclaw-cli config --list-devices

# Event log
homeclaw-cli events                         # Recent events (last 50)
homeclaw-cli events --since 1h              # Events from the last hour
homeclaw-cli events --since 2d --json       # Last 2 days, JSON output
homeclaw-cli events --type scene_triggered  # Filter by event type
homeclaw-cli events --type reachability_change --since 1d  # When accessories dropped off or came back

# Webhook configuration
homeclaw-cli config --webhook-url "http://127.0.0.1:18789"
homeclaw-cli config --webhook-token "your-secret-token"
homeclaw-cli config --webhook-enabled true
homeclaw-cli config --webhook-test           # Send test event, show HTTP response
homeclaw-cli config --webhook-reset          # Reset circuit breaker without toggling

# Webhook triggers
homeclaw-cli triggers                        # List all triggers
homeclaw-cli triggers add --label "Front Door" --accessory-id ""
homeclaw-cli triggers add --label "Mailbox Open" --accessory-id "" --characteristic contact_state
homeclaw-cli triggers add --label "Accessory offline" --characteristic reachable --value false
homeclaw-cli triggers update "" --wake-mode now
homeclaw-cli triggers remove ""

# Dry-run mutations (validate without actuating)
homeclaw-cli set "Front Door" lock_target_state locked --dry-run
homeclaw-cli delete-scene "Movie Night" --dry-run

# Auto-JSON: all commands output JSON when piped or when env var is set
homeclaw-cli status | jq .                   # Auto-detects non-TTY
OUTPUT_FORMAT=json homeclaw-cli list          # Force JSON via env var

Button Programming Notes

Inline vs scene: Use --action for simple button-to-device mappings. This creates a scene named after the automation. Use --scene to trigger an existing scene instead. Note: Apple’s Home app uses a private API for hidden automation-only action sets; inline actions created via HomeClaw will appear as visible scenes in the Home app.

Doorbells exposing input_event on a HomeKit Doorbell service also support button automations (for example, --accessory "Front Doorbell" --press single). A lone doorbell needs no --service-index. When selecting among multiple button services, the index must match an actual ServiceLabelIndex; it is never an array position or an assumed doorbell index. Ambiguous matches are rejected.

Button modes: Some buttons (like Aqara AR009) support fast mode (2 buttons, single press each, instant response) or multi-event mode (1 button, single/double/long press, ~300ms delay). Use --service-index to target a specific button in fast mode.

Note that --service-index on automations create picks the trigger button. The service an inline action or condition writes to is picked per row, as below.

Targeting one gang of a multi-gang accessory

A dual relay or a 3-gang switch is one accessory with several services that all carry power. Any action or condition row can pick one of them with service_name, service_id, or service_index (the same selectors set takes). The positional accessory:property:value form has no room for a fourth field (it splits on the first two colons so values like 22:30 survive), so use the JSON row flags instead:

# Turn off both gangs of one dual relay
homeclaw-cli automations create --name "Dining Unoccupied" \
  --accessory "Dining FP2" --characteristic occupancy_detected --trigger-value false \
  --action-json '{"accessory":"ADA239D3-...","property":"power","value":"false","service_index":1}' \
  --action-json '{"accessory":"ADA239D3-...","property":"power","value":"false","service_name":"Table Light"}' \
  --dry-run

# Conditions take the same keys (--condition-json on create / create-time, flags on add-condition)
homeclaw-cli automations add-condition "Porch Lights" \
  --accessory "ADA239D3-..." --property power --value true --service-index 2

--action-json / --condition-json are repeatable, accept accessory, property (or characteristic), value, room, and the three selectors, and reject unknown keys. Rules for every surface (CLI, MCP, scene JSON):

  • With a selector, the row resolves to exactly that service, or fails with an error listing the services that carry the property. It never falls back to another gang.
  • Without a selector on a property that exists on several services, HomeClaw keeps the old behavior (the first service) so existing scene JSON keeps working, but the response carries a warnings entry naming every candidate. Add a selector to silence it.
  • Two actions on the same accessory and property are allowed when they target different services. The same service twice is rejected.
  • get-scene, automations get, and dry-run previews emit service_name, service_id, and service_index on rows whose accessory has more than one service carrying that property, so their JSON round-trips through import-scene / update-scene without collapsing gangs. Rows on single-service accessories are unchanged.

Confirming a Control Write

For readable characteristics, HomeClaw normally requires a fresh read of the targeted service to confirm a write. Bridged accessories get up to five seconds of readback polling. Control does not wait on unrelated accessory reads and issues the write only once. The generic state map is last-known; use the verified value and service selector for the targeted characteristic, or run a fresh get for the rest of the accessory. The readback budget begins after the HomeKit write callback; it is not a whole-request timeout.

  • verified: true: a fresh read matched the requested value.
  • write_failed: HomeKit reported an error on the write itself.
  • write_unconfirmed: HomeKit accepted the write, but no fresh read confirmed the requested value within the verification window. The device may still apply it. Check the current state with a fresh read before writing again.

Unconfirmed and failed writes are both errors, not successful control responses. set --json prints the error code as JSON and exits nonzero; MCP preserves the error result and exposes the code. Write-only controls and explicit --no-verify (MCP verify: false) still report why verification was skipped rather than claiming the device changed.

Discovering Multi-Channel Accessories

JSON results from list, search, rooms and device-map include a compact services array when an accessory has multiple known controllable services. Each channel includes its id, name and category, plus index and display_as when available. A service must expose a supported writable control characteristic; Identify-only, read-only and supplementary services do not count.

Search also matches these service names, even when a channel name refers to a different room. Category filtering accepts the accessory category, service category or the service’s Display As category (light maps to lightbulb). Device-map aliases include the service names. The accessory’s own name and category stay unchanged, and Selected Only still filters whole accessories.

homeclaw-cli search "厨房灯" --category lightbulb --json
# Use the result's accessory id and the desired services[].id to target a gang:
homeclaw-cli set "ACCESSORY-UUID" power false --service-id "SERVICE-UUID" --dry-run

Channel state is explicitly marked state_source: "last_known". It comes from that service’s existing characteristic values, never the collapsed accessory-wide cache, and performs no live reads. Missing values are omitted. It can be stale; use a normal refreshed get for fresh per-characteristic read results. Live get (CLI and MCP) requires at least one supported readable characteristic and a successful read of every such characteristic. This includes mapped types and standard HomeKit UUIDs, even if HomeClaw doesn’t have a name for them. Unmapped vendor UUIDs (for example, a bridge’s firmware-update service) are not live-read: their rows and existing values remain, labeled value_source: "last_known", with no read timestamp. The optional read_skipped_unmapped count reports those readable rows separately from read_attempted and read_succeeded. Use --no-refresh (MCP no_refresh: true) for static and last-known values only, including on vendor-only devices. Write verification timing is unchanged. Single-channel accessory summaries retain their existing compact shape.

Numeric and Ordered Conditions

A condition row has always meant “this characteristic equals this value”. The HomeKit trigger predicate factory takes .equalTo, .notEqualTo, .lessThan, .lessThanOrEqualTo, .greaterThan and .greaterThanOrEqualTo, but HomeClaw only ever wrote equality, so a threshold condition like “only when the room is darker than 30 lux” could not be expressed. It can now. Ordered comparisons are limited to numeric characteristics: an on/off, string or unknown-format characteristic only accepts == and !=, and the write is refused with an explanation rather than producing a gate that can never match.

Operator Mnemonics Meaning
== eq equal (the default, and what every existing row produces)
!= ne not equal
< lt less than
<= lte, le less than or equal
> gt greater than
>= gte, ge greater than or equal

Three interchangeable spellings, all normalized to the symbol:

# 1. Symbolic prefix on the positional row
homeclaw-cli automations create --name "Guest Bath Motion Lights" \
  --accessory "Presence Sensor FP2-1" --characteristic occupancy_detected \
  --trigger-value true \
  --action-json '{"accessory":"Guest Bath Vanity","property":"power","value":"true"}' \
  --condition "Lux Sensor:current_light_level:<30"

# 2. Explicit operator in a JSON row
--condition-json '{"accessory":"Lux Sensor","property":"current_light_level","value":"30","operator":"lt"}'

# 3. Flag on add-condition
homeclaw-cli automations add-condition "Guest Bath Motion Lights" \
  --accessory "Lux Sensor" --property current_light_level --value 30 --operator lt

Over MCP, conditions[].operator (or condition.operator on add_condition) carries the same values — symbols or mnemonics, since the published schema lists both. Details worth knowing:

  • Omitted operator means ==. Every automation written before this existed behaves identically; nothing needs rewriting.
  • The prefix form is longest-match, so <30 and <=30 never collapse into each other. A bare operator with no value (:current_light_level:<) is rejected rather than passed through as a literal.
  • An unknown operator is an error, not a fallback. --operator ltt fails loudly, and so does the same typo inside --condition-json, before anything reaches the app. Silently treating a typo as equality would ship a rule that fires when you asked for a gate, which is the whole failure mode this feature exists to prevent.
  • Naming an operator and leaving a prefix is an error. --operator == with --value "<30" is contradictory, not something to guess at: it fails with a message asking for the bare value.
  • Readback reports the operator. automations get emits "operator": "<" for a decoded condition, so a get → edit → write cycle preserves the comparison. Conditions you did not touch are never rewritten.
  • Multiple conditions AND together. occupancy_detected == 1 plus current_light_level < 30 fires only when both hold — one condition alone cannot express “occupied and dark”.
  • Ordered comparisons need a numeric operand. power < 1 would resolve 1 to a boolean and produce a predicate HomeKit accepts but never satisfies, so the write is refused with an explanation. On/off characteristics only support == and !=; point a threshold at a numeric characteristic such as current_light_level.

Editing an Automation in Place

automations edit changes an existing automation without deleting it, so its UUID stays the same and button bindings, Siri references and integrations keep working. Only the options you pass change:

Option Effect Clear with
--name Rename (the only edit Home app timer automations accept)
--time Replace the trigger event(s) with a time of day (same values as create-time)
--days Replace the weekday gate --every-day
--condition / --condition-json Replace all characteristic conditions --clear-conditions
--time-after / --time-before Replace the whole time window --clear-time-window
--duration Set the auto-revert --clear-duration

Conditions of a kind you don’t replace are kept as they are, including ones HomeClaw can’t decode, so changing the time window never drops a condition the Home app wrote. A time-based result without a weekday gate gets all 7 days filled in, as on create-time.

Everything is validated before the first write. --dry-run shows before, planned and changes. A real run writes the predicate, weekdays, events, end events and name in that order; if a step fails, the steps already written are restored and the error says which. Afterwards the automation is re-read and compared with the plan: "verified": false lists the mismatches. Over MCP this is homekit_automations with action: "edit" (new_name, time, weekdays, conditions, time_after, time_before, duration_seconds, clear_duration; an empty array clears).

Appending a Characteristic Trigger Event

automations append-event previews adding one event to an existing event automation. The new event is an OR alternative, evaluated against the same existing predicate. It does not replace the sensor being watched. Use retarget-event to replace one existing trigger instead. Use automations get (MCP action: "get") to inspect the existing events, conditions and linked actions before applying. Use it again to inspect the observed state if HomeClaw reports an unverified result.

# Preview. Use names that resolve uniquely, or UUIDs.
homeclaw-cli automations append-event "Hall Lights" \
  --accessory "Presence Sensor" --characteristic occupancy_detected --trigger-value true

# Apply the exact previewed target/value while the automation is unchanged.
homeclaw-cli automations append-event "Hall Lights" \
  --accessory "Presence Sensor" --characteristic occupancy_detected --trigger-value true \
  --apply --fingerprint FINGERPRINT_FROM_PREVIEW

The command always prints JSON. Over stdio MCP, use homekit_automations with action: "append_event", id, accessory_id, characteristic, trigger_value, and optional home_id, service_name, service_id or service_index. Preview is the default; apply: true also requires the returned fingerprint. The native read-only HTTP transport does not expose automation mutations.

The trigger characteristic must support notifications and have boolean or numeric metadata (bool, uint8, uint16, uint32, int or float). The value is required, finite, and checked against its format, bounds and enumerated values. Floating-point values normalize to HAP Float32, with the normalized value shown in the preview; overflow and nonzero values that underflow to zero are rejected. Missing/null values never mean “any change.” Ambiguous homes/accessories/services, duplicate characteristic/value events, and an existing any-change event for that characteristic are rejected. Under Selected Only, the new sensor and every linked scene action must be selected and resolved; unavailable selection fails closed. Unknown event or action payloads that cannot be fingerprinted are refused.

Apply calls Apple’s event-array update API once with the original event objects in order plus the new event. It preserves the trigger UUID, predicate object (including opaque predicates), scene links and actions, enabled state, recurrences, end events and execute-once setting. A fingerprint binds the proposal and the current event/guard/action snapshot, including device selection. It is valid only in the current app session; restart or a changed snapshot requires a new preview.

HomeKit provides no compare-and-swap revision for this operation. Another client can race the final check and write. Afterwards HomeClaw re-enumerates the trigger from the current HomeKit home graph. status: "verified" means that public-API readback matches the planned event types, targets, values and counts, plus the preserved guards, not independent iCloud confirmation. HomeKit can regenerate event IDs and reorder these OR alternatives. HomeClaw retains original objects in the request, not their persisted IDs or array positions. The pre-write fingerprint still checks the exact snapshot. Callback failure returns failed; a missing callback after 15 seconds or missing/mismatched readback returns unverified. A late callback is ignored and the write may still apply later. Neither retries nor restores an old array over another client’s changes. Inspect the rule before retrying either outcome. The CLI exits nonzero for failed/unverified outcomes.

In a live disabled, actionless fixture, HomeKit persisted both events and changed their IDs and order. Independent sync and live behavior with linked scenes or opaque predicates are not yet qualified. Demo-app event editing is unavailable.

Retargeting a Characteristic Trigger Event

Use automations get with --json to identify the current id in the appropriate events row. Use the event UUID, not the automation UUID or row position. For example, replace a door motion event with a presence sensor without re-creating the automation or changing its other OR alternatives:

homeclaw-cli automations get "Hall Lights" --json

# Preview: nothing is written. The result shows replaced_event, event and fingerprint.
homeclaw-cli automations retarget-event "Hall Lights" --event-id CURRENT_EVENT_UUID \
  --accessory "Presence Sensor" --characteristic occupancy_detected --trigger-value true

# Apply only the exact previewed replacement.
homeclaw-cli automations retarget-event "Hall Lights" --event-id CURRENT_EVENT_UUID \
  --accessory "Presence Sensor" --characteristic occupancy_detected --trigger-value true \
  --apply --fingerprint FINGERPRINT_FROM_PREVIEW

Over stdio MCP, use homekit_automations with action: "retarget_event", the same fields as append and a required event_id. The source must be an existing explicit boolean/numeric characteristic event. Any-change sources, duplicate or ambiguous events, and a replacement identical to the source are refused. If the old sensor is used by other trigger events, they remain; condition references and linked scenes are not retargeted. In Selected Only, both sensors and all linked action accessories must be selected.

Apply replaces only the selected event in the submitted array and calls updateEvents once. Preview consent is bound to the operation, source UUID, replacement and current snapshot; an append fingerprint cannot authorize retarget. The same readback, race and no-retry limitations as append apply. Because HomeKit may reassign event UUIDs after either edit, run automations get again before selecting any event for another edit.

Replacing an Accessory in Automations

You swapped a bulb, a switch, or a shade. Now every automation that used the old one needs the new one. automations migrate-actions plans that move and tells you, per action set, what it can and can’t do.

Each action set an automation runs is one of two kinds:

Kind What it is Can HomeClaw edit it?
visible_scene A scene in the Home app’s Scenes list that an automation points at Yes, in place (the scene keeps its UUID). But it’s shared: editing it changes every other automation that uses it, and the scene tile itself. The plan lists those in shared_with.
hidden The action set the Home app creates inside one automation (most button and sensor automations made in the Home app) No. Apple’s HomeKit daemon only lets apps with Apple’s private com.apple.homekit.private-spi-access entitlement write these. No third-party app can get it. See docs/PRIVATE_API.md.

So hidden sets always come back "status": "unsupported" with "reason": "hidden_action_set_requires_private_spi", the exact accessories and values to change, and manual_steps you (or your assistant) can follow in the Home app: open the automation, remove the old accessory, add the new one, set each value, tap Done. Rerun the dry run afterwards and the automation drops out of the plan.

For each old action, the plan finds the same characteristic type (power, brightness, color temperature, hue, saturation, position, and anything else) on each replacement. A visible set is blocked instead of supported when no replacement can take a characteristic (it would be dropped), when a replacement has several services carrying it (the issue lists each candidate’s service_name, service_id and service_index; migrate-actions doesn’t take selectors itself, so edit that scene with update-scene rows that carry one), or when the new action would conflict with one already in the scene.

It’s a dry run unless you pass --apply. With --apply, only supported visible scenes are written: the rollback snapshot (every current action) is logged and returned first, the new actions are added, the old ones removed, and the scene is re-read and checked to contain exactly the planned actions. Triggers, conditions, enabled state and recurrence are never touched. A failed or unverified write exits non-zero and reports what was written.

Automations that are only triggered by the old accessory (a motion sensor that turns on a light) are listed too, with "trigger_only": true and no action sets: there’s nothing to move, but that trigger stops firing once the old accessory is gone, and this command never rewrites triggers. Recreate those in the Home app.

Migrate before you remove the old accessory from HomeKit. HomeKit usually drops a removed accessory’s scene actions, and then there’s nothing left to move. An old accessory that’s already gone can still be named by UUID.

Interactive TUI

homeclaw-cli ui

Launches a full-screen, keyboard-driven view of your home. Browse rooms and accessories, see live state at a glance, and toggle anything that has a binary state (lights, switches, fans, outlets, locks, blinds).

🦞 HomeClaw                                    21 rooms · 112 accessories

┌──────────────────────────────────────────────────────────────────────┐
│ ▾ Living Room (4)                                                     │
│   ├─ ● Floor Lamp                       On                            │
│   ├─ ● TV Light Strip                   On                            │
│   ├─ ◐ Thermostat                       70.5°F                        │
│   └─ ○ Window Blinds                    100%                          │
│                                                                       │
│ ▾ Kitchen (3)                                                         │
│   ├─ ○ Counter Light                    Off                           │
│   ...                                                                 │
└──────────────────────────────────────────────────────────────────────┘
^D quit  ↑↓ navigate  Enter toggle
Key Action
↑ ↓ Navigate between accessories
Enter Toggle the focused accessory (lights/switches/outlets/fans flip on↔off, locks flip locked↔unlocked, blinds flip 0%↔100%)
Ctrl-D Quit

State color coding: lights on are yellow, outlets/switches cyan, fans blue, locks green when locked / red when unlocked, motion red, sensors cyan, off/idle dim.

The TUI works over SSH (no AppKit assumptions), runs against the same Unix socket as the rest of the CLI, and respects demo mode — launch HomeClaw with --ui-test-demo to render a synthetic home for screenshots or demos. Built on SwiftTUI. Scene picker, search, and help overlay are tracked in #53 — they need a different framework’s key handling and will land when SwiftTUI gains app-level key bindings (or we switch).

Using with Claude Code

HomeClaw integrates with Claude Code as a plugin that provides MCP tools and a HomeKit skill for richer natural language understanding.

Installing the Plugin

Install from a local clone or directly from GitHub.

From a local clone:

# Clone if you haven't already
git clone https://github.com/omarshahine/HomeClaw.git ~/GitHub/HomeClaw

# Inside Claude Code, register the marketplace and install
/plugin marketplace add ~/GitHub/HomeClaw
/plugin install homeclaw@homeclaw

From GitHub (no local clone needed):

# Inside Claude Code, add the GitHub repo as a marketplace
/plugin marketplace add https://github.com/omarshahine/HomeClaw

# Install the plugin
/plugin install homeclaw@homeclaw

After installing, restart Claude Code. Then just ask:

“Turn on the kitchen lights and set them to 50% brightness” “Lock all the doors” “What’s the thermostat set to?” “Run the movie time scene” “Which lights are on in the living room?”

Verifying the Connection

After installing, verify Claude can reach HomeKit:

# Check MCP server status inside Claude Code
/mcp

Using with OpenClaw

HomeClaw includes an OpenClaw plugin that registers a HomeKit skill on the gateway. The skill calls homeclaw-cli by name, so it must be in your PATH.

If HomeClaw and OpenClaw run on the same Mac, use the one-click installer:

  1. Open Settings > Integrations and click Install in the OpenClaw section.

This handles all four steps automatically: installs the plugin, enables it, symlinks homeclaw-cli into your PATH, and restarts the gateway.

Or from the terminal:

# 1. Install the plugin from the bundled files
openclaw plugins install "/Applications/HomeClaw.app/Contents/Resources/openclaw/"
openclaw plugins enable homeclaw

# 2. Symlink the CLI into PATH (the skill calls homeclaw-cli by name)
# Apple Silicon (M1/M2/M3/M4):
ln -sf '/Applications/HomeClaw.app/Contents/MacOS/homeclaw-cli' /opt/homebrew/bin/homeclaw-cli
# Intel:
ln -sf '/Applications/HomeClaw.app/Contents/MacOS/homeclaw-cli' /usr/local/bin/homeclaw-cli

# 3. Restart the gateway to load the plugin
openclaw gateway restart

Remote Gateway

If OpenClaw runs on a different machine:

# Clone the repo on the gateway
git clone https://github.com/omarshahine/HomeClaw.git ~/GitHub/HomeClaw

# Install the plugin
openclaw plugins install ~/GitHub/HomeClaw/openclaw
openclaw plugins enable homeclaw

# Symlink the CLI into PATH
ln -sf /path/to/homeclaw-cli /opt/homebrew/bin/homeclaw-cli

# Restart the gateway
openclaw gateway restart

Note: The homeclaw-cli binary must be accessible from the gateway (in PATH), and the HomeClaw app must be running on the same Mac (connected via Unix socket).

Enabling Control Tools

The plugin registers 20 agent tools. The read-only ones (homekit_status, homekit_device_map, homekit_list, homekit_get, homekit_search, homekit_scenes, homekit_get_scene, homekit_events, homekit_groups, homekit_automations_list, homekit_automations_get) are on by default, including under the coding and messaging tool profiles.

The nine tools that can change your home (homekit_set, homekit_trigger, homekit_import_scene, homekit_delete_scene, homekit_rename, homekit_set_display_as, homekit_manage_group, homekit_automations_create, homekit_automations_migrate_actions) are optional: OpenClaw hides them until you opt in. To allow all HomeClaw tools, add the plugin id to tools.alsoAllow in your OpenClaw config:

{
  "tools": {
    "alsoAllow": ["homeclaw"]
  }
}

List individual tool names instead of homeclaw to enable only some of them, then restart the gateway.

Supported Accessories

HomeClaw supports the full range of HomeKit accessory categories:

Category Controllable Characteristics
Lights power, brightness (0-100), hue (0-360), saturation (0-100), color temperature (140-500 mireds)
Thermostats target temperature, HVAC mode (off/heat/cool/auto), target humidity
Locks lock/unlock (accepts locked, unlocked, 0, 1)
Doors & Garage Doors open/close, obstruction detection (read-only)
Fans active, rotation speed, rotation direction, swing mode
Window Coverings target position (0-100%)
Switches & Outlets power on/off
Sensors motion, contact, temperature, humidity, light level, battery (all read-only)
Doorbells ring detection via input_event (single/double/long press), motion (read-only)
Programmable Switches button press detection (single/double/long press) (read-only)
Scenes trigger by name or UUID, inspect actions, import from JSON, delete by name or UUID

Scene Import Format

The import-scene command accepts a JSON file defining a scene and its actions:

{
  "name": "Movie Night",
  "actions": [
    {"accessory": "Living Room Light", "room": "Living Room", "property": "brightness", "value": "30%"},
    {"accessory": "TV Backlight", "room": "Living Room", "property": "power_state", "value": "ON"},
    {"accessory": "Overhead", "room": "Living Room", "property": "power_state", "value": "OFF"}
  ]
}

Action objects also accept characteristic as an alias for property (read commands emit characteristic, so their output round-trips as input).

To target one gang of a multi-gang accessory, add service_name, service_id, or service_index to the action (service_index may be a JSON number or a string). get-scene --json emits these on exactly the rows that need them, so its output can be edited and fed back to update-scene:

{
  "id": "D47A94C9-BCCA-553A-AA3C-E756E91D22FE",
  "actions": [
    {"accessory_id": "ADA239D3-...", "property": "power", "value": "0", "service_name": "Covelight", "service_index": "1"},
    {"accessory_id": "ADA239D3-...", "property": "power", "value": "0", "service_name": "Table Light", "service_index": "2"}
  ]
}

See Targeting one gang of a multi-gang accessory for the resolution and warning rules.

The assign-rooms command accepts a JSON file mapping accessories to rooms. Use uuid for precise matching when multiple accessories share the same name (e.g., fan + light from a ceiling fan). A name that matches several accessories is skipped with status ambiguous rather than guessed. Every other command that takes an accessory name (including scene import/update actions and automation conditions) fails on a duplicate before changing anything, and lists each match’s room and UUID:

[
  {"accessory": "Kitchen Light", "room": "Kitchen"},
  {"uuid": "790A359D-27A6-5738-A92E-F4380CC6BA07", "room": "Front Door"},
  {"accessory": "Desk Lamp", "room": "Office"}
]

The same array wrapped as {"assignments": [...]} is also accepted.

All file-taking commands (import-scene, update-scene, assign-rooms) accept - in place of the file path to read JSON from stdin — the recommended path for the sandboxed App Store build, which can only read files from its own container:

echo '[{"accessory": "Desk Lamp", "room": "Office"}]' | homeclaw-cli assign-rooms -

Both commands support --dry-run to preview changes without modifying HomeKit.

The menu bar provides at-a-glance status and quick actions:

  • HomeKit connection status – shows home names when connected, or error states with reasons
  • Launch at Login toggle
  • Settings link and Quit

Settings

Five configuration tabs accessible from the menu bar:

Tab Features
HomeKit Connection status, home list with accessory and room counts, active home selector
Devices Filter mode (all/allowlist), per-device toggles with category icons and state badges, grouped by room, search, bulk select/deselect
Event Log Enable/disable event logging, configure file rotation (size limit + backup count), view storage stats, purge logs, reveal in Finder
Webhook Configure webhook base URL + bearer token, select which scenes and accessories trigger webhooks with category icons and state badges. Accessories with multiple characteristics (e.g., a sensor with both contact and motion) show individual toggles per characteristic; battery characteristics are excluded. Per-trigger delivery mode (Batched/Immediate). Circuit breaker banners with Reset button, delivery stats, and last HTTP status. Test webhook connectivity from CLI or manage triggers via homeclaw-cli triggers.
Integrations One-click install for Claude Desktop, Claude Code plugin detection, OpenClaw gateway setup

HomeKit

View connection status, browse your homes, and select which home is active for all MCP and CLI commands.

Devices

Control which accessories are exposed to MCP clients and the CLI. Switch between All Accessories (everything visible) and Selected Only (allowlist mode). Accessories are grouped by room with a search filter and room-level toggles for quick bulk selection.

Menu scenes remain visible when their room has no displayed accessories. In Selected Only, a scene can run from the menu only when every action resolves to a selected accessory; excluded or unresolved actions and unavailable selections produce a disabled entry with an explanation. CLI/MCP scene execution continues to run the complete action set.

Integrations

Install and manage connections to AI assistants. The app detects existing configurations and guides you through setup:

  • Claude Desktop – one-click install of the bundled stdio MCP server (requires Node.js)
  • Claude Code – detects the installed plugin (homeclaw@homeclaw)
  • OpenClaw – detects plugin configuration on the remote gateway and provides setup instructions

Event Log

HomeClaw records all HomeKit events to a JSONL file in ~/Library/Application Support/HomeClaw/events.jsonl. Events include characteristic changes (a light turned on), reachability changes (an accessory became unreachable or came back), scene triggers, and control actions from the CLI or MCP.

Configuration

Open Settings > Event Log to configure:

  • Enable/disable event logging
  • Max file size (10-500 MB) – when the log reaches this size, it’s rotated
  • Rotated backups (0-10) – how many old log files to keep before deleting the oldest
  • Purge – delete all event log files
  • Show in Finder – reveal the log directory

Or configure via CLI:

homeclaw-cli events                         # Show recent events
homeclaw-cli events --since 1h              # Last hour
homeclaw-cli events --type characteristic_change  # Filter by type
homeclaw-cli events --limit 200 --json      # JSON output

Event types: characteristic_change, scene_triggered, accessory_controlled, homes_updated, reachability_change

A reachability_change event is logged when HomeKit reports that an accessory became reachable or unreachable. Repeated reports with no change are dropped.

{
  "type": "reachability_change",
  "timestamp": "2026-09-28T04:20:09Z",
  "accessory": { "id": "…", "name": "B1", "room": "Kids", "matter_node_id": "000000000000002A" },
  "reachable": false,
  "home": { "id": "…", "name": "Home" }
}

accessory.matter_node_id appears only for Matter accessories, and home only when the accessory’s home is known.

Matter node ids

list, search, get and device-map include matter_node_id for Matter accessories. It is the node id Apple Home assigned on its Matter fabric, written as 16 uppercase hex digits (a string, so the 64-bit value is not rounded by JSON parsers). Non-Matter accessories omit the key.

A Matter device advertises itself over mDNS as -, so the node id joins a HomeKit accessory to its network entry:

homeclaw-cli get "B1" --json | jq -r .matter_node_id   # e.g. 000000000000002A
dns-sd -B _matter._tcp                                  # instance names end in -

An unreachable accessory whose node id is missing from dns-sd output has dropped off the network (for Thread, the mesh). One that is still advertised points at the controller side instead.

The --since flag accepts ISO 8601 timestamps or duration shorthand: 1h, 30m, 2d.

Webhook

HomeClaw pushes HomeKit events to OpenClaw via mapped webhooks. Only accessories and scenes with configured triggers fire webhooks – untriggered events are logged to disk but not pushed. Reachability changes are opt-in: they fire only triggers whose characteristic is reachable (optionally with value false for drops only, and an accessory id for one device). Accessory triggers without that characteristic are not fired by reachability changes, so a flapping accessory does not flood them. A dedicated HomeClaw agent receives all events, classifies them by severity, and escalates noteworthy ones to the main agent.

Note: OpenClaw 2026.3.x has a known bug where /hooks/wake silently drops events (#33271). HomeClaw uses mapped webhooks (/hooks/homeclaw) which route through hooks.mappings and are not affected.

How It Works

HomeClaw POSTs all triggered events to a single mapped endpoint: /hooks/homeclaw. OpenClaw’s hooks.mappings config resolves the "homeclaw" key and routes each event to a dedicated HomeClaw agent that classifies and triages events.

HomeKit event --> HomeClaw event logger --> POST /hooks/homeclaw
    --> OpenClaw hooks.mappings --> HomeClaw Agent (dedicated)
        --> Classifies: CRITICAL / NOTABLE / AMBIENT
        --> If notable/critical: a2a to main agent
        --> If ambient: log to agent memory only

HomeClaw doesn’t need to know about agentId, channel, or sessionKey – all routing intelligence lives in the OpenClaw config.

Trigger Delivery Modes

Each trigger has a delivery mode that controls timing:

Mode Behavior Set via
Batched (default) Event queued until next heartbeat cycle Settings UI segmented control
Immediate Event delivered right away Settings UI segmented control

In Settings > Webhook, each enabled trigger shows a Batched / Immediate picker. Use Immediate for events you want to react to right away (leak sensors, door locks, scene triggers). Use Batched for ambient events (light toggles, temperature changes) to avoid noise.

Setup with AI Assistant

Paste this prompt into OpenClaw or Claude Code to configure webhooks end-to-end. The prompt is idempotent – it verifies each step and skips anything already configured:

Prerequisites: HomeClaw must be installed and running (menu bar icon visible). If using Claude Code, the homeclaw plugin must be registered (/plugin install homeclaw@homeclaw). The homeclaw-cli binary must be in your PATH.

Set up HomeClaw mapped webhooks with a dedicated HomeClaw agent. Verify each step first – skip any that are already configured.

1. HomeClaw agent workspace:

  • Check if homeclaw agent exists: openclaw agents list
  • If missing, install from the bundled app: openclaw agents install homeclaw /Applications/HomeClaw.app/Contents/Resources/openclaw/agents/homeclaw
  • Copy agent docs (IDENTITY/SOUL/AGENTS/TOOLS.md) from the app bundle to the local agent dir if newer
  • Configure agent: model claude-sonnet-4, restricted tools (memory, sessions/a2a, read/write only – no exec, no browser, no external services)

2. OpenClaw gateway hooks config:

  • Check ~/.openclaw/openclaw.json for a hooks.mappings.homeclaw entry
  • If missing, add:
"hooks": {
  "enabled": true,
  "token": "${HOMECLAW_WEBHOOK_TOKEN}",
  "mappings": {
    "homeclaw": {
      "agentId": "homeclaw",
      "sessionKey": "hook:homeclaw",
      "deliver": true,
      "channel": "last",
      "allowUnsafeExternalContent": true
    }
  }
}
  • Create a transform at ~/.openclaw/hooks/transforms/homeclaw-transform.js to convert HomeClaw state-change payloads into agent messages
  • Check ~/.openclaw/.env for HOMECLAW_WEBHOOK_TOKEN. If missing, generate one: openssl rand -base64 24 | tr '+/' '-_' | tr -d '=' and add it
  • Remove any legacy defaultSessionKey entries that are no longer needed with dedicated mapping
  • Restart gateway only if config changed: openclaw gateway restart

3. HomeClaw webhook config:

  • Check current config: homeclaw-cli config --json
  • Verify: webhook.enabled is true, webhook.url is http://127.0.0.1:18789, webhook.token matches the HOMECLAW_WEBHOOK_TOKEN from step 2, and webhook_endpoint is /hooks/homeclaw
  • Fix any mismatches via HomeClaw Settings UI or CLI
  • If circuit breaker shows old failures, reset it

4. End-to-end test:

  • Run homeclaw-cli config --webhook-test – expect HTTP 200
  • Verify circuit state is closed and last_success is recent

Report what was already configured, what was changed, and the test result.

Manual Setup

Circuit Breaker

The webhook system includes a tiered circuit breaker that prevents runaway delivery failures from hammering a down endpoint, while ensuring critical events are never silently dropped.

State Trigger Behavior Recovery
Normal – All webhooks delivered –
Soft Open 5 consecutive failures Non-critical paused Auto-resumes after 5 minutes
Hard Open 3 soft trips without any success All non-critical stopped Reset button in Settings, --webhook-reset CLI, or toggle off/on

Critical triggers (critical: true) always attempt delivery regardless of circuit state.

The circuit state is visible in:

  • Menu bar – warning icon when paused or disabled
  • Settings > Webhook – orange (paused) or red (disabled) banner with countdown
  • CLI – homeclaw-cli status shows circuit state, dropped count, and recovery hint

How Events Flow

Home app / physical device / Siri
        |
        v
HomeKit (HMAccessoryDelegate callback)
        |
        +-- Cache warmup? --> Update cache only (no logging, no webhooks)
        |
        +-- Battery event? --> Update cache only (silently dropped)
        |
        v
HomeClaw event logger (writes to events.jsonl)
        |
        +-- Trigger matches? --> POST /hooks/homeclaw
        |
        +-- No trigger --> Logged to disk only (no webhook sent)

        v  (trigger matched)
OpenClaw gateway validates Bearer token
        |
        v
hooks.mappings resolves "homeclaw"
        |
        v
HomeClaw Agent (dedicated)
        +-- Classifies: CRITICAL / NOTABLE / AMBIENT
        +-- If notable/critical: a2a to main agent
        +-- If ambient: log to agent memory only

Authentication

Uses Authorization: Bearer with idempotency headers (X-Request-ID, X-Event-Timestamp). See SKILL.md for the full trigger fields reference, scenario cookbook, and troubleshooting.

Device Filtering

Use the Devices tab in Settings or the CLI to control which accessories are exposed:

homeclaw-cli config --filter-mode allowlist
homeclaw-cli config --allow-accessories "uuid1,uuid2,uuid3"
homeclaw-cli config --list-devices  # shows allowed/filtered status

Building

The build script uses XcodeGen to generate the Xcode project and xcodebuild to compile all targets (HomeClaw Catalyst app, macOSBridge bundle, homeclaw-cli tool):

# Full release build + install to /Applications
scripts/build.sh --release --install

# Override team ID on the command line
scripts/build.sh --release --install --team-id ABCDE12345

# Debug build (faster)
scripts/build.sh --debug

# Clean build artifacts first
scripts/build.sh --clean

Your Apple Developer Team ID is required, provided via .env.local, --team-id, or the HOMEKIT_TEAM_ID environment variable.

Archiving for App Store / TestFlight

The release pipeline is scripts/release.sh, driving the App Store Connect CLI asc. Full guide: appstore/RELEASE.md.

scripts/release.sh help
scripts/release.sh status              # ASC versions, builds, TestFlight groups (read-only)
scripts/release.sh bump-build          # Next build number -> Resources/Info.plist (commit + tag it)
scripts/release.sh archive             # Build a release .xcarchive (no upload)
scripts/release.sh beta --dry-run      # Archive + export .pkg + validate with Apple, no upload
scripts/release.sh beta                # ... then upload to TestFlight (Internal Testers)
scripts/release.sh external            # Send the build to External Testers + beta review
scripts/release.sh release --dry-run   # Push metadata + screenshots, submit for App Review

# Tester notes default to appstore/metadata/en-US/release_notes.txt:
TF_CHANGELOG="Bug fixes and improvements" scripts/release.sh beta

# App Store screenshot pipeline (XCUITest-driven, demo mode, zero personal data):
scripts/release.sh screenshots         # Run HomeClawUITests in demo mode -> appstore/screenshots/en-US/
scripts/release.sh frame               # Frame them -> appstore/framed/en-US/
scripts/release.sh upload-screenshots  # Replace the Mac App Store screenshot set

The screenshot pipeline uses demo mode — HomeKitManager.isDemoMode (gated on --ui-test-demo launch arg or HOMECLAW_DEMO=1) bypasses HomeKit and serves synthetic data from Sources/homeclaw/HomeKit/DemoFixtures.swift. Real HomeKit data is never read or shown. Attachments are extracted with xcrun xcresulttool, which ships with Xcode.

Known follow-up: the menu-bar dropdown is NSMenu (AppKit), so it can’t be auto-rendered via SwiftUI ImageRenderer. Capture it manually with screencapture -x of the running demo-mode app, or build a SwiftUI mockup of the dropdown.

Auth uses an App Store Connect API key (ASC_KEY_ID, ASC_ISSUER_ID, ASC_PRIVATE_KEY_PATH, or the APP_STORE_CONNECT_API_* names). Team ID comes from .env.local (HOMEKIT_TEAM_ID).

To open the archive in Xcode Organizer instead of uploading:

scripts/release.sh archive
open '.asc/artifacts/HomeClaw.xcarchive'

Version Bumping

Version is derived from git tags at build time. To release a new version:

scripts/bump-version.sh 0.2.0   # Updates source files + prints tag commands
npm run build:mcp                # Rebuild MCP server with new version
git add -A && git commit -m "Bump version to 0.2.0"
git tag -a v0.2.0 -m "HomeClaw v0.2.0"
git push && git push origin v0.2.0

Installing on Additional Macs

Development-signed builds are tied to registered devices. To run HomeClaw on another Mac:

  1. Get the target Mac’s Provisioning UDID – on that Mac, run:

    system_profiler SPHardwareDataType | grep "Provisioning UDID"
    
  2. Register the device at developer.apple.com/account/resources/devices/add:

    • Platform: macOS
    • Device Name: a descriptive name (e.g. “Living Room MacBook Air”)
    • Device ID: the Provisioning UDID from step 1
  3. Rebuild on your development machine (Xcode regenerates the provisioning profile to include the new device):

    scripts/build.sh --release --install --clean
    
  4. Copy /Applications/HomeClaw.app to the target Mac (AirDrop, USB, network share, etc.)

  5. Grant HomeKit access on first launch when prompted.

Note: The target Mac must be signed into iCloud with an account that has HomeKit home data. HomeKit homes are tied to iCloud accounts, not to the app.

Why Development Signing?

Apple restricts the com.apple.developer.homekit entitlement to development signing and Mac App Store distribution. It cannot be included in Developer ID provisioning profiles. A Developer ID build would pass Gatekeeper but have no HomeKit access (HMHomeManager returns zero homes). This is an Apple platform restriction, not a bug.

Not Exposed by HomeKit

Some devices that appear in the Home app never reach the public HomeKit API, so HomeClaw cannot see them regardless of configuration:

  • HomePod and HomePod mini — including the mini’s built-in temperature and humidity sensors
  • Apple TV
  • The speaker component of accessories that embed one (an Ecobee’s smart speaker, for example)

These are absent from HMHome.accessories entirely. The Home app reaches them over a private media path that HMHomeManager does not expose. If you have HomePods assigned to a room and they don’t show up in homeclaw-cli list, this is why — it isn’t an accessory filter and it isn’t a mapping gap.

HomeClaw already maps speaker, television and microphone services, so if Apple ever surfaces these through the public API they will appear with no code change.

Project Structure

Sources/
  homeclaw/                Unified Catalyst app (Xcode target via XcodeGen)
    App/                   UIApplicationDelegate entry point, scene delegates
    Bridge/                BridgeProtocols.swift (Mac2iOS, iOS2Mac)
    HomeKit/               HomeKitManager, SocketServer, CharacteristicMapper,
                           AccessoryModel, DeviceMap, CharacteristicCache,
                           HomeEventLogger, WebhookCircuitBreaker
    Views/                 SettingsView, IntegrationsSettingsView
    Shared/                AppConfig, AppLogger, HomeClawConfig
  macOSBridge/             AppKit bundle (NSStatusItem menu bar)
    MacOSController.swift  NSStatusItem + NSMenu via iOS2Mac protocol
    Info.plist             NSPrincipalClass: MacOSController
  homeclaw-cli/            CLI tool (SPM executable + Xcode target)
    Commands/              list, get, set, search, scenes, get-scene, status, config, device-map,
                           events, triggers, delete-scene, import-scene, assign-rooms
    SocketClient.swift     Direct socket communication
Resources/                 Info.plist, entitlements, app icons
scripts/
  build.sh                 Build, sign, and install
  bump-version.sh          Update version across source files
  release.sh               Release pipeline (asc): archive, TestFlight, App Store
  screenshots.sh           Capture App Store screenshots via XCUITest
  frame_screenshots.sh     Frame screenshots for the App Store
appstore/
  metadata/                App Store listing (source of truth)
  screenshots/             Raw screenshots
  framed/                  Framed screenshots (uploaded)
  RELEASE.md               Release guide
mcp-server/                Node.js stdio MCP server (wraps homeclaw-cli)
openclaw/                  OpenClaw plugin (HomeClaw)
  skills/homekit/          HomeKit skill with full characteristic reference

App bundle layout (after build):
  Contents/MacOS/HomeClaw              Catalyst app executable
  Contents/MacOS/homeclaw-cli          Bundled CLI binary
  Contents/Resources/macOSBridge.bundle  AppKit menu bar plugin
  Contents/Resources/mcp-server.js       Node.js stdio MCP server
  Contents/Resources/openclaw/           Bundled OpenClaw plugin files

Debugging

The Node stdio MCP bridge checks the App Group socket at ~/Library/Group Containers/group.com.shahine.homeclaw/homeclaw.sock on each request, then tries /tmp/homeclaw.sock if the preferred socket is missing or refuses the connection. Claude Desktop can start before HomeClaw; a later call will discover the running app without restarting Claude. Fallback happens only before connecting, so a command is never replayed after it has been sent. Socket files must belong to the current user; symlinks and non-socket files are rejected before any command is sent.

If the bridge cannot connect, its error lists the attempted paths and connection errors. Launch HomeClaw, or restart it if it is already running. After installing an updated HomeClaw app, restart Claude Desktop to load the updated bundled MCP server. No socket symlink is needed.

# Check if HomeClaw is running and HomeKit is ready
echo '{"command":"status"}' | nc -U ~/Library/Group\ Containers/group.com.shahine.homeclaw/homeclaw.sock

# Or via the CLI
homeclaw-cli status

# Verify HomeKit entitlement on installed app
codesign -d --entitlements :- "/Applications/HomeClaw.app"

# View HomeClaw logs
log show --predicate 'process == "HomeClaw"' --last 10m --style compact

# Check TCC (privacy) permissions
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \
  "SELECT client, auth_value FROM access WHERE service = 'kTCCServiceWillow'"
Symptom Cause Fix
0 homes, ready: false Missing HomeKit entitlement Verify with codesign -d --entitlements
All characteristic values nil Accessory unreachable Check device power and network
“HomeKit Unavailable” in menu iCloud not signed in Sign into iCloud with HomeKit data
CLI crashes with SIGTRAP Missing bundle ID in sandbox Rebuild with CREATE_INFOPLIST_SECTION_IN_BINARY: YES

Tech Stack

  • Swift 6 with strict concurrency (@MainActor, actor isolation)
  • Mac Catalyst (UIKit) for HomeKit framework access
  • AppKit (via macOSBridge bundle) for native menu bar
  • Swift Argument Parser for CLI
  • Node.js + @modelcontextprotocol/sdk for stdio MCP server
  • XcodeGen for Xcode project generation
  • GCD + Unix domain sockets for CLI/MCP communication

FAQ

spctl --assess says “rejected” – is that a problem?

No. spctl checks Gatekeeper, which only trusts Developer ID and App Store signing. HomeClaw uses development signing (required for HomeKit on macOS), so Gatekeeper will always reject it. This is expected and doesn’t prevent the app from running – AMFI handles development-signed apps separately via the embedded provisioning profile.

Can I use a different Apple ID for HomeKit than my developer account?

Yes. The two accounts serve completely different purposes:

  • Apple Developer account – only matters at build time. Xcode uses it to create the provisioning profile and sign the code.
  • iCloud account (on the Mac running HomeClaw) – determines which HomeKit homes appear. This is the account linked to your Home app data.

These are independent. You can build HomeClaw with your developer account and run it on a Mac signed into a completely different iCloud account that has HomeKit homes. The HomeKit data follows the iCloud account, not the signing identity.

When should I use --clean?

Use scripts/build.sh --clean when:

  • Switching Apple Developer Team IDs
  • After major Xcode version updates
  • Build fails with signing or entitlement errors
  • You see code signature errors after rebuilding

The --clean flag removes all build artifacts before building fresh.

HomeKit shows 0 homes

The app is running but can’t see any HomeKit data. Check in order:

  1. iCloud signed in? HomeKit data lives in iCloud. Open System Settings > Apple Account and verify.
  2. HomeKit entitlement present? Run:
    codesign -d --entitlements :- "/Applications/HomeClaw.app"
    
    You should see com.apple.developer.homekit -> true.
  3. TCC permission granted? On first launch, macOS asks for HomeKit access. If you denied it, re-grant in System Settings > Privacy & Security > HomeKit.
  4. Using Developer ID signing? Only development signing supports the HomeKit entitlement. See Why Development Signing?.

How do I reset or uninstall HomeClaw?

Moving HomeClaw.app to the Trash removes the app, not necessarily its local settings or the setup entries in other apps. Your homes, scenes and automations belong to Apple Home, not to the HomeClaw installation. Reinstalling HomeClaw or resetting its local configuration does not remove them.

Try the smallest change first. Use Settings → HomeKit to choose the active home or Settings → Devices to review which accessories are selected. For a missing menu scene, check that the right home is active; there is no need to delete a scene or reset the app to check. In Settings → Event Log, Show in Finder opens the actual HomeClaw data folder for your installation.

Start with fresh local configuration (reversible):

  1. Open the data folder using Show in Finder. For the Mac App Store build, it’s normally ~/Library/Containers/com.shahine.homeclaw/Data/Library/Application Support/HomeClaw. Use the location shown in Settings if it differs.
  2. Pause connected AI clients and OpenClaw integrations. In Settings → Integrations, turn off Enable Streamable HTTP MCP if enabled. Turn off Launch at Login if enabled, then choose Quit HomeClaw in the menu bar.
  3. In Finder, move config.json, cache.json (if present), and the entire event log family (events.jsonl and every numbered backup such as events.jsonl.1) out of the data folder into a private backup folder. Keep the log files together. On reset, logging defaults to on with a 50 MB rotation threshold and three backups; leaving old logs in place can cause some history to be overwritten. Moving them aside before reopening keeps the originals intact. If ~/.config/homeclaw/config.json from an older install exists, also move it and its companion cache.json (if present) into a separate private backup folder. Otherwise HomeClaw may copy that older configuration back into place. Backups can contain private device details or a webhook token; don’t share them.
  4. Reopen HomeClaw. Old logs stay in your backup folder and won’t appear in the app. New logs go to the original folder, accessible again via Settings → Event Log → Show in Finder. Adjust logging there if needed. Set the active home, review Settings → Devices, and set up any needed webhook configuration before reconnecting clients. The default device filter is All Accessories; restore Selected Only and its selection if you used it.
  5. To roll back, pause clients and quit again. Set aside the newly created config.json, cache.json and all new event log files in a different folder, then restore the original files to their original locations. Don’t combine the old and new log files in the live folder. Keep a separate copy of the old logs if you want to preserve them beyond the restored retention limit. If you turned off Launch at Login or HTTP MCP, those toggles stay off until you enable them again.

This resets the active home selection, device filter, webhook and log settings stored in config.json. It doesn’t clear the separate onboarding completion preference or reset macOS HomeKit permission. HomeClaw does not currently offer a full factory reset. Leave the app-group folder used for the CLI socket, macOS privacy settings, and Apple Home data alone.

Uninstall: Turn off Launch at Login, quit HomeClaw, and move HomeClaw.app to the Trash (Apple’s uninstall instructions). If you added HomeClaw to Claude or OpenClaw, remove only the HomeClaw integration from that client’s settings if you no longer want it. Don’t remove the client’s entire configuration or shared folders.

How do I install on another Mac?

Development-signed apps are tied to registered devices. See Installing on Additional Macs for the full walkthrough.

How do I see what’s happening?

# HomeClaw app logs
log show --predicate 'process == "HomeClaw"' --last 10m --style compact

# Check HomeKit status directly over the socket
homeclaw-cli status

# Verify code signature and entitlements
codesign -d --entitlements :- "/Applications/HomeClaw.app"

Star HomeClaw on GitHub

The menu bar and Settings → About offer a Star HomeClaw on GitHub button. After five completed client actions (verified device controls, successful scene executions, or successful webhook deliveries), a one-time note can appear in About. The app never opens Settings in the background. Launches, polling, test webhooks, previews, and unverified controls do not count. The counter and dismissal stay in local preferences and are not sent anywhere.

Mac App Store builds open the repository in your browser and do not check your GitHub account; HomeClaw cannot tell whether you have already starred it. Local builds can check the star using the GitHub CLI when Settings is active and use your existing GitHub CLI login if you explicitly click Star. If the CLI is missing or the star request fails, the button opens the repository in your browser instead.

License

MIT – Copyright © 2025 Omar Shahine

View the full README on GitHub

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "homeclaw": { "command": "node", "args": ["/Applications/HomeClaw.app/Contents/Resources/mcp-server.js"] } } }