Sonoff for Openclaw

A comprehensive tool for managing SONOFF and eWeLink devices across cloud, LAN, and DIY modes with built-in safety gates.

ivangdavila
v1.0.0
Mar 6, 2026
0
774
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install sonoff

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install sonoff using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Sonoff?

The Sonoff skill enables developers to integrate and automate SONOFF hardware within the ecosystem of Openclaw Skills. It supports multiple control planes, including eWeLink cloud APIs, local LAN control, and DIY mode RPC-like calls. By utilizing this skill, you can ensure safe, multi-device execution through structured memory management and validated recovery playbooks, making it an essential addition to your collection of Openclaw Skills.

This skill is designed for precision and reliability, moving beyond generic smart-home advice by focusing on SONOFF-specific protocols. It manages local environments and device registries to provide a robust interface for both simple power toggles and complex, staged automation logic.

Sonoff Use Cases

  • Automating SONOFF device state transitions via eWeLink cloud APIs.
  • Executing local LAN control commands for low-latency device interaction.
  • Implementing DIY mode workflows for devices supporting REST API protocols.
  • Managing complex, staged multi-device automation rollouts with explicit safety checks.
  • Troubleshooting device connectivity and firmware-specific capability mismatches using local incident logs.

How Sonoff Works

  1. The skill identifies the optimal control plane (Cloud, LAN, DIY, or iHost) based on the target device and environment settings.
  2. It validates device capabilities and firmware eligibility before generating any command payloads to prevent invalid requests.
  3. A discovery phase captures current device state and metadata to ensure high-fidelity interaction.
  4. The skill performs a mandatory read-before-write check to establish a reliable baseline state.
  5. Command execution is followed by a read-after-write verification loop to confirm the desired state was reached.
  6. All operations, configurations, and incident signatures are logged locally in the ~/sonoff/ directory for audit and recovery.

Sonoff Setup

To begin using this entry in the Openclaw Skills library, ensure you have the necessary system dependencies and environment variables configured.

# Ensure curl and jq are available on your system
sudo apt install curl jq

# Set your eWeLink API token for cloud operations
export EWELINK_API_TOKEN="your_token_here"

Before first use, review the setup.md file within the skill directory to align activation boundaries and configure write-safety defaults.

Sonoff Data Schema & Taxonomy

The skill maintains a structured local workspace within ~/sonoff/ to track device state and history. This organization is a core feature of high-quality Openclaw Skills.

File Description
memory.md Core context, activation boundaries, and current workspace status.
environments.md Mapping of LAN segments, iHost endpoints, and cloud mode settings.
devices.md A registry of discovered devices, their specific capabilities, and command patterns.
automations.md Defined orchestration rules, scheduling logic, and rollback plans.
incidents.md Documentation of failure signatures and validated recovery steps.

Sonoff Advanced Features

  • Multi-mode support for Cloud, LAN, DIY, and iHost local API integration.
  • Explicit safety gates for high-impact actions like power relays, heating circuits, or security locks.
  • Idempotent automation design using deterministic run IDs and bounded retry logic.
  • Automatic state reconciliation between cloud and LAN views to prevent conflicting state transitions.
  • Seamless integration with other Openclaw Skills like iot and mqtt for comprehensive home server orchestration.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*