config-template-card icon indicating copy to clipboard operation
config-template-card copied to clipboard

[FR] Allow "*" wildcards in "entities" option to define many entity_ids

Open Mariusthvdb opened this issue 3 years ago • 1 comments

Checklist:

  • [X ] I updated to the latest version available
  • [X ] I cleared the cache of my browser

Release with the issue: 1.3.6 Last working release (if known): dk Browser and Operating System: any on MacOS

Description of problem:

Config doesnt auto-update based on the state changes of the embedded card. It does update on a pull/refresh.

The stand alone auto-entities card auto updates fine (albeit on a fixed threshold ofc). The latter being the sole purpose of embedding it in the config-template-card

    - type: custom:config-template-card
      entities:
        - input_number.power_threshold
      variables:
        threshold: states['input_number.power_threshold'].state
      card:
        type: custom:mod-card
        style:
          hui-grid-card:
            $: |
              .card-header {
                background-color: var(--background-color-off);
              }
        card:
          type: custom:auto-entities
          card:
            type: grid
            title: "${'Color custom-ui above ' + threshold}"
            columns: 4
          show_empty: false
          card_param: cards
          filter:
            include:
              - entity_id: sensor.*_actueel
                options:
                  type: custom:button-card
                  aspect_ratio: 1/1
                  custom_fields:
                    notification: >
                      [[[ return entity.state + 'W'; ]]]

            exclude:
              - state: '${"<" + threshold}'
          sort:
            method: state
            numeric: true

Javascript errors shown in the web inspector (if applicable):


Additional information:

community post https://community.home-assistant.io/t/100-templatable-lovelace-configurations/105241/576?u=mariusthvdb

Schermafbeelding 2022-01-16 om 12 34 44

please have a look? thanks!

Mariusthvdb avatar Jan 16 '22 11:01 Mariusthvdb

update of the above, Ildar explained to me in https://community.home-assistant.io/t/100-templatable-lovelace-configurations/105241/577 that we need to explicitly state all entities in the entities field.

I had not realized we need to explicitly point the card to all entities, if and when using an embedded auto-entities card. This makes the use of an auto-entities kind of moot.

So please read this rewrite as a FR for accepting globs in the entities field so we could do:

    - type: custom:config-template-card
      entities:
        - input_number.power_threshold
        - sensor.*_actueel ##<------ please consider adding this functionality
        - "${states['group.switches_sensors_actueel'].attributes.entity_id}" ## <---- alternative template option
      variables:
        threshold: states['input_number.power_threshold'].state
      card:
        type: custom:mod-card
        style:
          hui-grid-card:
            $: |
              .card-header {
                background-color: var(--background-color-off);
              }
        card:
          type: custom:auto-entities
          card:
            type: grid
            title: "${'Color custom-ui above ' + threshold}"
            columns: 4
          show_empty: false
          card_param: cards
          filter:
            include:
              - entity_id: sensor.*_actueel
      .....

thanks for considering

Mariusthvdb avatar Jan 16 '22 13:01 Mariusthvdb