Skip to content
This repository was archived by the owner on May 30, 2026. It is now read-only.

Add HomeKit scenes support (list & execute)#1

Merged
thewilloftheshadow merged 2 commits into
openclaw:mainfrom
jruck:feature/scenes-support
Feb 7, 2026
Merged

Add HomeKit scenes support (list & execute)#1
thewilloftheshadow merged 2 commits into
openclaw:mainfrom
jruck:feature/scenes-support

Conversation

@jruck
Copy link
Copy Markdown
Contributor

@jruck jruck commented Feb 7, 2026

Summary

Adds REST API endpoints and UI support for HomeKit scenes (action sets).

API Endpoints

GET /homekit/scenes

Lists all HomeKit scenes across all homes.

Response:

{
  "ok": true,
  "data": [
    {
      "id": "EF16B595-15F7-50D4-BECF-49DFEB28DE69",
      "name": "Dim Aoife's Room",
      "homeId": "9C4B0BB5-45DE-5DE0-89BE-CE81FEE471C8",
      "type": "com.apple.HMActionSetTypeUserDefined",
      "isExecuting": false
    }
  ]
}

POST /homekit/scenes/:id/execute

Executes a scene by UUID. Returns the scene name and execution status.

Response:

{
  "ok": true,
  "data": {
    "name": "Dim Aoife's Room",
    "status": "executed"
  }
}

Errors:

  • 404 — Scene not found
  • 403 — HomeKit module disabled
  • 500 — Execution failed (with underlying error message)

UI Changes

  • Sidebar: New "Scenes" section listing all HomeKit scenes, with an "All scenes" option at the top (mirrors the existing "All accessories" pattern)
  • API Docs: Selecting a scene in the sidebar switches the docs view to show scene-specific endpoints with the selected scene's UUID templated into curl examples
  • Scene filter dropdown: Mirrors the existing accessory filter picker for consistency
  • Accessory and scene selections are mutually exclusive

Files Changed

File Change
CasaModels.swift New CasaScene model struct
HomeKitManager.swift scenes property, scene(with:) lookup, executeScene() async method
HomeKitServer.swift Route handling, payload mapping, JSON serialization
ContentView.swift Sidebar scenes section with selection management
ApiDocsView.swift Scene filter dropdown and scene-specific endpoint cards

Testing

Tested locally with 42 HomeKit scenes. Scene listing returns all scenes across homes. Execute triggers the scene via HMHome.executeActionSet() and returns within ~500ms.

jruck and others added 2 commits February 7, 2026 14:15
- GET /homekit/scenes — list all scenes with id, name, homeId, type, isExecuting
- POST /homekit/scenes/:id/execute — execute a scene by UUID

Server:
  - HomeKitManager: scenes property, scene(with:) lookup, executeScene() async
  - HomeKitServer: route handling for GET and POST with homeKit-disabled guard
  - HomeKitPayload/HomeKitMapper: CasaScene model and JSON serialization

UI:
  - Sidebar: new Scenes section with 'All scenes' + per-scene rows
  - Selecting a scene switches API docs to show scene-specific endpoints
  - Scene filter dropdown mirrors existing accessory filter for consistency
  - Accessory and scene selections are mutually exclusive
@thewilloftheshadow thewilloftheshadow merged commit 66d84d9 into openclaw:main Feb 7, 2026
@thewilloftheshadow
Copy link
Copy Markdown
Member

Thanks for the contribution, ping me our Discord @4shadowed please!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants