Setup
On first use, read setup.md and align activation boundaries, local network scope, and write-safety defaults before sending Shelly commands.
When to Use
Use this skill when the user needs practical Shelly execution: local RPC control, status and telemetry reads, cloud-assisted operations, device grouping, or staged automations.
Use this instead of generic IoT advice when outcomes depend on Shelly-specific RPC behavior, transport channel choice, and safe multi-device rollouts.
Architecture
Memory lives in ~/shelly/. See memory-template.md for structure and status values.
CODEBLOCK0
Quick Reference
Use the smallest file needed for the current task.
| Topic | File |
|---|
| Setup and activation behavior | INLINECODE3 |
| Memory and workspace templates |
memory-template.md |
| Protocol and transport choices |
protocol-matrix.md |
| Access and authentication models |
auth-and-access.md |
| Device command and state workflows |
device-operations.md |
| Multi-device rollout playbooks |
orchestration-playbooks.md |
| Diagnostics and recovery |
troubleshooting.md |
Requirements
- - Shelly devices reachable in the target local network, or cloud account access for cloud mode
- For cloud operations:
SHELLY_CLOUD_TOKEN set in environment - For reliable automation: stable device ids, component ids, and execution boundaries
Never ask users to paste production secrets in chat logs. Prefer local environment variables and redacted examples.
Data Storage
Keep local operational notes in ~/shelly/:
- - network and endpoint decisions
- device component maps and verified RPC methods
- automation policies, sequencing, and rollback constraints
- incident signatures and mitigations
Core Rules
1. Select the Correct Control Plane Before Acting
- - Decide local-only, cloud-assisted, or mixed mode before issuing commands.
- Block execution when control plane is ambiguous because status and command outcomes become inconsistent.
2. Resolve Transport Channel by Task and Scale
- - Use local HTTP RPC for direct control and deterministic reads.
- Use WebSocket notifications for near real-time state updates and MQTT for event pipelines where broker integration is required.
3. Discover Components and Capabilities Before Writes
- - Read device status and component layout before command generation.
- Generate writes only for existing component ids and supported method parameters.
4. Use Read-Before-Write and Read-After-Write Loops
- - Capture baseline state before every write.
- Verify resulting state after execution and stop rollout on mismatch.
5. Enforce Explicit Safety Gates for High-Impact Actions
- - Start in read-only inspection and dry-run planning mode.
- Require explicit confirmation before relay power toggles, heating control, locks, alarms, or bulk updates.
6. Keep Local and Cloud Views Consistent
- - Reconcile device identity and state if local RPC and cloud responses diverge.
- Prefer local device truth for immediate state decisions when reachable.
7. Design Automations as Idempotent and Observable
- - Use deterministic run ids, bounded retries, and hard stop conditions.
- Log each execution step with expected state checks to avoid duplicate or partial transitions.
8. Preserve Security and Privacy Boundaries
- - Use least-privilege credentials and only declared endpoints.
- Read cloud token from environment variables and never write raw secrets to local notes.
Common Traps
- - Mixing local and cloud control without precedence rules -> conflicting state and duplicate writes.
- Sending RPC methods without validating component ids -> rejected calls or wrong target behavior.
- Treating transport choice as interchangeable -> latency and reliability mismatches under load.
- Bulk execution without canary checks -> large blast radius when one method is misconfigured.
- Assuming notification streams imply successful writes -> command accepted but desired final state not reached.
- Storing cloud tokens in plaintext notes -> unnecessary credential exposure.
External Endpoints
| Endpoint | Data Sent | Purpose |
|---|
| http://<device-ip>/rpc | RPC method names, params, and request identifiers | Local Shelly device control and status retrieval |
| ws://<device-ip>/rpc |
RPC messages and event subscriptions | Local WebSocket notifications and event streaming |
| mqtt://
| Device state and command topics with payloads | MQTT-based event and automation integration |
| https://*.shelly.cloud | Account-scoped API requests, device metadata, and command payloads | Shelly cloud control and remote device operations |
| https://shelly-api-docs.shelly.cloud | Documentation lookup queries | Validate Shelly API behavior and method constraints |
No other data is sent externally.
Security & Privacy
Data that leaves your machine:
- - local RPC or cloud API payloads needed for requested Shelly operations
- optional MQTT publish/subscribe payloads in user-configured broker setups
Data that stays local:
- - environment mapping, device capability notes, and runbooks under INLINECODE12
- incident timelines and rollback decisions
This skill does NOT:
- - use undeclared third-party endpoints
- request bypass or evasion techniques
- store
SHELLY_CLOUD_TOKEN in local skill files - execute bulk writes without user confirmation and verification strategy
Trust
This skill sends operational data to Shelly devices and optionally Shelly cloud services when execution is approved.
Only install if you trust your network environment, broker setup, and Shelly account scope with this automation data.
Related Skills
Install with clawhub install <slug> if user confirms:
- -
iot - Device connectivity and IoT system integration patterns - INLINECODE16 - Home automation architecture and reliability practices
- INLINECODE17 - API contract design and robust request handling
- INLINECODE18 - Messaging patterns for telemetry and event-driven orchestration
- INLINECODE19 - Self-hosted service operations and network reliability workflows
Feedback
- - If useful: INLINECODE20
- Stay updated: INLINECODE21
设置
首次使用时,请先阅读 setup.md,在发送 Shelly 命令前,对齐激活边界、本地网络范围以及写入安全默认值。
使用时机
当用户需要实际的 Shelly 执行操作时使用此技能:本地 RPC 控制、状态与遥测读取、云端辅助操作、设备分组或分阶段自动化。
当结果依赖于 Shelly 特定的 RPC 行为、传输通道选择以及安全的多设备部署时,请使用此技能而非通用的物联网建议。
架构
记忆文件位于 ~/shelly/。有关结构和状态值,请参阅 memory-template.md。
text
~/shelly/
|-- memory.md # 核心上下文和激活边界
|-- environments.md # 局域网段、云端上下文和端点映射
|-- devices.md # 设备注册表、组件和命令模式
|-- automations.md # 排序规则、时间表和回滚计划
-- incidents.md # 故障特征和已验证的恢复方案
快速参考
为当前任务使用所需的最小文件。
| 主题 | 文件 |
|---|
| 设置和激活行为 | setup.md |
| 记忆和工作区模板 |
memory-template.md |
| 协议和传输选择 | protocol-matrix.md |
| 访问和认证模型 | auth-and-access.md |
| 设备命令和状态工作流 | device-operations.md |
| 多设备部署剧本 | orchestration-playbooks.md |
| 诊断和恢复 | troubleshooting.md |
要求
- - Shelly 设备在目标本地网络中可达,或拥有云端模式所需的云账户访问权限
- 对于云端操作:环境中需设置 SHELLYCLOUDTOKEN
- 对于可靠的自动化:需要稳定的设备 ID、组件 ID 和执行边界
切勿要求用户在聊天日志中粘贴生产环境机密。优先使用本地环境变量和经过脱敏处理的示例。
数据存储
将本地操作记录保存在 ~/shelly/ 中:
- - 网络和端点决策
- 设备组件映射和已验证的 RPC 方法
- 自动化策略、排序和回滚约束
- 事件特征和缓解措施
核心规则
1. 在执行操作前选择正确的控制平面
- - 在发出命令前,决定使用本地模式、云端辅助模式还是混合模式。
- 当控制平面不明确时,阻止执行,因为状态和命令结果会变得不一致。
2. 根据任务和规模解析传输通道
- - 使用本地 HTTP RPC 进行直接控制和确定性读取。
- 使用 WebSocket 通知进行近实时状态更新,在需要代理集成时使用 MQTT 进行事件管道传输。
3. 在写入前发现组件和功能
- - 在生成命令前读取设备状态和组件布局。
- 仅针对现有组件 ID 和支持的方法参数生成写入操作。
4. 使用写入前读取和写入后读取循环
- - 在每次写入前捕获基线状态。
- 执行后验证结果状态,并在状态不匹配时停止部署。
5. 对高影响操作强制执行明确的安全门控
- - 从只读检查和预演计划模式开始。
- 在继电器电源切换、加热控制、锁、警报或批量更新前,需要明确的确认。
6. 保持本地和云端视图一致
- - 如果本地 RPC 和云端响应不一致,则协调设备身份和状态。
- 当设备可达时,优先使用本地设备信息进行即时状态决策。
7. 将自动化设计为幂等且可观测
- - 使用确定性的运行 ID、有限的重试次数和硬停止条件。
- 记录每个执行步骤,并附带预期的状态检查,以避免重复或部分状态转换。
8. 维护安全和隐私边界
- - 使用最小权限凭证,仅访问已声明的端点。
- 从环境变量读取云令牌,切勿将原始机密写入本地记录。
常见陷阱
- - 在没有优先级规则的情况下混合使用本地和云端控制 -> 导致状态冲突和重复写入。
- 在未验证组件 ID 的情况下发送 RPC 方法 -> 导致调用被拒绝或目标行为错误。
- 将传输选择视为可互换 -> 在负载下导致延迟和可靠性不匹配。
- 在没有金丝雀检查的情况下进行批量执行 -> 当某个方法配置错误时,影响范围过大。
- 假设通知流意味着写入成功 -> 命令被接受但未达到期望的最终状态。
- 以明文形式存储云令牌 -> 导致不必要的凭证暴露。
外部端点
| 端点 | 发送的数据 | 目的 |
|---|
| http://<设备IP>/rpc | RPC 方法名称、参数和请求标识符 | 本地 Shelly 设备控制和状态检索 |
| ws://<设备IP>/rpc |
RPC 消息和事件订阅 | 本地 WebSocket 通知和事件流 |
| mqtt://<代理> | 设备状态和命令主题及有效载荷 | 基于 MQTT 的事件和自动化集成 |
| https://*.shelly.cloud | 账户范围的 API 请求、设备元数据和命令有效载荷 | Shelly 云端控制和远程设备操作 |
| https://shelly-api-docs.shelly.cloud | 文档查询 | 验证 Shelly API 行为和方法约束 |
不会向外部发送其他数据。
安全与隐私
离开您机器的数据:
- - 执行请求的 Shelly 操作所需的本地 RPC 或云端 API 有效载荷
- 用户配置的代理设置中可选的 MQTT 发布/订阅有效载荷
保留在本地数据:
- - ~/shelly/ 下的环境映射、设备功能记录和运行手册
- 事件时间线和回滚决策
此技能不会:
- - 使用未声明的第三方端点
- 请求绕过或规避技术
- 在本地技能文件中存储 SHELLYCLOUDTOKEN
- 在没有用户确认和验证策略的情况下执行批量写入
信任
此技能在执行获得批准时,会将操作数据发送到 Shelly 设备,并可选择发送到 Shelly 云服务。
仅当您信任您的网络环境、代理设置和 Shelly 账户范围能够处理此自动化数据时才安装。
相关技能
如果用户确认,使用 clawhub install
安装:
- - iot - 设备连接和物联网系统集成模式
- smart-home - 家庭自动化架构和可靠性实践
- api - API 合约设计和稳健的请求处理
- mqtt - 遥测和事件驱动编排的消息传递模式
- home-server - 自托管服务操作和网络可靠性工作流
反馈
- - 如果觉得有用:clawhub star shelly
- 保持更新:clawhub sync