Skip to content

Dashboards

Ask brAIn to build or change a Home Assistant dashboard. Every change is backed up first, so one sentence puts it back.

Ask brAIn

Make a simple Guest dashboard with just the lights and the thermostat.
Add a card for the new kitchen light to my Lights dashboard.
That dashboard change was worse. Put it back how it was.
Install the Mushroom cards and redo my overview with them.
Wipe the guest dashboard back to the auto-generated one.
Delete the old tablet dashboard.

brAIn reads the dashboard, changes it, and saves the whole configuration back. It never edits .storage files.

What brAIn can do

Every service is admin-only. Call one from Developer tools → Actions, a script or an automation, or ask brAIn. * marks a required field, and [] marks a field that takes one value or a list.

Service What it does Fields
brain.create_dashboard Create a dashboard. url_path must contain a hyphen, such as lovelace-lights. show_in_sidebar defaults to on and require_admin to off. Returns the url_path and id. url_path*, title*, icon, show_in_sidebar, require_admin
brain.update_dashboard Replace a dashboard’s configuration, or one view with view_index (0-based). The previous configuration is backed up first and the backup name is returned. dry_run: true reports the target and a change summary. config*, url_path*, take_control, view_index, dry_run
brain.restore_dashboard Restore a dashboard from a backup. Uses the most recent one unless you name a backup. Leave url_path out for the default dashboard. url_path, backup
brain.reset_dashboard_config Back up and delete a dashboard’s saved configuration, so it goes back to auto-generated. The dashboard stays in the sidebar. dry_run: true reports the view count that would go. url_path*, dry_run
brain.delete_dashboard Delete a dashboard. Its configuration is backed up first and the backup name is returned. dry_run: true shows what would go. url_path*, dry_run
brain.add_dashboard_resource Register a custom card’s JavaScript module or stylesheet, such as /hacsfiles/... or /local/.... res_type is module (default), css, js or html. Returns the resource id. A duplicate URL is refused. url*, res_type
brain.remove_dashboard_resource Remove a registered resource by its URL. url*

To change a dashboard’s sidebar title, icon or visibility, use update_dashboard_info.

Good to know

  • Backups. The last 20 backups per dashboard are kept. To recover a deleted dashboard, create it again and restore.
  • The default dashboard. update_dashboard and reset_dashboard_config need url_path, and the default dashboard is the literal default. It is never targeted by leaving the field out.
  • Auto-generated dashboards. Saving onto a dashboard that was never saved needs take_control: true, because you then manage it by hand. reset_dashboard_config reverts that.
  • YAML dashboards. These services decline a dashboard defined in YAML and name the file. brAIn then edits that file in the terminal, validates it and reloads. brain undo covers both routes.

Examples

Create a dashboard
action: brain.create_dashboard
data:
url_path: lovelace-guest
title: Guest
icon: mdi:account-heart
Save a configuration
action: brain.update_dashboard
data:
url_path: lovelace-lights
config:
views:
- title: Lights
cards:
- type: light
entity: light.kitchen_ceiling
response_variable: saved # carries the backup name
Undo the last edit
action: brain.restore_dashboard
data:
url_path: lovelace-lights
Register a custom card
action: brain.add_dashboard_resource
data:
url: /local/community/mushroom/mushroom.js
res_type: module