Skip to content
Aalian Khan edited this page Nov 8, 2023 · 11 revisions

Installation

Prerequisites

You need to install these cards before using this strategy:

HACS

Mushroom dashboard strategy is available in [HACS][hacsUrl] (Home Assistant Community Store).

  1. Install HACS if you don't have it already.
  2. Open HACS in Home Assistant.
  3. Go to the "Frontend" section.
  4. Click the button with the "+" icon
  5. Search for "Mushroom dashboard" and install.

Manual

  1. Download mushroom-strategy.js file from the dist directory.
  2. Put mushroom-strategy.js file into your config/www folder.
  3. Add a reference to mushroom-strategy.js in Dashboard. There are two ways to do that:
    • Using UI: SettingsDashboardsMore Options iconResourcesAdd Resource → Set Url as /local/mushroom-strategy.js → Set Resource type as JavaScript Module. Note: If you do not see the Resources menu, you will need to enable Advanced Mode in your User Profile
    • Using YAML: Add the following code to the lovelace section.
      resources:
          - url: /local/mushroom-strategy.js
            type: module

Basic Setup

To add Mushroom Strategy to a dashboard:

  1. In the UI of the dashboard, click the three dots in the top right corner.
  2. Click Edit Dashboard.
  3. Click 3 dots again
  4. Click Raw configuration editor
  5. Add the following lines:
strategy:
  type: custom:mushroom-strategy
views: []

You may see the following error

Error loading the dashboard strategy:
    Error: Timeout waiting for strategy
    element ||-strategy-mushroom-strategy to
    be registered

This is mainly because of cache or HACs didn't create a reference. Try clearing the cache on your browser and add a reference to mushroom-strategy.js in the Dashboard. There are two ways to do that:

  • Using UI: Settings → Dashboards → More Options icon (3 dots) → Resources → Add Resource → Set Url to /hacsfiles/mushroom-strategy/mushroom-strategy.js Set Resourcetype to JavaScript-module.

    Note: If you do not see the Resources menu, you will need to enable Advanced Mode in your User Profile

  • Using YAML: Add following code to lovelace section.

    resources:
        - url: /hacsfiles/mushroom-strategy/mushroom-strategy.js
          type: module

Use /local/mushroom-strategy.js as url if you followed the manual installation instructions.