Haos Ssh Maintenance
by @nextaltair
Perform Home Assistant OS maintenance via SSH for direct file access, YAML edits, custom component inspection, shell troubleshooting, and interactive ha CLI...
clawhub install haos-ssh-maintenanceπ About This Skill
name: haos-ssh-maintenance description: Use when Home Assistant OS needs SSH-based maintenance that cannot be completed cleanly through the Home Assistant API alone. Prefer API-first investigation for states, history, logbook, and routine automation checks; use this skill when direct filesystem access, YAML edits, custom_components inspection, HAOS shell troubleshooting, or interactive
ha CLI work is required. Distinguish one-shot SSH commands from interactive SSH sessions: ha commands such as ha core logs may work only inside an interactive PTY-backed SSH session.
HAOS SSH Maintenance
Use SSH only when API-based inspection is not enough.
Default posture
Prefer the Home Assistant API first for:
Switch to SSH when:
/config need reading or editingcustom_components must be inspectedha CLI work is neededUse the SSH target stored in TOOLS.md.
Common HAOS paths
/config/config/configuration.yaml/config/automations.yaml/config/scripts.yaml/config/scenes.yaml/config/custom_components//config/home-assistant_v2.dbLogs
Do not assume Home Assistant writes logs to a file by default.
Check logs in this order:
1. Home Assistant UI logs when the issue is visible there
2. interactive ha CLI log access such as ha core logs
3. Supervisor or container-side logs when available
4. file-based logs only if the environment explicitly enables them
Observed behavior for this environment:
ha core logs may fail in one-shot SSH modeha core logs works in an interactive PTY-backed SSH sessionWorkflow
1. Decide whether the task is one-shot SSH or interactive SSH. 2. Start read-only. 3. Identify the smallest affected file or command path. 4. Explain the intended change before risky edits. 5. Edit minimally. 6. Verify surrounding context after the change. 7. Prefer reload over full restart when possible. 8. Report exactly what changed.
Home Assistant YAML pitfalls
When editing Home Assistant automations or packages by hand:
service: to call a service such as shell_command.foo or light.turn_on.action: shell_command.foo in YAML automations. That produces an unknown action error in this environment.action is the UI/schema concept for a step in the actions list, but in hand-written YAML the concrete service call key should be service:.SSH modes
One-shot SSH
Use one-shot SSH commands for:
/configOne-shot SSH is appropriate for commands like:
catgrepsedfindlsDo not assume ha CLI commands will work in one-shot mode.
Interactive SSH
Use an interactive PTY-backed SSH session for:
ha core logsha CLI commands that fail in one-shot modeWhen running from OpenClaw, prefer a PTY-backed exec session and then send commands into the live SSH shell.
Investigation order
Automation problems
1. API logbook and history
2. /config/automations.yaml
3. /config/scripts.yaml
4. relevant Home Assistant or Supervisor logs
Naming or entity-origin confusion
1. API-visible attributes and registry-derived metadata
2. YAML definitions under /config
3. template, MQTT, REST, command_line, utility_meter, and custom component definitions
Integration or startup failures
1. relevant Home Assistant or Supervisor logs
2. referenced YAML blocks
3. custom_components if relevant
Change boundaries
Use SSH for:
custom_components inspectionha CLI log inspection.storage inspection or edits when UI/registry-backed state must be changed directlyDo not use SSH first for:
.storage direct-edit policy
Home Assistant internal storage under /config/.storage/ can be edited when necessary, including files such as:
/config/.storage/core.entity_registry/config/.storage/core.device_registry/config/.storage/core.config_entriesRules:
.storage edits as a last-resort or targeted-operation path, not the default first move.core.entity_registry; YAML friendly_name overlays can override what the UI shows..storage JSON unless explicitly necessary.Safety
Reporting
When using this skill, report: