Mushroom Dashboard Strategy

repository·main·Indexed 20 days ago

https://github.com/digilive/mushroom-strategy

A Home Assistant dashboard automation tool that automatically generates organized, responsive dashboards using Mushroom cards. It structures views based on entities, devices, and areas with minimal YAML configuration and integrates Mini graph cards for sensor data visualization.

Tokens
18.7K
Snippets
53
Records
76
Agent score
71%

What's inside mushroom-strategy

  1. Overview of Mushroom Strategy

    main

    The Mushroom Strategy is a Home Assistant dashboard strategy designed to automatically generate beautiful, intuitive dashboards using Mushroom cards. Instead of manually configuring every individual card via YAML, you define your entities, areas, and devices, and the strategy intelligently builds a dynamic, responsive dashboard.

    Key Capabilities:

    • Automated Generation: Minimizes YAML configuration by building views based on your Home Assistant components.
    • Component Awareness: Automatically organizes entities, devices, and areas into logical, navigable views.
    • Domain-Specific Views: Includes pre-built views for domains such as lights, fans, and climate.
    • Integrations:
    • Responsive Design: Optimized for mobile, tablet, and desktop interfaces.
  2. Overview of Mushroom Dashboard Strategy

    main

    Mushroom Dashboard Strategy is a tool for Home Assistant that automatically generates organized, aesthetically pleasing dashboards. It leverages Mushroom cards to create intuitive views for your devices, areas, and entities with minimal YAML configuration.

    Key features include:

    • Automatic Dashboard Generation: Creates dashboards from minimal YAML.
    • Intelligent Organization: Automatically structures views by devices, areas, and entities.
    • Customization: Allows tailoring to specific smart home setups.
    • Integrated Insights: Includes mini graph cards for sensor data visualization.
  3. Understand the versions.json file

    main

    The versions.json file lives on the gh-pages branch and acts as the 'brain' for the documentation UI. It defines which versions exist and which aliases (like latest) point to them. If this file is missing or a version is not listed, the version selector will not appear in the UI.

    Example structure:

    [
      {
        "version": "main",
        "title": "main",
        "aliases": []
      },
      {
        "version": "v1.0.0",
        "title": "v1.0.0",
        "aliases": ["latest"]
      }
    ]
  4. Sort areas using the `order` property

    main

    You can control the arrangement of areas in a view using the order property. The strategy prioritizes ordering as follows:

    • Numeric values: Lower values appear first (e.g., order: 10 appears before order: 20).
    • Infinity/Negative Infinity: Use -Infinity to always show an area first, or Infinity to always show it last.
    • Undefined/Missing: Areas without an order property are sorted alphabetically by name.

    Note: By default, the undisclosed area is assigned the highest possible order value, ensuring it appears last.

  5. Configure the 'undisclosed' area

    main

    The undisclosed area is a special built-in area that includes all entities not currently linked to a specific Home Assistant area.

    • It is enabled by default.
    • You can configure it using the same options as any other area (e.g., name, icon, order).
    • To hide it from your dashboard, set hidden: true under the undisclosed key in your areas configuration.
  6. Manage the site/ directory and .gitignore

    main

    The site/ directory contains generated assets.

    • mkdocs serve: Serves from memory (no physical folder).
    • mkdocs build: Generates a static version in site/.
    • mike deploy: Bypasses site/ to commit directly to gh-pages.

    Critical Rule: Never commit the site/ folder to the main branch. Ensure /site/ is included in your .gitignore to avoid merge conflicts and repository bloat.

  7. Control element arrangement using the `order` property

    main

    Elements such as Areas, Views, and Domains are automatically assigned an order value based on their position in an alphabetically sorted list (e.g., 10, 20, 30).

    To manually arrange elements:

    1. Assign an order integer to the element in your configuration.
    2. Lower values appear first in the dashboard.
    3. If two elements share the same order value, they are sorted alphabetically by name.
    4. Elements without an order property follow the default alphabetical priority.

    You can use show_positions: true to reveal these order values in the UI, which helps when managing long lists.

    strategy:
      type: custom:mushroom-strategy
      options:
        show_positions: true
        areas:
          family_room_id:
            name: Family Room
            icon: mdi:sofa
            icon_color: green
            order: 10
          kitchen_id:
            name: Kitchen
            icon: mdi:fridge
            icon_color: blue
            order: 20
  8. How to sort domains using the `order` property

    main

    You can control the arrangement of domains in a view using the order property within a domain's configuration.

    • Lower values appear first: A domain with order: 10 will appear before a domain with order: 20.
    • Alphabetical fallback: If order is undefined or missing, domains follow the strategy's prioritized list, sorted alphabetically by name.
    • Extreme positioning: Use Infinity to always show a domain last, or -Infinity to always show it first.

    Note: The strategy pre-assigns a position to each domain regardless of whether it is hidden.

  9. Getting Started with Mushroom Strategy

    main

    To begin using the Mushroom Strategy in your Home Assistant instance, follow these primary steps:

    1. Installation: Follow the Installation Guide to install the strategy via HACS (Home Assistant Community Store) or through a manual installation.
    2. Basic Setup: Refer to the Basic Setup guide to learn the fundamental configuration required to generate your first dashboard.
    3. Customization: Once the basic dashboard is running, use the Configuration Options to fine-tune the appearance and behavior.
    4. Advanced Reference: For a comprehensive look at how to combine multiple settings, consult the Usage Example.
  10. Add a device or entity to an area

    main

    To assign a device or entity to a specific area in Home Assistant, follow these steps:

    1. Navigate to Settings at the bottom of the sidebar.
    2. Select Devices & services.
    3. Select either Devices or Entities at the top.
    4. Choose the specific device or entity.
    5. Click the pencil (:material-pencil:) or cog (:material-cog:) icon in the top right corner.
    6. Select the desired area in the area field.

    Note: If you manually created an entity in configuration.yaml, you must ensure it has a unique_id before you can assign it to an area.

  11. Configure Mushroom Dashboard Strategy via YAML

    main

    You can customize the Mushroom Dashboard by providing an options object within the strategy configuration in your YAML setup.

    By default, the strategy enables all views, domains, and badges. Badges count 'active' entities, and entities without a specified area are assigned to the undisclosed area. Configuration and diagnostic entities are hidden by default.

    strategy:
      type: custom:mushroom-strategy
      options:
        # Custom Configuration goes here
  12. Add custom views using extra_views

    main

    To add views that are not part of the standard Mushroom domain views, use the extra_views group within the options block. These views follow the standard Home Assistant view configuration schema.

    Tip: You can design a view in a temporary Home Assistant dashboard, open the Raw configuration editor, and copy the views array directly into your extra_views configuration.

    strategy:
      type: custom:mushroom-strategy
      options:
        extra_views:
          - theme: Backend-selected
            title: cool view
            path: cool-view
            order: Infinity
            icon: mdi:emoticon-cool
            badges: []
            cards:
              - type: markdown
                content: I am cool