Auto-populating Dashboard with Strategy Pack - Area Dashboard Strategy

Auto-populating Dashboard with Strategy Pack - Area Dashboard Strategy


Hey, after months of lurking around the forum, I wanted to try to give something back and share something myself. :grinning:

The Strategy Pack!

Link to Github

It’s a collection of Home Assistant Strategies and is supposed to keep growing.


First, what are Strategies?

A strategy is JavaScript code that gets executed to create Dashboards and Views automatically. They make it easy to have auto-populated Dashboards with next to no configuration! More on them here.


What does Strategy Pack do?

At the moment, there are 3 Strategies, but I am only going to mention one here as it clearly is the most interesting one for others. However, feel free to look at the others, suggest new ones, or even make your own!

Now back to the most important one:

The Area Dashboard Strategy is a Dashboard Strategy, meaning it creates a whole Dashboard for you that looks like this:

Area Strategy
with only 2 lines of YAML!

Dashboard → Edit Dashboard → Raw Configuration Editor (kebap menu) → Paste the following

strategy:
  type: custom:area-dashboard-strategy

The Dashboard generated will have a view for every Area in your Home Assistant instance.

I always found myself drawn to this solution in Dashboards as my number of entities grew. One single page was always way too cluttered.

This Dashboard additionally has a Tab menu on the right side to group entities and also Grids (=the rows you see with the headers), helping with the distinction between different types of entities.


Nice-looking Dashboard and all, but what’s special about this?

The clue is that it auto-generates everything. Meaning you do not need to list all entities and cards you want in some cumbersome way.

You can just let the Strategy work its magic with the default configuration.

And if you don’t like that, just say something like this with some config: I want all my light entities from the Hue integration belonging to some area in one grid, and the strategy does the rest for you.

:warning:
You can start out without doing this! There’s a sensible default I use myself which creates this whole dashboard with really just 2 lines! But you can configure it!


It looks like it needs a whole lot of space on the screen. Do I need a second Dashboard for my phone?

The Dashboard is also fully responsive, meaning you can use it on Tablets and Phones as well!

Responsive


I like it, but I want to change some things.

Perfect, it was designed with that in mind! You can’t make one Dashboard fitting for everyone, so this is highly configurable. You can change these things with some YAML configuration:

  • the navigation menu (=the area-cards)

  • the part above the navigation menu (=topCards)

  • number of tabs and their names, icons, etc.

  • number of rows with grids and their headings

  • what is displayed in these rows, e.g., which entities (lights, switches, and all other possible ones)

and

  • how these entities are displayed, e.g., which card should be shown (default uses mostly tile, but you can use absolutely every card there is, including custom ones and HACS ones)

Just take a look at the Github Repo for more information!

:warning:
Also, look at the documentation, especially the installation instructions! This Dashboard has some dependencies from other HACS Cards and Functions!

The code is a hot mess right now, but I am going to refactor everything once I am happy with all the features!

I hope this helps some people, and if there are issues, just let me know! :grin:

Thanks to this awesome community! Some more influential people to this are also mentioned in a credit section! Special thanks to all of them!

6 Likes

I’ve only tested this out briefly, but so far this is fantastic! I’ve been looking for a replacement for Dwain’s Dashboard since it’s been getting very slow for me and I wanted more configuration. I was starting to go down the path of writing my own strategy, but yours is almost exactly what I was imagining myself.

Let me know if you want any help with development.

Hey, great that it fits your needs :partying_face:
Feel free to open a issue or make a PR if you want to help or you notice something :smile: I’m sure i missed some things as it was just tested with my own setup :smile:
I will be on vacation in a few weeks and have planned to continue working on the Strategy Pack then. I want to integrate the new Sections feature and also streamline and refactor some parts.
If you have any ideas or feature requests just let me know! :smile:

Hello
Great job :slight_smile:
Is it possible to add alarm panel ?

Thank you :smile: Yeah it is already possible.
Either with topCards so the alarm panel is visible in all rooms above the area cards:

type: custom:area-dashboard-strategy
config:
  topCards:
    - type: your-alarm-card
      ...

Or do you have an alarm panel per area you want to see on the right side? I can add it to the default config but i would probably use the tile-card in the default. In the meantime or if that does not fit your needs you could just configure it yourself by overwriting the “tabs” part of the default config (strategy-pack/src/defaultConfig.yml at 0d87341224bf4d6cee4d2585838596795fe58efd · itsteddyyo/strategy-pack · GitHub) and adding the alarm yourself like this:

type: custom:area-dashboard-strategy
config:
  tabs:
    - label: Control
      icon: mdi:button-pointer
      rows:
        - domain: alarm
          title: Alarm
          card:
            type: your-alarm-card
            entity: $entity
            tap_action:
              action: more-info
            icon_tap_action:
              action: none
            hold_action:
              action: more-info
      ... rest of default config

Just released version 0.0.3 with an alarm panel added to the default config :smile: Just tell me if i doesn’t work because i don’t have any alarm panel in my setup so i could not test it :smile:

Version 1.0.0 Incoming!!!

Hey this is a pretty big update as i finally found time to refactor the code (at least to some degree) and add new strategies :smile:

Breaking Changes

First off this release includes a (small) Breaking Change:

  • in the area-dashboard-strategy config the “label” attribute in the tab config was renamed to “title”

So

tabs:
  - label: Control
    icon: mdi:cog
    rows: ....

now needs to be

tabs:
  - title: Control
    icon: mdi:cog
    rows: ....

New Stuff

So now we`ve got the annoying breaking changes behind us there’s plenty of new stuff too!

  1. In the Area Strategy you now can reference the default config without the need to copy everything. You can use this for reordering or if you want to add some custom config but still be able to have the nice default one in some places!

You can now configure it like this in Tabs and Rows!:

tabs:
  - title: Custom Tab
    icon: mdi:test
    rows:
      - domain: button
         title: Test
         card: ...
      - ~Switches (You need to specify ~ + title of the Row for it to work)
      - ~Alerts (You can use it for reordering or custom Tabs! Only want a single tab? Just specify all rows there with references!)
  - ~Camera (You need to specify ~ + title of the Tab for it to work)
  - ~Control (You can use it for reordering! Now Camera is before Control!)
  1. A new Strategy! The grid-view-strategy can be used to generate rows of grids like in the battery-view-strategy or the update-view-strategy. You are just way more free to configure what to do! To be precise you can just about do anything as long as it’s got to do with entity-cards in grids!

To be even more precise you could just implement the update-view-strategy with the grid-view-strategy!

Click for YAML
strategy:
  type: custom:grid-view-strategy
  config:
    rows:
      - title: Other
        card:
          type: tile
          entity: $entity
          hide_state: true
          features: 
            - type: update-actions
              backup: ask
        filter:
          include:
            - type: domain
              value: update
          exclude:
            - type: integration
              comparator: in
              value:
                - unifi
                - hacs
                - esphome
                - mqtt
      - title: UniFi
        card:
          type: tile
          entity: $entity
          hide_state: true
          features: 
            - type: update-actions
              backup: ask
        filter:
          include:
            - type: domain
              value: update
            - type: integration
              value: unifi
      - title: HACS
        card:
          type: tile
          entity: $entity
          hide_state: true
          features: 
            - type: update-actions
              backup: ask
        filter:
          include:
            - type: domain
              value: update
            - type: integration
              value: hacs
      - title: ESPHome
        card:
          type: tile
          entity: $entity
          hide_state: true
          features: 
            - type: update-actions
              backup: ask
        filter:
          include:
            - type: domain
              value: update
            - type: integration
              value: esphome
      - title: Zigbee
        card:
          type: tile
          entity: $entity
          hide_state: true
          features: 
            - type: update-actions
              backup: ask
        filter:
          include:
            - type: domain
              value: update
            - type: integration
              value: mqtt
icon: mdi:test
path: test
title: Test
  1. And another new Strategy! The log-view-strategy can be used to generate presets (=a sum of entities) with the filter system known of the other strategies! These presets will no be displayed in a log-card where you can switch between them with buttons! I created this as an alternative to the included logbook in Home Assistant because as cool as it is it can only display the logs for one entity. And with Motion Sensors or something like that i always wanted to group multiple entities and their logs together.

Log View Strategy

So have fun with new features and let me know if there’s any bugs! Thank you very much :smile:

1 Like

When I attempt to add the custom repository I receive the following error:

I can install the add on manually, but I figured it should work through the repository.

Thanks for letting me know! :smile: Should be fixed in the newest version of the documentation i just pushed :smile:

Works now, thanks for the fix!

1 Like