Add Lovelace resource
dashboards_add_dashboard_resourceAdd a custom JS or CSS resource to load on every Lovelace dashboard page, making custom cards, themes, or scripts available globally.
Instructions
Register a custom JS or CSS resource that loads on every Lovelace dashboard page.
Sends url/resource_type to lovelace/resources/create, which
stores a new resource entry with a server-generated id — repeating
this call registers a second, distinct resource rather than updating
one. The tool itself only stores the URL string; it never fetches
url — the browser loads it later, from /local/, /hacsfiles/, or
any external CDN the URL names.
Use when: registering a custom card, theme, or script so it becomes
available on every dashboard.
Not for: changing an existing resource's URL/type — use
dashboards_update_dashboard_resource.
Returns: {"status": "added", "url": ..., "resource_type": ..., "result": ...} on success.
Errors: {"error": "resource_type must be 'module', 'js', or 'css'"}
when resource_type is anything else.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Resource URL, e.g. '/local/my-card.js' or '/hacsfiles/mini-graph-card/mini-graph-card-bundle.js'. | |
| resource_type | No | Resource kind: 'module' (ES module JS), 'js' (legacy script), or 'css'. Defaults to 'module'. | module |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||