/install homekit
HomeKit Smart Home Controller
Control Apple HomeKit smart home devices using Python scripts.
Features
- 🔍 Discover unpaired devices
- 🔗 Pair/Unpair devices
- 📱 List all paired devices
- 💡 Control light switches and brightness
- 🔌 Control outlets and switches
- 🌡️ View device status
Prerequisites
1. Install Dependencies
pip3 install HAP-python homekit --user
2. Pair Devices
Pair your devices before first use:
# Discover devices
python3 scripts/homekit.py discover
# Pair a device
python3 scripts/homekit.py pair "Device Name" "XXX-XX-XXX" "alias"
The pairing code is usually found in the device manual or on the device itself (format: XXX-XX-XXX).
Usage
List All Devices
python3 scripts/homekit.py list
Example output:
📱 Found 3 devices:
Alias Name Type Status
----------------------------------------------------------------------
💡 living-light Living Room Light Lightbulb on (80%)
🔌 desk-outlet Desk Outlet Outlet off
💡 bedroom-lamp Bedside Lamp Lightbulb off
Control Devices
Turn on:
python3 scripts/homekit.py on living-light
Turn off:
python3 scripts/homekit.py off living-light
Set brightness (0-100):
python3 scripts/homekit.py brightness living-light 50
View Device Status
python3 scripts/homekit.py status living-light
Device Management
Discover new devices:
python3 scripts/homekit.py discover --timeout 10
Unpair a device:
python3 scripts/homekit.py unpair living-light
Supported Device Types
| Type | Supported Operations |
|---|---|
| 💡 Lightbulb | On/Off, Brightness |
| 🔌 Outlet | On/Off |
| 🔲 Switch | On/Off |
| 🌡️ Thermostat | View temp, Set target temp |
| 🌀 Fan | On/Off, Speed |
Troubleshooting
Error: homekit library not installed
→ Run: pip3 install HAP-python homekit --user
Error: Device not found → Ensure the device and computer are on the same WiFi network.
Error: Pairing failed → Check if the pairing code is correct and the device is in pairing mode.
Device shows offline → Try re-pairing or check device power.
Advanced Usage
Batch Control
# Turn off all lights
for device in living-light bedroom-lamp kitchen-light; do
python3 scripts/homekit.py off $device
done
Scene Script Example
Create ~/scripts/goodnight.sh:
#!/bin/bash
# Goodnight Scene: Turn off all lights except a dim bedside lamp
python3 ~/.openclaw/workspace/homekit/scripts/homekit.py off living-light
python3 ~/.openclaw/workspace/homekit/scripts/homekit.py off kitchen-light
python3 ~/.openclaw/workspace/homekit/scripts/homekit.py brightness bedroom-lamp 10
echo "Goodnight 😴"
References
- HomeKit Official Docs: https://developer.apple.com/homekit/
- Library Docs: https://github.com/jlusiardi/homekit_python
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install homekit - 安装完成后,直接呼叫该 Skill 的名称或使用
/homekit触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
HomeKit Smart Home Control 是什么?
Control Apple HomeKit smart home devices. Supports listing, discovering, pairing devices, and controlling lights, switches, outlets, thermostats. Use when th... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2227 次。
如何安装 HomeKit Smart Home Control?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install homekit」即可一键安装,无需额外配置。
HomeKit Smart Home Control 是免费的吗?
是的,HomeKit Smart Home Control 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
HomeKit Smart Home Control 支持哪些平台?
HomeKit Smart Home Control 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 HomeKit Smart Home Control?
由 manifold(@manifoldor)开发并维护,当前版本 v1.0.6。