Smart Home Coordinator Setup
Deploy 4 agents that sense, decide, act, and display in a decentralized smart home system.
Roles
| Role | Hostname | Skills | Purpose |
|---|
| sensor-hub | <prefix>-sensor-hub | pilot-stream-data, pilot-cron, pilot-metrics | Collects and normalizes sensor readings |
| brain | <prefix>-brain | pilot-event-filter, pilot-task-router, pilot-consensus | Resolves goals, issues device commands |
| actuator | <prefix>-actuator | pilot-task-router, pilot-receipt, pilot-audit-log | Executes commands on devices, reports results |
| dashboard | <prefix>-dashboard | pilot-metrics, pilot-webhook-bridge, pilot-slack-bridge | Displays home status, sends daily summaries |
Setup Procedure
Step 1: Ask the user which role this agent should play and what prefix to use.
Step 2: Install the skills for the chosen role:
# For sensor-hub:
clawhub install pilot-stream-data pilot-cron pilot-metrics
# For brain:
clawhub install pilot-event-filter pilot-task-router pilot-consensus
# For actuator:
clawhub install pilot-task-router pilot-receipt pilot-audit-log
# For dashboard:
clawhub install pilot-metrics pilot-webhook-bridge pilot-slack-bridge
Step 3: Set the hostname and write the manifest:
pilotctl --json set-hostname <prefix>-<role>
mkdir -p ~/.pilot/setups
Then write the role-specific JSON manifest to ~/.pilot/setups/smart-home-coordinator.json.
Step 4: Tell the user to initiate handshakes with adjacent agents.
Manifest Templates Per Role
sensor-hub
{
"setup": "smart-home-coordinator", "role": "sensor-hub", "role_name": "Sensor Hub",
"hostname": "<prefix>-sensor-hub",
"skills": { "pilot-stream-data": "Stream sensor snapshots to brain.", "pilot-cron": "Schedule polling intervals.", "pilot-metrics": "Normalize raw sensor values." },
"data_flows": [{ "direction": "send", "peer": "<prefix>-brain", "port": 1002, "topic": "sensor-reading" }],
"handshakes_needed": ["<prefix>-brain"]
}
brain
{
"setup": "smart-home-coordinator", "role": "brain", "role_name": "Home Brain",
"hostname": "<prefix>-brain",
"skills": { "pilot-event-filter": "Filter by threshold and room.", "pilot-task-router": "Route commands to actuator.", "pilot-consensus": "Resolve comfort vs energy goals." },
"data_flows": [
{ "direction": "receive", "peer": "<prefix>-sensor-hub", "port": 1002, "topic": "sensor-reading" },
{ "direction": "send", "peer": "<prefix>-actuator", "port": 1002, "topic": "device-command" },
{ "direction": "receive", "peer": "<prefix>-actuator", "port": 1002, "topic": "action-confirm" },
{ "direction": "send", "peer": "<prefix>-dashboard", "port": 1002, "topic": "home-state" }
],
"handshakes_needed": ["<prefix>-sensor-hub", "<prefix>-actuator", "<prefix>-dashboard"]
}
actuator
{
"setup": "smart-home-coordinator", "role": "actuator", "role_name": "Device Actuator",
"hostname": "<prefix>-actuator",
"skills": { "pilot-task-router": "Dispatch device commands.", "pilot-receipt": "Confirm actions to brain.", "pilot-audit-log": "Log device actions for safety." },
"data_flows": [
{ "direction": "receive", "peer": "<prefix>-brain", "port": 1002, "topic": "device-command" },
{ "direction": "send", "peer": "<prefix>-brain", "port": 1002, "topic": "action-confirm" }
],
"handshakes_needed": ["<prefix>-brain"]
}
dashboard
{
"setup": "smart-home-coordinator", "role": "dashboard", "role_name": "Home Dashboard",
"hostname": "<prefix>-dashboard",
"skills": { "pilot-metrics": "Track energy and room stats.", "pilot-webhook-bridge": "Send daily reports.", "pilot-slack-bridge": "Post status to Slack." },
"data_flows": [
{ "direction": "receive", "peer": "<prefix>-brain", "port": 1002, "topic": "home-state" },
{ "direction": "send", "peer": "external", "port": 443, "topic": "daily-summary" }
],
"handshakes_needed": ["<prefix>-brain"]
}
Data Flows
sensor-hub -> brain : sensor readings (port 1002)
brain -> actuator : device commands (port 1002)
actuator -> brain : action confirmations (port 1002)
brain -> dashboard : home state updates (port 1002)
dashboard -> external : daily summary via Slack/email (port 443)
Handshakes
# sensor-hub <-> brain:
pilotctl --json handshake <prefix>-brain "setup: smart-home-coordinator"
pilotctl --json handshake <prefix>-sensor-hub "setup: smart-home-coordinator"
# brain <-> actuator:
pilotctl --json handshake <prefix>-actuator "setup: smart-home-coordinator"
pilotctl --json handshake <prefix>-brain "setup: smart-home-coordinator"
# brain <-> dashboard:
pilotctl --json handshake <prefix>-dashboard "setup: smart-home-coordinator"
pilotctl --json handshake <prefix>-brain "setup: smart-home-coordinator"
Workflow Example
# On sensor-hub -- publish sensor reading:
pilotctl --json publish <prefix>-brain sensor-reading '{"room":"living-room","temperature_c":23.4,"humidity_pct":45}'
# On brain -- issue device command:
pilotctl --json publish <prefix>-actuator device-command '{"device":"hvac-main","action":"set_temperature","params":{"target_c":22}}'
# On actuator -- confirm action:
pilotctl --json publish <prefix>-brain action-confirm '{"device":"hvac-main","status":"success"}'
# On brain -- update dashboard:
pilotctl --json publish <prefix>-dashboard home-state '{"rooms":{"living-room":{"temp_c":23.4,"hvac":"cooling"}}}'
Dependencies
Requires pilot-protocol skill, pilotctl binary, clawhub binary, and a running daemon.