apple-homekit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseApple HomeKit Skill
Apple HomeKit Skill
Overview
概述
Enables Claude to interact with Apple HomeKit for controlling smart home devices, creating scenes, managing automations, and organizing devices by room.
让Claude能够与Apple HomeKit交互,实现控制智能家居设备、创建场景、管理自动化以及按房间整理设备的功能。
Quick Install
快速安装
bash
curl -sSL https://canifi.com/skills/apple-homekit/install.sh | bashOr manually:
bash
cp -r skills/apple-homekit ~/.canifi/skills/bash
curl -sSL https://canifi.com/skills/apple-homekit/install.sh | bash或手动安装:
bash
cp -r skills/apple-homekit ~/.canifi/skills/Setup
配置
Configure via canifi-env:
bash
undefined通过canifi-env进行配置:
bash
undefinedFirst, ensure canifi-env is installed:
首先,确保已安装canifi-env:
curl -sSL https://canifi.com/install.sh | bash
curl -sSL https://canifi.com/install.sh | bash
canifi-env set APPLE_ID_EMAIL "your-email@example.com"
undefinedcanifi-env set APPLE_ID_EMAIL "your-email@example.com"
undefinedPrivacy & Authentication
隐私与身份验证
Your credentials, your choice. Canifi LifeOS respects your privacy.
你的凭据,由你做主。 Canifi LifeOS尊重你的隐私。
Option 1: Manual Browser Login (Recommended)
选项1:手动浏览器登录(推荐)
If you prefer not to share credentials with Claude Code:
- Complete the Browser Automation Setup using CDP mode
- Login to the service manually in the Playwright-controlled Chrome window
- Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭据:
- 使用CDP模式完成浏览器自动化设置
- 在Playwright控制的Chrome窗口中手动登录服务
- Claude将使用你的已认证会话,全程不会获取你的密码
Option 2: Environment Variables
选项2:环境变量
If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果你愿意共享凭据,可以将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"注意:存储在canifi-env中的凭据仅在你的本地设备上可访问,绝不会被传输。
Capabilities
功能特性
- Control HomeKit-compatible devices
- Create and activate scenes
- Set up automations and triggers
- Organize devices by room
- Manage home members and access
- 控制兼容HomeKit的设备
- 创建并激活场景
- 设置自动化与触发条件
- 按房间整理设备
- 管理家庭成员与访问权限
Usage Examples
使用示例
Example 1: Scene Activation
示例1:场景激活
User: "Activate the Good Morning scene in HomeKit"
Claude: I'll activate your Good Morning scene via HomeKit.用户:"在HomeKit中激活早安场景"
Claude:我将通过HomeKit为你激活早安场景。Example 2: Device Control
示例2:设备控制
User: "Lock all doors through HomeKit"
Claude: I'll send the lock command to all HomeKit-connected door locks.用户:"通过HomeKit锁上所有门"
Claude:我将向所有连接HomeKit的门锁发送锁定指令。Example 3: Create Automation
示例3:创建自动化
User: "Create an automation to turn on lights when I arrive home"
Claude: I'll create a location-based automation for your lights.用户:"创建一个我到家时自动开灯的自动化规则"
Claude:我将为你创建一个基于位置的灯光自动化规则。Authentication Flow
认证流程
- Navigate to icloud.com/home via Playwright MCP
- Sign in with Apple ID
- Handle 2FA via trusted device
- Select Home from iCloud apps
- Maintain session for subsequent requests
- 通过Playwright MCP访问icloud.com/home
- 使用Apple ID登录
- 通过可信设备处理双重认证(2FA)
- 从iCloud应用中选择Home
- 保持会话以用于后续请求
Error Handling
错误处理
- Login Failed: Retry authentication up to 3 times, then notify via iMessage
- Session Expired: Re-authenticate with Apple ID
- 2FA Required: Wait for code from trusted device
- Rate Limited: Implement exponential backoff
- Device Unresponsive: Check device status and hub
- 登录失败:最多重试3次认证,随后通过iMessage通知
- 会话过期:使用Apple ID重新认证
- 需要2FA:等待可信设备发送的验证码
- 速率限制:实现指数退避策略
- 设备无响应:检查设备状态与中枢
Self-Improvement Instructions
自我优化说明
When encountering new UI patterns:
- Document iCloud Home interface changes
- Update selectors for new layouts
- Track Matter device additions
- Monitor automation capabilities
当遇到新的UI模式时:
- 记录iCloud Home界面的变化
- 更新针对新布局的选择器
- 追踪Matter设备的新增情况
- 监控自动化功能的更新
Notes
注意事项
- Requires Apple Home Hub (HomePod/Apple TV/iPad)
- HomeKit Secure Video for cameras
- Matter support expands compatibility
- Siri integration for voice control
- 需要Apple Home中枢(HomePod/Apple TV/iPad)
- 摄像头需使用HomeKit Secure Video
- Matter支持扩展了兼容性
- 支持与Siri集成实现语音控制