Update theme file
themes_update_themeModify an existing Lovelace theme in Home Assistant by merging or replacing its variables; reload themes after saving.
Instructions
Update an existing Lovelace theme file.
With merge=True (default), shallow-merges the given variables into
the existing top-level keys — a passed modes key replaces the whole
modes block rather than merging inside it; with merge=False,
replaces the entire variable set. Fails if the theme file doesn't
exist yet.
Use when: changing some or all variables on a theme that already
exists.
Not for: a theme that doesn't exist yet — use themes_create_theme.
Returns: dict with success, path, merged, and reloaded (present
when reload=True).
Errors: {"success": false, "error": "Theme '<name>' not found at <path>"} when the file doesn't exist; {"success": false, "error": "invalid_theme_name", "detail": ...} when name contains '/' or a
backslash, starts with '.', or is blank.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Theme name to update; obtain it from themes_list_themes or themes_list_theme_files. | |
| merge | No | If true, shallow-merges variables into the existing top-level keys; if false, replaces the whole variable set; defaults to true. | |
| reload | No | If true, calls frontend.reload_themes after writing the file; defaults to true. | |
| variables | Yes | Variable map to apply; merged into or replacing the existing set depending on `merge`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||