| name | openhab-config-manager |
| description | Manage OpenHAB home automation configurations via private repos. Clone, edit, deploy, and verify OpenHAB items, rules, and things. Use when modifying configs, deploying to remote OpenHAB servers via SSH, querying live state, or setting up automated management. Requires private repo URL, SSH host alias, server path, and REST API endpoint. |
| metadata | {"openclaw":{"requires":{"bins":["openhab-rest-cli"]},"install":[{"id":"node","kind":"node","package":"openhab-rest-cli","bins":["openhab-rest-cli"],"label":"Install openhab-rest-cli (npm)"}]}} |
OpenHAB Config Manager
Manage OpenHAB home automation configurations through a structured git workflow: edit local configs, deploy to a remote OpenHAB server via SSH, verify changes via REST API.
Setup (First Time)
- Copy the template:
cp openhab-config.json.template openhab-config.json
- Edit
openhab-config.json with your environment details (repo URL, SSH config, deployment script, OpenHAB REST API endpoint)
- Ensure the official OpenHAB reference repositories (
openhab-docs and openhab-js) are cloned in your workspace.
- See
references/setup-guide.md for detailed configuration instructions
The skill will:
- Read
openhab-config.json automatically
- Clone your repo locally
- Validate directory structure (items, rules, things, scripts)
- Test SSH connectivity and deployment readiness
Edit → Deploy → Verify
The usual workflow for managing the OpenHAB configuration is as follows:
1. Edit Config Files
Edit files following ./references/rules-standards.md inside the skill directory:
- Items (
conf/items/*.items) - Sensors, switches, lights
- Rules (
conf/rules/*.rules) - for RuleDSL formatted rules
- Rules (
conf/automation/js/*.js or .js) - for Javascript formatted rules. Unless specifically requested, always prefer Javascript rules
- Things (
conf/things/*.things) - Device bindings
- SiteMaps (
conf/sitemaps/*.sitemap) - Sitemaps
Important: Before making changes or writing new rules, always search the local openhab-docs and openhab-js repositories in your workspace for the latest syntax, API definitions, and setup information.
2. Get User Approval
Present a summary or diff of the changes to the user and wait for their explicit approval. Never refresh the OpenHAB server config without the users approval first.
3. Commit and Deploy Changes
Once the user approves:
- Git commit the changes locally with a descriptive message.
- Run deployment (executes
deploy.sh to push and trigger the remote server refresh):
cd <repo_path>
git add -A
git commit -m "Descriptive commit message"
./scripts/deploy.sh
3. Verify State
The deploy script will tail the OpenHAB logs for a short period by running the refresh-openhab-config.sh script on the remote. Parse the logs content looking for evidence the change has been a success or failure. Inform the user of your findings.
Secondly, if needed, query OpenHAB items via openhab-rest-cli to confirm changes took effect:
openhab-rest-cli --url http://localhost:8080 items state Kitchen_Light
openhab-rest-cli --url http://localhost:8080 rules list
See references/openhab-rest-api.md for all CLI commands.
Bundled Resources
scripts/deploy.sh - Execute the complete local-to-remote deployment workflow
scripts/load-config.sh - Load OpenHAB URL, token, SSH details, and repo paths from openhab-config.json
scripts/validate-repo.sh - Validate repo structure on setup
references/workflow.md - Detailed edit → deploy → verify guide
references/openhab-rest-api.md - REST API query cheat sheet
references/ssh-setup.md - SSH configuration and remote execution patterns
Typical Usage
Agent receives request: "Add a new kitchen motion sensor rule"
1. Clone repo (if not already done)
2. Edit: conf/rules/kitchen_automation.js
3. Follow `./references/rules-standards.md` for syntax
4. Run: ./scripts/deploy.sh "Add kitchen motion sensor rule"
5. Verify: Query /rest/items/{itemName} to confirm state change
6. Report: "Deployment complete. Kitchen motion rule active."
Error Handling
If deployment fails:
- SSH connection error: Check
~/.ssh/config, key permissions, server availability
- deploy.sh not found: Validate repo structure with
scripts/validate-repo.sh
- Syntax errors: Check server logs:
ssh host tail -f /var/log/openhab/openhab.log | grep -i error
For Users Sharing This Skill
This skill is designed for reuse across multiple homeowners/teams. Each user:
- Maintains their own private OpenHAB config repository
- Configures SSH access in their
~/.ssh/config
- Provides their specific repo URL + server details when spawning agents with this skill
The skill workflow remains identical; only the repository and server details change.