Auto-populating Dashboards with Strategy Pack - Area Dashboard Strategy

Auto-populating Dashboards 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!


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

If you want to know more (about all available Strategies and their Documentation) take a look at the new GitHub Pages Homepage!


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!

You no longer need to painstakingly specify and order every entity and card on your Dashboard with thousands of lines of YAML!

More on them in the Home Assistant Documentation.

What does Strategy Pack do?

It provides a multitude of these Strategies! There’s even some that create whole Dashboards with all your entities neatly displayed!

But there are also some more specific Strategies if have found a need for in my personal Home Assistant Journey.

And I look forward to adding more. So feel free suggest new ones, or even make your own and submit a Pull Request!

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

The clue is that a Strategy 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 some few lines of YAML configuration or in some Strategies even no configuration at all!

And if you don’t like what you get in your Dashboard just read the detailed configuration documenation for every Strategy giving you the ability to customize next to everything!

The minimal configuration and... ...the impressive result of just one Strategy for example!
views:
  - strategy:
      type: custom:battery-view-strategy
    path: battery
    icon: mdi:battery-50
    title: Battery
        

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

The Strategies are all fully responsive, meaning you can use all of them on Tablets and Phones as well! That`s just what i do!

Example of Responsiveness with Area Dashboard Strategy:

Area Strategy Responsive

Can you give me an example for one such Strategy?

Yeah sure, 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!

strategy:
  type: custom:area-dashboard-strategy

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

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.

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

Additionally if you don’t like something it is fully configurable!

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

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!

Take a look at the new GitHub Pages Homepage!

7 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

Version 1.1.0 Incoming

What’s Changed

Exciting New Features :tada:

Fixes :bug:

Technical Changes :hammer_and_wrench:

Full Changelog: Comparing 1.0.0...1.1.0 · itsteddyyo/strategy-pack · GitHub

1 Like

Is it possible to use the “ExtraView” option to add the entities of an entire device, similar to the battery view?

Yeah that should be possible :smile:

You can pass any view you want to extra views. So that can be views created by strategies or normal ones without strategy if you want. Like i use this combiniation where one is for my calendar without any strategy :smile:

strategy:
  type: custom:area-dashboard-strategy
  config:
    extraViews:
      - strategy:
          type: custom:update-view-strategy
        title: Update
        icon: mdi:package-up
        path: update
      - strategy:
          type: custom:battery-view-strategy
        title: Battery
        icon: mdi:battery-50
        path: battery
      - title: Calendar
        path: calendar
        icon: mdi:calendar
        type: panel
        cards:
          - type: custom:week-planner-card
            startingDay: monday
            calendars:
              - entity: calendar.calendar_1
                color: '#E6C229'
              - entity: calendar.calendar_2
                color: '#1A8FE3'
              - entity: calendar.calendar_3
                color: '#BF40BF'
            days: 14

So there you can do pretty much everything that can be done in HA Lovelace with YAML :smiley:

If you then want your device entities in a grid again you could use grid-view-strategy like this:

type: custom:grid-view-strategy
config:
  rows:
    - title: Entities for that Device (that are not hidden or disabled)
      card:
        type: tile
        entity: $entity
      filter:
        include:
          - type: device
            value: fb1d1e1ee3ac594a9b0883d96a995458 (here you need to use the id of your device)
        exclude:
          - type: disabled_by
            comparator: match
            value: .*
          - type: hidden_by
            comparator: match
            value: .*

Hope that works in your setup and helps :smile:

I just read your deleted comment and thought I’d share this in case it helps anyone :smiley:

If you’re looking to add a single row to the default configuration, you can do it like this:

The - ~Media, etc., refer to the row titles from the default configuration. You can simply reference them using a tilde (~) :smile: .

strategy:
  type: custom:area-dashboard-strategy
  config:
    tabs:
      - title: Control
        icon: mdi:button-pointer
        rows:
            - domain: light
              title: Lights
              card:
                  type: tile
                  entity: $entity
                  hide_state: true
                  tap_action:
                      action: toggle
                  icon_tap_action:
                      action: none
                  hold_action:
                      action: more-info
            - ~Alarm
            - ~Media
            - ~Cover
            - ~Vacuum
            - ~Switch
            - ~Select
            - ~Button
            - ~Number
      - ~Control
      - ~Camera

Both of these examples for the extraview help, thank you!

I figured out that I could add the variables using “~” to use default config after I posted.

Yeah sorry that was a pretty late addition with the “~”. Maybe i should give it a more prominent place in the Documentation :smile:

Is it possible to use a thermostat card to pull all the entities from a thermostat device, instead of the device’s entities all getting a separate item in the room?

It doesn’t look like there is any actual control of my Ecobee T’stats cool/heat modes as well.

I don’t have a thermostat device in my setup so i can’t say much about it. But normally in Home Assistant you pass entities to the cards and it looks like with the Thermostat Card it’s the same (Thermostat card - Home Assistant).

As per the ecobee integration documentation there should be a climate.something entity you can interact with and set climate mode.

Are you sure this is a problem with area-dashboard-strategy? Can you get a working example in Dashboard or View without using the Strategy? There you could use the GUI Editor for creating the card and then take that YAML to the Strategy Configuration if you get it working :smiley:

It does not seem to work with the theromostat type, maybe I am missing something? I was trying to add it to the top view and i get this error:

I do not think the Thermostat Card supports multiple entities :smiley:

As per the documentation (Thermostat card - Home Assistant) you can only pass one entity like

type: thermostat
entity: climate.theater

In the documentation it also says you can pass the features like climate mode you want in the card config.

So i think you need two cards :smiley: