Skip to content

Deploy from the command line

If you only want the dashboards, Install from the Marketplace needs no terminal. This page is the other way in: for a deploy you script or run from CI, a Home Assistant that manages its resources in YAML, or the same steps you’ll take later with a skin of your own. Pick one of the two; each registers its own copy.

You don’t need to clone or build anything. The prebuilt bundle holds both skins. A small command-line tool copies it into Home Assistant and creates a dashboard for each skin. After that you change layouts in Home Assistant itself.

CI runs these steps on every change to Dashhaus: it packs the release, installs only @dashhaus/bundle and @dashhaus/deploy into an empty folder, writes this config and deploys it into a simulated Home Assistant.

  • Home Assistant with an admin user.
  • Node.js 22 or newer on the computer you deploy from.
  • A way to copy a file into Home Assistant’s /config/www folder: the Terminal & SSH add-on with your public key in its authorized_keys, the Samba add-on’s share mounted on your computer, or a Docker volume.
  1. Make a folder for your dashboards and install the bundle and the deploy tool:

    Terminal window
    mkdir my-dashboards && cd my-dashboards
    npm init -y
    npm install @dashhaus/bundle @dashhaus/deploy
  2. Create a .env file in that folder with three settings:

    .env
    HA_URL=http://homeassistant.local:8123
    HA_TOKEN=your-long-lived-access-token
    HA_WWW=root@homeassistant.local:/config/www
    SettingWhat it isFor example
    HA_URLthe address you open Home Assistant athttp://homeassistant.local:8123
    HA_TOKENan admin's token: Profile → Security → Long-lived access tokens<long-lived access token>
    HA_WWWHome Assistant's /config/www: user@host:/path over SSH, or a mounted folderroot@homeassistant.local:/config/www
    HA_SSH_PORT (optional)only when SSH isn't on port 2222222

    HA_WWW is an SSH address like the one above, or a local folder such as /Volumes/config/www. Only the deploy tool uses HA_TOKEN; it never goes into the bundle. Keep .env out of version control.

  3. Create dashboard.config.mjs next to it. It names the bundle to upload and the dashboards to create:

    dashboard.config.mjs
    import { fileURLToPath } from "node:url";
    import { bundlePath } from "@dashhaus/bundle";
    /** @type {import("@dashhaus/deploy/config").DeployConfig} */
    export default {
    pageTitle: "Home",
    bundle: fileURLToPath(bundlePath),
    dashboards: [
    {
    path: "home-orb",
    title: "Home (Orb)",
    icon: "mdi:home-variant",
    async card() {
    return { card: { type: "custom:dashhaus-orb" }, made: "automatic" };
    },
    },
    {
    path: "home-field",
    title: "Home (Field)",
    icon: "mdi:knob",
    async card() {
    return { card: { type: "custom:dashhaus-field" }, made: "automatic" };
    },
    },
    ],
    };

    Each path needs a hyphen; Home Assistant requires one. Keep only the skin you want if you don’t need both. The @type comment lets your editor check the file against @dashhaus/deploy/config; the tool doesn’t need it.

  4. Deploy:

    Terminal window
    npx dashhaus-deploy --skip-build

    The tool copies the bundle into www/, registers it as a dashboard resource, and creates each dashboard the first time. --skip-build tells it to use the bundle as installed, since there’s nothing to build. Every step ends in ✓; the last one, Checking that Home Assistant serves it, fetches the file back from Home Assistant, so a wrong HA_WWW shows up here instead of as a blank dashboard. npx dashhaus-deploy --help prints the options, a config to start from and the .env keys:

    OptionWhat it does
    --config <file>the config to read (default: dashboard.config.mjs in this folder)
    --skip-buildupload the bundle as it is; use it for @dashhaus/bundle, which has nothing to build
    --helpthis text
  5. Reload any Home Assistant tab that was already open, then pick Home (Orb) or Home (Field) in the sidebar.

    Home Assistant reads its list of resources when a tab opens. Until you reload, an open tab shows the new dashboard in the sidebar but says “Configuration error” instead of drawing it.

A new dashboard lays out every supported entity by area. To choose your own cards, rows and order, open the dashboard and go to ⋮ → Edit dashboard, then the card’s pencil and Show code editor. The preview redraws as you type, and mistakes are listed all together with where they are and what you probably meant:

Dashhaus config has 2 problems:
• rows[1].cards[0] (sensor.bedroom_temperature): unknown key "humdity" — did you mean "humidity"?
• rows[2].cards[3]: media_player.tv: media_player.* entities have no card yet

To put a Dashhaus card on another dashboard, add Dashhaus from the card picker. It starts from the generated layout for your house. Put it in a Panel view so it gets the full width.

Lay it out in YAML has both skins’ keys, pages and the bottom nav.

Update the packages and run the same command again:

Terminal window
npm update @dashhaus/bundle @dashhaus/deploy
npx dashhaus-deploy --skip-build

Redeploying replaces the bundle and leaves your dashboards alone, so layouts you edited in Home Assistant are kept. Open tabs pick up the new version when they reload.