I Gave My Smart Home a Brain: OpenClaw AI Agent on Raspberry Pi 5 + Home Assistant (2026)

๐Ÿฆž Field-tested guide · March 2026

I Gave My Smart Home a Brain: OpenClaw AI Agent on Raspberry Pi 5 + Home Assistant (2026)

A complete, honest guide to setting up an always-on AI agent alongside HAOS — with every gotcha we hit along the way documented.

๐Ÿฅง Raspberry Pi 5 ๐Ÿ  Home Assistant OS ๐Ÿค– Claude Sonnet 4.6 ✈️ Telegram
Audience: ๐ŸŸข Beginner Anyone can follow ๐ŸŸก Intermediate Basic Linux helpful ๐ŸŸฃ Advanced Docker/HA internals useful ⚠️ Security Pay close attention

Before You Begin

๐Ÿ“‹
Everything you need to prepare before touching Home Assistant. Getting these ready first means the actual install takes under 20 minutes. ๐ŸŸข Beginner

Why Can't I Just Install OpenClaw Directly on the Pi?

Home Assistant OS (HAOS) is a locked-down, read-only operating system. Unlike regular Linux, you can't run apt install, npm, or any standard tooling directly on the host. The solution is to install OpenClaw as a HAOS Add-on — a Docker container managed by the Home Assistant Supervisor.

๐Ÿšซ
What HAOS blocks

Direct npm/apt installs, systemd services, writing to most of the filesystem, and running arbitrary processes on the host OS.

What we do instead

Install OpenClaw as a HAOS Add-on — a Docker container that starts on boot, auto-restarts, and shows logs in the HA UI.

โ„น️
HA 2026.2+: Add-ons are now called "Apps"

The 2026.2 update renamed Add-ons → Apps and moved them out of Settings into their own sidebar. Any older tutorial will have wrong navigation paths.

What You'll Need

ItemDetailsWhere
Raspberry Pi 54GB or 8GB recommendedYour hardware
Home Assistant OS2026.2 or laterAlready installed
Anthropic API KeyFor Claude Sonnet — see belowconsole.anthropic.com
Telegram Bot TokenCreated via @BotFather — see belowTelegram app
Your Telegram User IDTo lock the bot to only youMessage @userinfobot
SSH Add-on"Advanced SSH & Terminal" in HAHA App Store
Step A — Anthropic API Key
1
Go to console.anthropic.com ๐ŸŸข Beginner

Sign up or log in and add a payment method. Claude Sonnet 4.6 costs roughly $3 per million input tokens — expect $2–10/month for a personal home assistant.

2
Create an API Key ⚠️ Security

Go to API Keys → Create Key. Name it openclaw-pi. Copy it immediately — it's only shown once.

๐Ÿ”ด
Never share your API key

Your Anthropic key gives billing access. Never paste it into forums, commit it to git, or share it publicly. Revoke it immediately if accidentally exposed.

3
Set a spending limit

In the Console go to Settings → Limits and set a monthly cap — $20 is plenty for personal use.

Step B — Telegram Bot Setup
1
Find @BotFather on Telegram ๐ŸŸข Beginner

Search for @BotFather (blue verified tick) and start a conversation.

2
Create your bot
Telegram → @BotFather
/newbot
# BotFather asks for a display name:
My Home Assistant Bot
# Then a username (must end in 'bot'):
myhome_claw_bot

BotFather replies with your Bot Token — e.g. 8553574581:AAGgFKBc.... Save it securely.

3
Get your Telegram User ID

Message @userinfobot on Telegram. It instantly replies with your numeric ID (e.g. 7699395479). Save this — you'll use it to lock the bot to only you.

4
Optional: Set a bot profile photo

In BotFather send /setuserpic and upload a photo. Makes it easy to find in your chat list. A lobster ๐Ÿฆž works well.

Installation

๐Ÿฆž
The actual install takes about 15 minutes once prerequisites are ready. No Docker knowledge required — we use an existing community-built HAOS add-on. ๐ŸŸข Beginner
Phase 1 — Add the Repository
1
Open the App Store in Home Assistant

In the left sidebar click AppsApp Store. If you see "Add-ons" instead of "Apps" you're on an older HA version — the path is the same.

2
Add the OpenClaw repository

Click the ⋮ menu (top right) → Repositories → paste this URL and click Add:

Repository URL
https://github.com/techartdev/OpenClawHomeAssistant

Scroll down in the App Store — OpenClaw Assistant should now appear.

3
Install the add-on

Click OpenClaw Assistant → Install. This pulls the Docker image — 3–5 minutes on first run.

Phase 2 — Configure & Start
4
Set the configuration
Configuration tab
enable_terminal: true
timezone: "Asia/Riyadh"   # change to your timezone
gateway_public_url: ""
homeassistant_token: ""
5
Enable auto-start and watchdog

On the Info tab enable Start on boot and Watchdog, then click Start.

Phase 3 — Onboarding Wizard
6
Open the web terminal

Click Open Web UI on the add-on page — an embedded terminal opens inside Home Assistant.

7
Run the onboarding wizard
terminal
root@openclaw:/# openclaw onboard

When the wizard asks, make these choices:

  • Access mode — set to lan_https (switch to YAML view in the Configuration tab to edit this field — the visual editor does not expose it)
  • AI provider — Anthropic → paste your API key
  • Model — claude-sonnet-4-6
  • Channel — Telegram → paste your Bot Token
  • Skills prompt — skip for now (we install manually in Tab 4)
  • Hatch mode — Hatch in TUI (recommended)
⚠️
Change access_mode to lan_https — requires YAML view

The default is "custom" which breaks local network access. This field is not exposed in the visual editor — you must switch to YAML view (toggle in the top-right of the Configuration tab), then manually set access_mode: lan_https. Without this your gateway UI will be unreachable on the local network.

8
Complete the bootstrap conversation

After onboarding, OpenClaw launches its TUI and greets you — both in the terminal and on Telegram simultaneously:

openclaw tui — agent main — claude-sonnet-4-6
 Wake up, my friend!

 Hey. I just came online — fresh start, blank slate.
 I see a BOOTSTRAP.md waiting for me. So... who am I?
 Who are you? Let's figure that out together. ๐Ÿ˜„

 connected | idle | tokens 8.6k/200k (4%)
          

Introduce yourself and give the agent a name and personality. This shapes how it behaves in every future session.

๐Ÿ”ด
Restart via HA UI — not systemctl

Inside the HAOS container, systemctl doesn't work. Always restart OpenClaw via Apps → OpenClaw Assistant → Restart in the HA UI. Running openclaw gateway restart will fail.

Security & Configuration

๐Ÿ”’
An unsecured always-on bot is a liability. These steps take 10 minutes and should not be skipped. ⚠️ Security ๐ŸŸก Intermediate

Run the Doctor First

Always run this after installation — it surfaces every misconfiguration in one pass.

terminal
root@openclaw:/# openclaw doctor
Fix 1 — Telegram Security (Critical)

By default OpenClaw responds to anyone who messages your bot. Lock it down immediately:

terminal
root@openclaw:/# openclaw config set channels.telegram.dmPolicy pairing
root@openclaw:/# openclaw config set channels.telegram.allowFrom '["YOUR_TELEGRAM_ID"]'
                  # Replace with your numeric ID from @userinfobot
root@openclaw:/# openclaw config set channels.telegram.groupPolicy open

Verify it took:

terminal
root@openclaw:/# openclaw config get channels.telegram
{
  "dmPolicy": "pairing",
  "allowFrom": ["YOUR_ID_HERE"],
  "groupPolicy": "open",
  "streaming": "partial"
}
Fix 2 — File Permissions
terminal
root@openclaw:/# chmod 700 /config/.openclaw
root@openclaw:/# mkdir -p /config/.openclaw/credentials
Fix 3 — Pi Performance Optimisation

Reduces startup time and CPU overhead on the Pi 5. Will take effect after the next add-on restart.

terminal
root@openclaw:/# mkdir -p /var/tmp/openclaw-compile-cache
root@openclaw:/# cat >> /etc/environment << 'EOF'
NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
OPENCLAW_NO_RESPAWN=1
EOF
Fix 4 — Disable Memory Search & Reduce Log Writes

Memory search requires an additional embedding API key (OpenAI, Gemini etc). If you're Anthropic-only, disable it. Reducing log level also extends SD card life on 24/7 operation.

terminal
root@openclaw:/# openclaw config set agents.defaults.memorySearch.enabled false
root@openclaw:/# openclaw config set gateway.logLevel warn
๐Ÿ’ก
Every config change is auto-backed up

OpenClaw writes a openclaw.json.bak before every change. If you break something, your previous config is always one file away.

The SD Card Warning
๐Ÿ—‚️
Running on SD card — known risk

OpenClaw's state directory lands on the SD card by default. 24/7 write churn will wear it out faster than normal use. Recommendation: attach a USB SSD (~$20) within the first month of always-on operation and set OPENCLAW_STATE_DIR to point to it.

๐Ÿ”ด
openclaw.json contains tokens in plain text

The file at /config/.openclaw/openclaw.json contains your Telegram bot token and gateway auth token. Never share this file, paste it in forums, or commit it to a public git repo. If exposed: revoke the Telegram token via @BotFather → /mybots → Revoke, and regenerate the gateway token with openclaw config set gateway.auth.token $(openssl rand -hex 24).

Skills & Tips

๐Ÿงฉ
Skills turn OpenClaw from a chatbot into an actual agent. Here's how to install the essential ones and the pro tips we discovered along the way. ๐ŸŸก Intermediate
⚠️
openclaw skills install does NOT exist

The openclaw skills command only lists and inspects. The actual installer is npx clawhub — a separate package manager. This trips up almost everyone.

Installing Essential Skills
1
Locate the workspace directory
terminal
root@openclaw:/# ls /config/clawd/
AGENTS.md  BOOTSTRAP.md  HEARTBEAT.md  IDENTITY.md  SOUL.md  TOOLS.md  USER.md

The workspace is at /config/clawd/ — this is also where the agent's identity files live.

2
Install the memory skill
terminal
root@openclaw:/# npx clawhub --workdir /config/clawd install memory
⚠️  Warning: flagged as suspicious by VirusTotal Code Insight.
◆  Install anyway? Yes
๐Ÿ’ก
The VirusTotal warning is expected

The memory skill needs filesystem access to read/write memory files — this triggers the scanner. It's a false positive for official skills. The warning means clawhub's security scanning is working correctly.

3
Search and install safe-exec

The exec skill is called safe-exec on the registry — not exec. Always inspect before installing:

terminal
root@openclaw:/# npx clawhub inspect safe-exec
safe-exec — Safe command execution with danger pattern detection,
risk assessment, user approval workflow, and audit logging.
root@openclaw:/# npx clawhub --workdir /config/clawd install safe-exec
4
Verify both installed
terminal
root@openclaw:/# npx clawhub --workdir /config/clawd list
memory    1.0.2
safe-exec 0.3.4
Pro Tip — Pre-fill Identity Files

The /config/clawd/ directory contains your agent's brain as plain Markdown. Edit them directly to give Claw a permanent identity that survives reinstalls:

๐Ÿ‘ค
USER.md

Who you are — name, timezone, preferences. The agent reads this every session.

๐Ÿฆž
IDENTITY.md

Who the agent is — name, personality, vibe. Fill before the bootstrap conversation.

๐Ÿ’€
SOUL.md

Deep values and long-term behavioral principles.

๐Ÿ”ง
TOOLS.md

Instructions for how the agent should use its available tools.

terminal — pre-fill USER.md
root@openclaw:/# cat > /config/clawd/USER.md << 'EOF'
# USER.md
- **Name:** Your Name
- **Timezone:** Your timezone
- **Notes:** Pi 5 + Home Assistant OS
EOF
Useful Commands Reference
CommandWhat it does
openclaw doctorFull health check — run this first when anything feels wrong
openclaw skills listSee all skills and their ready/missing status
openclaw config get channels.telegramView current Telegram config
openclaw statusQuick channel health and session overview
openclaw logsTail live gateway logs
npx clawhub search <query>Search the skill registry
npx clawhub inspect <slug>Preview a skill before installing
npx clawhub --workdir /config/clawd listList installed workspace skills
openclaw updateUpdate OpenClaw via npm

Lessons Learned & Gotchas

๐Ÿ““
Everything we hit during this actual install — captured in real time. ๐Ÿ”ต All Levels

HAOS & Architecture

Lesson 01

HA 2026.2 renamed Add-ons to "Apps". The sidebar item is now "Apps" and the store is "App Store". Every tutorial written before Feb 2026 has wrong navigation paths.

Lesson 02

systemctl doesn't work inside the add-on container. openclaw gateway restart fails with a confusing systemd error. Always restart via the HA Apps UI.

Lesson 03

/etc/environment changes don't apply until the add-on restarts. openclaw doctor keeps showing the NODE_COMPILE_CACHE warning until after a container restart. This is expected.

Onboarding Wizard

Lesson 04

access_mode defaults to "custom" — change it to "lan_https" via YAML view. The visual editor in the Configuration tab does not expose this field. You must switch to YAML view (top-right toggle) and manually set access_mode: lan_https. If your gateway UI is unreachable after setup, this is almost certainly why.

Lesson 05

Saying "No" to skills during onboarding leaves the agent read-only. Without memory and safe-exec, the agent can't save anything to disk. The bootstrap conversation you have on first boot will be forgotten on restart.

Lesson 06

The agent tells you what it can't do — listen to it. When Claw says "I don't have file-write access", it's telling you exactly which skill to install next. This self-awareness is a feature.

Skills & CLI

Lesson 07

openclaw skill install doesn't exist. The correct command is openclaw skills (plural, list only). The actual installer is npx clawhub --workdir /config/clawd install <slug>.

Lesson 08

The exec skill is called "safe-exec" on clawhub, not "exec". Always use npx clawhub inspect <slug> before installing any community skill.

Lesson 09

The VirusTotal warning on the memory skill is a false positive. File system access triggers the scanner. Expected for any skill that touches the filesystem.

Security

Lesson 10

Telegram groupPolicy "allowlist" with empty allowFrom silently drops all messages. There's no error — messages just disappear. Set groupPolicy to "open" unless you specifically need group allowlisting.

Lesson 11

openclaw.json stores your bot token in plain text. Never paste it publicly or commit to git. The openclaw config get command safely redacts it, but the raw file does not.

Lesson 12

Every openclaw config set auto-backs up first. A openclaw.json.bak is created before every change. If you break something, your previous config is always one file away.

Hardware

Lesson 13

The SD card warning is real but not urgent. Plan to move to a USB SSD within the first month of always-on operation. The Pi 5's faster SD interface helps, but 24/7 log churn will eventually wear any SD card.

Final State — Clean Doctor Output

After completing all steps, openclaw doctor should show:

  • Telegram: ok — bot name confirmed and responding
  • No channel security warnings detected
  • Memory search: explicitly disabled
  • Skills eligible: 6 (memory + safe-exec + 4 built-ins)
  • Your Telegram session active in session store
  • Plugins: 5 loaded, 0 errors
๐Ÿฆž
You're done — Claw is live!

OpenClaw is running 24/7 on your Pi 5, secured, with persistent memory, safe shell execution, and Telegram integration. The skill registry at clawhub.com has 50+ skills to extend it further.

Comments

Popular posts from this blog

Local Deepseek r1 on Web UI : Open Source

Meaning of Summa Ameen

Home Assistant Setting Up Voice Timer