mirror of
https://github.com/techartdev/OpenClawHomeAssistant.git
synced 2026-08-14 08:52:15 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71734b49f0 | ||
|
|
197a1692f5 | ||
|
|
d2251fb4d8 | ||
|
|
2dec26b243 |
@@ -53,6 +53,41 @@ See `openclaw_assistant/config.yaml` for the authoritative schema.
|
||||
- `homeassistant_token` (optional) — written to `/config/secrets/homeassistant.token` for local scripts.
|
||||
- `router_ssh_*` (optional) — SSH settings for a router/network device (custom automation).
|
||||
|
||||
## Features
|
||||
|
||||
### Browser Automation (Chromium)
|
||||
|
||||
This add-on includes **Chromium** for website automation tasks. OpenClaw can use it for browser-based skills and automation.
|
||||
|
||||
#### Configuration
|
||||
|
||||
OpenClaw's browser tool uses its own control service/protocol. Configure it in one of two ways:
|
||||
|
||||
**Option 1: Via `openclaw.json`**
|
||||
|
||||
Add to `/config/.openclaw/openclaw.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"browser": {
|
||||
"enabled": true,
|
||||
"headless": true,
|
||||
"noSandbox": true,
|
||||
"cdpUrl": "http://127.0.0.1:9222"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Option 2: Via Gateway Flags**
|
||||
|
||||
Start OpenClaw gateway with browser flags:
|
||||
|
||||
```bash
|
||||
openclaw gateway --browser-headless --browser-no-sandbox
|
||||
```
|
||||
|
||||
**Note:** The `noSandbox` flag is required in Docker containers due to security restrictions.
|
||||
|
||||
## Docs
|
||||
|
||||
See **DOCS.md** for a step-by-step first-time setup guide + troubleshooting.
|
||||
|
||||
@@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
nginx \
|
||||
gnupg \
|
||||
build-essential \
|
||||
sudo \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -40,9 +41,47 @@ RUN ARCH=$(echo ${TARGETARCH:-$(dpkg --print-architecture)} | sed 's|arm64|aarch
|
||||
|
||||
RUN node -v && npm -v
|
||||
|
||||
# Install Chromium for website automation tasks
|
||||
# Includes necessary dependencies for headless browser operation
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
chromium \
|
||||
chromium-driver \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Homebrew (Linuxbrew) for OpenClaw skill dependencies
|
||||
# Homebrew is required for installing CLI tools like gemini, aider, etc.
|
||||
ENV HOMEBREW_NO_AUTO_UPDATE=1 \
|
||||
HOMEBREW_NO_INSTALL_CLEANUP=1 \
|
||||
HOMEBREW_NO_ANALYTICS=1
|
||||
|
||||
RUN useradd -m -s /bin/bash linuxbrew \
|
||||
&& mkdir -p /home/linuxbrew/.linuxbrew \
|
||||
&& chown -R linuxbrew:linuxbrew /home/linuxbrew
|
||||
|
||||
USER linuxbrew
|
||||
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" \
|
||||
&& cd /home/linuxbrew/.linuxbrew/Homebrew \
|
||||
&& git config --global --add safe.directory /home/linuxbrew/.linuxbrew/Homebrew \
|
||||
&& /home/linuxbrew/.linuxbrew/bin/brew update --force
|
||||
USER root
|
||||
|
||||
# Add Homebrew to PATH for all users (wrapper comes first to intercept root calls)
|
||||
ENV PATH="/usr/local/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
|
||||
|
||||
# Copy brew wrapper that allows root to run brew by delegating to linuxbrew user
|
||||
COPY brew-wrapper.sh /usr/local/bin/brew
|
||||
RUN chmod +x /usr/local/bin/brew
|
||||
|
||||
# Verify brew is available and install gcc (needed for compiling some brew packages)
|
||||
# Must run as linuxbrew user - Homebrew refuses to run as root
|
||||
USER linuxbrew
|
||||
RUN /home/linuxbrew/.linuxbrew/bin/brew --version && /home/linuxbrew/.linuxbrew/bin/brew install gcc
|
||||
USER root
|
||||
|
||||
# Install OpenClaw globally
|
||||
RUN npm config set fund false && npm config set audit false \
|
||||
&& npm install -g openclaw@2026.1.30
|
||||
&& npm install -g openclaw@2026.2.1
|
||||
|
||||
COPY run.sh /run.sh
|
||||
COPY oc_config_helper.py /oc_config_helper.py
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# Wrapper script for brew that runs as linuxbrew user when called by root
|
||||
# This is needed because Homebrew refuses to run as root
|
||||
|
||||
REAL_BREW="/home/linuxbrew/.linuxbrew/bin/brew"
|
||||
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
# Running as root - use sudo to run as linuxbrew user
|
||||
# Preserve necessary environment variables and properly pass all arguments
|
||||
exec sudo -u linuxbrew \
|
||||
HOMEBREW_NO_AUTO_UPDATE="${HOMEBREW_NO_AUTO_UPDATE:-1}" \
|
||||
HOMEBREW_NO_ANALYTICS="${HOMEBREW_NO_ANALYTICS:-1}" \
|
||||
HOME="/home/linuxbrew" \
|
||||
PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH" \
|
||||
"$REAL_BREW" "$@"
|
||||
else
|
||||
# Not root - run directly
|
||||
exec "$REAL_BREW" "$@"
|
||||
fi
|
||||
@@ -1,5 +1,5 @@
|
||||
name: OpenClaw Assistant
|
||||
version: "0.5.28"
|
||||
version: "0.5.31"
|
||||
slug: openclaw_assistant
|
||||
description: Run OpenClaw Assistant (OpenClaw-compatible) as a Home Assistant add-on.
|
||||
url: https://github.com/techartdev/OpenClawHomeAssistant
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Ensure Homebrew and brew-installed binaries are in PATH
|
||||
# This is needed for OpenClaw skills that depend on CLI tools (gemini, aider, etc.)
|
||||
export PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
|
||||
|
||||
# Home Assistant add-on options are usually rendered to /data/options.json
|
||||
OPTIONS_FILE="/data/options.json"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user