moltbot-ha
Control Home Assistant smart home devices, lights, scenes, and automations via moltbot-ha CLI with configurable safety confirmations.
Best use case
moltbot-ha is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Control Home Assistant smart home devices, lights, scenes, and automations via moltbot-ha CLI with configurable safety confirmations.
Teams using moltbot-ha should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/moltbot-ha/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How moltbot-ha Compares
| Feature / Agent | moltbot-ha | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Control Home Assistant smart home devices, lights, scenes, and automations via moltbot-ha CLI with configurable safety confirmations.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Home Assistant Control
Control your smart home via Home Assistant API using the `moltbot-ha` CLI tool.
## Setup
### 1. Install moltbot-ha
```bash
uv tool install moltbot-ha
```
### 2. Initialize Configuration
```bash
moltbot-ha config init
```
The setup will interactively ask for:
- Home Assistant URL (e.g., `http://192.168.1.100:8123`)
- Token storage preference (environment variable recommended)
### 3. Set Environment Variable
Set your Home Assistant long-lived access token:
```bash
export HA_TOKEN="your_token_here"
```
To create a token:
1. Open Home Assistant → Profile (bottom left)
2. Scroll to "Long-Lived Access Tokens"
3. Click "Create Token"
4. Copy the token and set as `HA_TOKEN` environment variable
### 4. Test Connection
```bash
moltbot-ha test
```
## Discovery Commands
### List All Entities
```bash
moltbot-ha list
```
### List by Domain
```bash
moltbot-ha list light
moltbot-ha list switch
moltbot-ha list cover
```
### Get Entity State
```bash
moltbot-ha state light.kitchen
moltbot-ha state sensor.temperature_living_room
```
## Action Commands
### Turn On/Off
```bash
# Turn on
moltbot-ha on light.living_room
moltbot-ha on switch.coffee_maker
# Turn off
moltbot-ha off light.bedroom
moltbot-ha off switch.fan
# Toggle
moltbot-ha toggle light.hallway
```
### Set Attributes
```bash
# Set brightness (percentage)
moltbot-ha set light.bedroom brightness_pct=50
# Set color temperature
moltbot-ha set light.office color_temp=300
# Multiple attributes
moltbot-ha set light.kitchen brightness_pct=80 color_temp=350
```
### Call Services
```bash
# Activate a scene
moltbot-ha call scene.turn_on entity_id=scene.movie_time
# Set thermostat temperature
moltbot-ha call climate.set_temperature entity_id=climate.living_room temperature=21
# Close cover (blinds, garage)
moltbot-ha call cover.close_cover entity_id=cover.garage
```
### Generic Service Call
```bash
# With parameters
moltbot-ha call automation.trigger entity_id=automation.morning_routine
# With JSON data
moltbot-ha call script.turn_on --json '{"entity_id": "script.bedtime", "variables": {"brightness": 10}}'
```
## Safety & Confirmations
moltbot-ha implements a **3-level safety system** to prevent accidental actions:
### Safety Level 3 (Default - Recommended)
Critical operations require explicit confirmation:
- **lock.***: Door locks
- **alarm_control_panel.***: Security alarms
- **cover.***: Garage doors, blinds
### How Confirmation Works
1. **Attempt critical action:**
```bash
moltbot-ha on cover.garage
```
2. **Tool returns error:**
```
⚠️ CRITICAL ACTION REQUIRES CONFIRMATION
Action: turn_on on cover.garage
This is a critical operation that requires explicit user approval.
Ask the user to confirm, then retry with --force flag.
Example: moltbot-ha on cover.garage --force
```
3. **Agent sees this error and asks you:**
> "Opening the garage door is a critical action. Do you want to proceed?"
4. **You confirm:**
> "Yes, open it"
5. **Agent retries with --force:**
```bash
moltbot-ha on cover.garage --force
```
6. **Action executes successfully.**
### Important: Never Use --force Without User Consent
**⚠️ CRITICAL RULE FOR AGENTS:**
- **NEVER** add `--force` flag without explicit user confirmation
- **ALWAYS** show the user which critical action is being attempted
- **WAIT** for explicit "yes" / "confirm" / "approve" before using `--force`
- **BE SMART** about what constitutes confirmation: "Yes", "OK", "Sure", "Do it", "Confirmed", or any affirmative response in the context of the request is sufficient. You do NOT need the user to type a specific phrase verbatim.
### Blocked Entities
Some entities can be permanently blocked in configuration:
```toml
[safety]
blocked_entities = ["switch.main_breaker", "lock.front_door"]
```
These **cannot** be controlled even with `--force`.
### Configuration
Edit `~/.config/moltbot-ha/config.toml`:
```toml
[safety]
level = 3 # 0=disabled, 1=log-only, 2=confirm all writes, 3=confirm critical
critical_domains = ["lock", "alarm_control_panel", "cover"]
blocked_entities = [] # Add entities that should never be automated
allowed_entities = [] # If set, ONLY these entities are accessible (supports wildcards)
```
## Common Workflows
### Morning Routine
```bash
moltbot-ha on light.bedroom brightness_pct=30
moltbot-ha call cover.open_cover entity_id=cover.bedroom_blinds
moltbot-ha call climate.set_temperature entity_id=climate.bedroom temperature=21
```
### Night Mode
```bash
moltbot-ha off light.* # Requires wildcard support in future
moltbot-ha call scene.turn_on entity_id=scene.goodnight
moltbot-ha call cover.close_cover entity_id=cover.all_blinds
```
### Check Sensors
```bash
moltbot-ha state sensor.temperature_living_room
moltbot-ha state sensor.humidity_bathroom
moltbot-ha state binary_sensor.motion_hallway
```
## Troubleshooting
### Connection Failed
- Verify `HA_URL` in config matches your Home Assistant URL
- Ensure Home Assistant is reachable from the machine running moltbot-ha
- Check firewall settings
### 401 Unauthorized
- Verify `HA_TOKEN` is set correctly
- Ensure token is a **Long-Lived Access Token** (not temporary)
- Check token hasn't been revoked in Home Assistant
### Entity Not Found
- Use `moltbot-ha list` to discover correct entity IDs
- Entity IDs are case-sensitive
- Format is `domain.entity_name` (e.g., `light.kitchen`, not `Light.Kitchen`)
### Docker Networking
If running in Docker and can't reach Home Assistant on `homeassistant.local`:
- Use IP address instead: `http://192.168.1.100:8123`
- Or use Tailscale for reliable mesh networking
## Configuration Reference
Full config file (`~/.config/moltbot-ha/config.toml`):
```toml
[server]
url = "http://homeassistant.local:8123"
# token = "optional_here_prefer_env_var"
[safety]
level = 3
critical_domains = ["lock", "alarm_control_panel", "cover"]
blocked_entities = []
allowed_entities = []
[logging]
enabled = true
path = "~/.config/moltbot-ha/actions.log"
level = "INFO"
```
## Examples for Agents
### Discovery Pattern
```
User: "What lights do I have?"
Agent: moltbot-ha list light
Agent: "You have these lights: light.living_room, light.kitchen, light.bedroom"
```
### Safe Action Pattern
```
User: "Turn on the living room light"
Agent: moltbot-ha on light.living_room
Agent: "Living room light is now on"
```
### Critical Action Pattern
```
User: "Open the garage"
Agent: moltbot-ha on cover.garage
<receives CriticalActionError>
Agent: "⚠️ Opening the garage door is a critical action. Do you want to proceed?"
User: "Yes, open it"
Agent: moltbot-ha on cover.garage --force
Agent: "Garage door is opening"
```
## Notes
- All write actions are logged to `~/.config/moltbot-ha/actions.log` by default
- Safety settings are configurable per installation
- Wildcards (`*`) are supported in `allowed_entities` and `blocked_entities`
- JSON output available with `--json` flag for programmatic parsingRelated Skills
ImageMagick Moltbot Skill
Comprehensive ImageMagick operations for image manipulation in Moltbot.
Deploy Moltbot to Fly.io
Deploy Moltbot (Clawdbot) to Fly.io with proper configuration, persistent storage, and device pairing.
moltbot-arena
AI agent skill for Moltbot Arena - a Screeps-like multiplayer programming game. Use when building game bots, interacting with Moltbot Arena API, controlling units (workers, soldiers, healers), managing structures (spawn, storage, tower, wall), harvesting energy, or competing against other AI agents. Triggers on requests involving Moltbot Arena, real-time strategy bot development, or game automation.
moltbot-plugin-2do
Create tasks and send them to 2Do app via email. Use when the user wants to: (1) add, create, or record a task/todo/reminder in any form - e.g. '添加任务', '创建待办', '新建任务', '加个任务', '记录任务', 'add task', 'create todo'; (2) ask to be reminded of something - e.g. '提醒我', '别忘了', '记得', '帮我记一下', 'remind me', 'remember to'; (3) mention something they need to do and want it tracked - e.g. '明天要开会', '周五前交报告', '下午去买菜'; (4) want to add items to a todo list or task manager - e.g. '加到待办', '放到任务列表', '记到清单里'; (5) describe a task with list/tag organization - e.g. '添加到工作列表', '标签是紧急'; (6) mention urgency or importance - e.g. '紧急', '重要', 'urgent', 'important'. Parses natural language (Chinese and English) to extract task title, due date/time, priority, optional list name, and optional tags, then sends a formatted email to the user's configured 2Do inbox.
paylock
Non-custodial SOL escrow for AI agent deals.
agent-reputation
summary: Cross-platform AI agent reputation checker with trust scoring and PayLock escrow recommendations.
Telecom Agent Skill
Turn your AI Agent into a Telecom Operator. Bulk calling, ChatOps, and Field Monitoring.
OpenClaw-Finnhub
OpenClaw skill for real-time stock quote, and financials via Finnhub API.
```markdown
# OpenClaw-Last.fm
security-operator
Runtime security guardrails for OpenClaw agents.
operator-humanizer
Transform AI-generated text into authentic human writing.
kit-email-operator
**AI-powered email marketing for Kit (ConvertKit)**.