Install
openclaw skills install @soullhcn/smart-home-plannerUse when users want help with smart home planning, device selection, automation design, platform comparison, or configuration for Home Assistant, 米家/小米, or Apple HomeKit. Triggers on smart home, 智能家居, home automation, device recommendation, 自动化场景, and home assistant setup.
openclaw skills install @soullhcn/smart-home-plannerGuide users through smart-home planning and configuration with safe defaults and clear handoffs between planning, setup, and local automation. Supports Home Assistant, 米家/小米, and Apple HomeKit.
Ask one question at a time. Collect:
Required (3):
Optional (with defaults): 4. Area → estimate from layout 5. Family members → normal adults (note: elderly, children, pets affect device choice) 6. Existing devices → none 7. Tech level → medium (affects platform recommendation) 8. Priority rooms → all rooms 9. Desired scenes → 5 base scenes (home/away/sleep/wake/security) 10. Special needs → voice control, remote control, energy monitoring
If the user does not provide a required field, ask only for the missing field. If the user declines profile persistence, continue with an ephemeral session and do not write profile.yaml. If the user changes layout, budget, or platform later, recalculate the plan from that new baseline instead of patching the old one.
After collection, save to ~/.config/smart-home-planner/profile.yaml:
household:
layout: "..."
floor: N
members: [...]
tech_level: "..."
platform:
primary: "..."
secondary: "..."
server: "..."
api_access:
home_assistant: { granted: false }
mijia: { granted: false }
homekit: { granted: false }
existing_devices: [...]
budget: "..."
priorities: { rooms: [...], scenarios: [...], special: [...] }
~/.config/smart-home-planner/profile.yamlGenerate and output:
Device list & layout — organized by room, each device with:
Automation scene effects — plain language descriptions, NO technical details:
Present to user and ask: "Does this plan look good? Any adjustments?"
Output contract: use a stable device table, scene table, and purchase-guide table. Prices should be in CNY and clearly marked as estimated when they are not exact. Compatibility warnings should only flag protocol, hub, wiring, platform, or safety issues that materially affect deployment.
After user confirms:
Triggered when user says they've bought devices and want to configure.
Check user profile api_access field for each platform.
If granted AND token valid → direct config mode
If granted BUT token expired → guide token refresh
If not granted → ask if user wants to grant access
If API access fails, is rate-limited, or a device cannot be found, stop and explain the failure path instead of guessing. If generated YAML does not validate, fix the config or hand back a manual guide.
Home Assistant:
米家 — Use mijia-api:
pip install mijiaAPIapi.login() → QR code appears~/.config/mijia-api/auth.jsonapi_access.mijia.granted: trueknowledge/mijia-api-guide.md for detailed guideApple HomeKit — Use homebridge-mcp-server:
npm install -g @mp-consulting/homebridge-mcp-serverapi_access.homekit.granted: trueknowledge/homekit-guide.md for detailed guideIf API available:
If API not available:
templates/config-snippets.mdRecommend local automation only when the user has always-on hardware and wants local control, lower latency, or polling-based rules that cloud scenes cannot handle well. If the user has no always-on device or only needs simple cloud scenes, prefer Mi Home App automation or the platform-native automation UI instead.
When user wants automations that run locally (not in Mi Home cloud):
Who is this for: Local automation requires a 24/7 always-on device (NAS, Raspberry Pi, old PC, server) to run the polling engine. Best suited for users who have local hardware running at home (e.g., NAS owners, Raspberry Pi enthusiasts, home server hobbyists). If the user has no always-on device, recommend using Mi Home App cloud automation instead.
"Where do you want the automation to run?"
→ A) Mi Home App cloud automation (simplest, no extra hardware)
→ B) Local automation (needs a 24/7 device like NAS/Raspberry Pi/old PC)
→ C) Both
If user chooses B but has no always-on device, prompt: "Local automation needs a device that runs 24/7. Do you have any of these?" → NAS (Synology/QNAP/etc.) → Raspberry Pi → Old PC/Mac mini → Other always-on server → None → recommend Mi Home App cloud automation
If the household mixes ecosystems, treat Home Assistant as the coordinator when possible instead of forcing everything through mijia-api.
Setup flow:
~/.config/mijia-api/auth.json exists)scripts/automation_setup.sh to install deps + copy configs--discover to list all devices with DIDsdevices.yaml — map DIDs to HA-style entity_idsautomations.yaml — YAML rules matching user's scenesTwo execution modes:
| Mode | Command | RAM | Use case |
|---|---|---|---|
| Standalone | python3 automation/run_automations.py | ~20-50MB | Simple, no extra deps |
| AppDaemon | appdaemon -c automation/conf/ | ~50-150MB | Web UI, complex logic |
Standalone mode (recommended for most users):
mijia_client.py as AppDaemon plugin--discover flag for device listingAppDaemon mode:
mijiaplugin.py (not mijia_plugin.py)MijiaPluginget_namespace(), get_updates(), stop(), get_complete_state(), get_metadata(), utility()devices_file: devices.yaml (NOT !include YAML tag)Smart polling:
Running as background service:
nohup python3 automation/run_automations.py --config ~/.config/smart-home-planner/automation/conf &
Based on user's planned scenes, generate YAML rules (HA-compatible format):
- id: living_room_music
alias: "客厅有人就播放音乐"
trigger:
- platform: state
entity_id: "sensor.occupy_living_room"
to: "on"
condition:
- condition: time
after: "08:00:00"
before: "23:00:00"
action:
- service: scene.turn_on
target:
entity_id: "scene.music_mode"
mode: single
Supported: state/numeric_state/time triggers, state/time/and/or/not conditions, scene.turn_on/light.turn_on/mijia.* actions.
See templates/automations-template.yaml for common patterns.
See knowledge/automation-guide.md for full documentation.
Before giving the final recommendation, check:
Load as needed:
knowledge/platforms.md — platform architecture, API details, auth methodsknowledge/devices.md — device categories, protocols, brands, compatibilityknowledge/automation-patterns.md — scene templates and triggersknowledge/mijia-api-guide.md — mijia-api installation, auth, device controlknowledge/homekit-guide.md — homebridge-mcp-server installation, MCP config, device controlknowledge/automation-guide.md — local automation setup, YAML format, smart pollingtemplates/plan-template.md — planning document structuretemplates/config-snippets.md — platform-specific config codetemplates/mijia-control-examples.md — mijia-api code examplestemplates/automations-template.yaml — common automation rule templatesWhen configuring, detect agent capabilities:
→ Full Phase 1 + Phase 2 flow
→ Skip to Phase 3, detect mijia API access, configure or guide
→ Reference knowledge/platforms.md, answer comparison
→ Focus on sensors + cameras + security scene from knowledge/automation-patterns.md
→ Phase 3 only, use bedroom-specific devices and scenes