benny-lewis/home-assistant-assistant/ha-deploy

Claude Code and agent skill by benny-lewis/home-assistant-assistant

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"},{"type":"plugin","description":"Custom plugin integration"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when the user says "deploy", "push changes", "send to HA", "sync to Home Assistant", "rollback", "revert", or otherwise asks to apply or undo local YAML edits on the live HA instance. Commits to git, pushes, and reloads HA; requires explicit confirmation at each side-effectful step.

Install

npx vskill@latest install benny-lewis/home-assistant-assistant/ha-deploy

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Deploy & Rollback Home Assistant Configuration

CRITICAL: This skill has side effects (git commit, git push, HA service calls).
- NEVER invoke this skill unless the user explicitly asks to deploy, push, or rollback
- ALWAYS show a summary of changes and get explicit user confirmation before each destructive step
- Use AskUserQuestion to get confirmation at commit, push, and reload steps
Safety Invariant #5: Never deploy unless explicitly requested.

Push local configuration changes to the git repository, triggering Home Assistant to pull and reload. Also handles rollback to previous states.

Prerequisites

  • Git repository configured (via /ha-onboard)
  • Changes to commit (for deploy)
  • Git Pull add-on running on Home Assistant

Deploy Workflow

Step 1: Check for Changes
bash
git status --short

If no changes:

  • Inform user there's nothing to deploy
  • Ask if they want to pull latest from remote instead
Step 2: Pre-Deploy Validation

Always validate before deploying. Delegate to ha-validate skill or ha-config-validator agent.

If validation fails, show errors and offer: a) Fix issues (describe what to change) b) Go back to editing c) Abort deploy

Validation failures are blocking. Do NOT offer a skip/bypass path.

Step 2.5: Verify HA Can Pull

Check if deploy.pull_method is cached in .claude/settings.local.json. If cached, use that method and skip this step.

If not cached, check if Git Pull add-on is available:

bash
MSYS_NO_PATHCONV=1 hass-cli raw get /api/hassio/addons 2>/dev/null | grep -i "git"
  • If found → proceed with auto-pull workflow, cache "deploy": { "pull_method": "git_pull_addon" } in settings.
  • If not found or API unavailable → ask user:

"How does your HA instance get config updates?"

  1. Git Pull add-on — offer to help set it up
  2. SSH access — use ssh <host> 'cd /config && git pull'
  3. Manual — provide instructions to pull on HA side

Cache the answer in .claude/settings.local.json under deploy.pull_method so we don't ask every time.

Step 3: Review Changes — MANDATORY CONFIRMATION

Show the user what will be deployed:

bash
git diff --staged
git diff
git diff --stat

For each changed file, show a brief summary of what changed.

Then use AskUserQuestion with options:

  • "Deploy" — proceed with commit + push + reload
  • "Edit commit message" — let user customize the message
  • "Abort" — cancel deployment

Do NOT proceed without explicit user selection.

Step 4: Commit Changes

Ask user for commit message or generate one based on changes:

  • "Update automation: motion lights"
  • "Add new scene: movie night"
  • "Fix template sensor: average temperature"
bash
git add <changed_files>
git commit -m "<message>"
Step 5: Push to Remote

Resolve push target from .claude/settings.local.json:

  • deploy.git_remote (preferred) -> ha.git_remote (legacy fallback) -> origin
  • deploy.git_branch (preferred) -> ha.git_branch (legacy fallback) -> main

Show the chosen push target before pushing: Using push target: <remote> <branch>

bash
git push <remote> <branch>

Handle push failures:

  • Fetch and merge if behind remote
  • "Push failed. Options:

a) Continue anyway (reload HA with local changes only) b) Retry push c) Abort deployment"

Git Pull Timing
Important: automation.reload only applies config that HA already has on disk.
If deploy.pull_method is git_pull_addon, HA's config won't update until the add-on
polls (default: every 5 minutes). Do NOT loop/retry reload — it will not help.
Instead: tell the user the push succeeded, mention they can restart the Git Pull add-on
from the HA UI (Settings → Add-ons → Git Pull → Restart) for immediate effect,
and proceed to reload once. Mark verification as "Pending — awaiting HA pull"
if entity state still shows old values.
Step 6: Reload Home Assistant

If hass-cli is configured, offer to trigger a reload:

bash
hass-cli service call automation.reload
hass-cli service call script.reload
hass-cli service call scene.reload

Or for full config reload:

bash
hass-cli service call homeassistant.reload_core_config
Step 7: Verify Deployment (Resolver-Driven)

Do NOT assume entity ID format. Verify entity actually exists:

bash
# Find the automation by alias/ID pattern
hass-cli state list | grep -i "automation.*<name_pattern>"

If found:

bash
hass-cli state get automation.<actual_id>

Report verification result with evidence:

| Check | Result | Evidence |
|-------|--------|----------|
| Git commit | commit abc123 |
| Git push | <remote>/<branch> updated |
| Automation reload | Service call succeeded |
| Entity exists | Found: automation.kitchen_motion_light |
| Entity enabled | state: on |
If the Git Pull add-on hasn't synced yet, verification will show stale data.
This is expected. Mark as "Pending — awaiting HA pull" rather than retrying.
Step 8: Confirm Success

"Deployed successfully.

Created: automation.kitchen_motion_light Status: Enabled Commit: abc123

Test it by triggering the automation, or run /ha-validate to verify."

Deploy Output Format

Deployment Summary
Changes deployed:
automations.yaml (+15, -3)
packages/climate.yaml (+8, -0)
Commit: abc1234 "Add motion-triggered lighting automation"
Pushed to: <remote>/<branch>
Home Assistant will pull changes within 5 minutes.
To force immediate reload, the Git Pull add-on can be restarted.
Deployment complete!

Flags

  • --dry-run - Show what would be deployed without committing
  • --rollback - Enter rollback mode (see below)

Validation bypass is intentionally disabled. Deploy cannot proceed if validation fails.

Auto-Deploy Mode (Deprecated)

Per Safety Invariant #5, all deployments require explicit confirmation. The auto_deploy setting is ignored.

If user has auto_deploy: true in settings, warn: "Note: auto_deploy is deprecated for safety reasons. All deployments now require explicit confirmation. Would you like me to remove this setting?"

Configuration

Read settings from .claude/settings.local.json:

  • commit_prefix: string (optional, e.g., "ha: ")
  • deploy.pull_method: string (e.g., "git_pull_addon" | "ssh" | "manual")
  • deploy.git_remote: string (optional, preferred push remote)
  • deploy.git_branch: string (optional, preferred push branch)
  • ha.git_remote: string (optional, legacy fallback push remote)
  • ha.git_branch: string (optional, legacy fallback push branch)

Push target resolution order:

  1. deploy.git_remote / deploy.git_branch
  2. ha.git_remote / ha.git_branch
  3. origin / main

Rollback Workflow

Default mode is dry-run (preview only).
User must explicitly confirm to execute the actual rollback.

Revert to a previous configuration state.

Step 1: Check for Uncommitted Changes
bash
git status

If changes exist, ask: "You have uncommitted changes:

  • modified: automations.yaml
  • modified: scripts.yaml

Options: a) Stash changes and continue (can restore later) b) Commit current changes first c) Cancel rollback"

Step 2: Show Recent Commits
bash
git log --oneline -10 --format="%h %ar - %s"

Display formatted list:

Recent changes:
1. abc123 (2 hours ago) - Add motion lights for kitchen
2. def456 (yesterday) - Update bedroom scene
3. ghi789 (2 days ago) - Add garage door automation
...
Which commit do you want to roll back to?
(Or type 'more' to see older history)
Step 3: Preview (Dry-Run)

ALWAYS preview before executing.

bash
# Show what files would change
git diff HEAD~<n>..HEAD --stat
# Show detailed changes
git diff HEAD~<n>..HEAD

Display preview:

## Rollback Preview (DRY RUN)
**Target:** Roll back to commit ghi789 (2 days ago)
**Changes that would be reverted:**
- automations.yaml: Remove 2 automations added in abc123, def456
- scripts.yaml: Restore previous version
**Commits to revert:**
- abc123: Add motion lights for kitchen
- def456: Update bedroom scene
**This is a preview. No changes have been made yet.**
Step 4: Confirm Execution

"Ready to execute rollback.

What will happen:

  1. Revert changes from commits abc123, def456
  2. Create new commit documenting the rollback
  3. Push to remote (if configured)
  4. Reload automations/scripts/scenes in HA

This action modifies git history and HA configuration.

Execute rollback? [Yes / Show full diff / Cancel]"

Step 5: Execute Rollback (Only After Explicit Confirmation)
bash
git revert --no-commit HEAD~<n>..HEAD
git commit -m "Rollback: Revert abc123..def456 (user-requested)"
git push <remote> <branch>
Step 6: Reload Home Assistant
bash
hass-cli service call automation.reload
hass-cli service call script.reload
hass-cli service call scene.reload
Step 7: Confirm with Evidence
## Rollback Complete
| Step | Result |
|------|--------|
| Git revert | Commits abc123..def456 reverted |
| Git commit | Created xyz789 |
| Git push | <remote>/<branch> updated |
| HA reload | Automations/scripts/scenes reloaded |
**Configuration reverted to state from ghi789 (2 days ago).**
Note: Rolled-back changes are preserved in git history.
To restore them later: "Restore the kitchen motion lights I rolled back"
Rollback Recovery

If user changes their mind:

bash
# Find the rollback commit
git log --oneline -5
# Revert the rollback (restores original changes)
git revert <rollback-commit-hash>
Rollback Error Handling
ErrorResponse
Merge conflict during revertShow conflict, offer manual resolution or abort
Push rejectedOffer: retry, force push (with warning), or local-only
HA reload failedCheck error logs, offer to retry or investigate

Deploy Error Recovery

If deployment fails:

  1. Check HA logs:

``bash MSYS_NO_PATHCONV=1 hass-cli raw get /api/error_log | tail -20 ``

  1. Offer rollback option:

"Deployment failed. Would you like to: a) View error details b) Rollback to previous commit c) Try to fix and redeploy"

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
46
Repository forks
2
7-day trend score
19

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 Mar 2026, 8 months ago.

Extension points

  • hookPre/post lifecycle hooks
  • pluginCustom plugin integration

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/benny-lewis/home-assistant-assistant/ha-deploy/badge)](https://verified-skill.com/skills/benny-lewis/home-assistant-assistant/ha-deploy)

Something wrong with this skill or its page? Tell us.