Lovelace - repeat config for multiple sensors

Hi,

I wrote a component that creates multiple sensors that I would like to display in rows.

I created a lovelace config for one row using existing lovelace cards (see below).
I’d like to repeat this for every sensors matching a pattern now (sensor.download_station_task_dbid_.*).
I can’t seem to find a way to achieve this.
Can anyone help me ?

I’m guessing that one way would be to write my own lovelace card, but I don’t know how to do that while still using existing cards as I wouldn’t want to re-write everything.

Thank you in advance :slight_smile:

      - type: 'custom:layout-card'
        layout: grid
        cards:
          - type: entities
            entities:
              - type: 'custom:multiple-entity-row'
                entity: sensor.download_station_task_dbid_66
                show_state: false
                entities:
                  - attribute: size_str
                    name: Size
                  - attribute: size_downloaded_str
                    name: Downloaded
                  - attribute: started_time
                    name: Started
                    format: datetime
                  - attribute: speed_download_str
                    name: Speed
                  - attribute: status
                    name: Status
            gridrow: 1 / 1
            gridcol: 1 / 4
          - type: 'custom:bar-card'
            positions:
              icon: 'off'
              indicator: 'off'
              name: 'off'
            attribute: downloaded_percent
            unit_of_measurement: '%'
            width: 70%
            style: |-
              bar-card-value {
                margin-right: auto;
                font-size: 13px;
                font-weight: bold;
                text-shadow: 1px 1px #0005;
              }
            entities:
              - entity: sensor.download_station_task_dbid_66
            gridrow: 1 / 1

Can’t you just repeat the code as many times as you need.

Custom decluttering card or use yaml anchors

Sensors are created/removed dynamically so I can’t be updating yaml every time it changes.

The custom decluttering card seems to apply to my case, but I don’t see how I could give it a dynamic list of entities, a filter would be enough.
I’m guessing that I would have the same problem with yaml anchors ?

I love it when people change the parameters half way through a discussion :slight_smile: