thomasloven / lovelace-auto-entities

🔹Automatically populate the entities-list of lovelace cards
MIT License
1.24k stars 113 forks source link

Question: How to fill a bootstrap-grid-card row? #262

Closed sgofferj closed 1 year ago

sgofferj commented 2 years ago

I'm trying to fill a bootstrap-grid-card with sensors but I haven't been very successful. The problem is that the bootstrap-grid-card requires an additional level in the config for rows. Example:

type: custom:bootstrap-grid-card
cards:
  - type: row
    cards:
      - type: markdown
        class: col-12
        content: '**Current**'
  - type: row
    cards:
      - type: gauge
        class: col-6 col-sm-6 col-md-2 col-lg-2 col-xl-1
        entity: sensor.garden
        name: Garden
        min: -40
        max: 40
        needle: true
        severity:
          green: 10
          yellow: 25
          red: 30
      - type: gauge
        class: col-6 col-sm-6 col-md-2 col-lg-2 col-xl-1
        entity: sensor.hattula_temp
        name: Hattula
        min: -40
        max: 40
        needle: true
        severity:
          green: 10
          yellow: 25
          red: 30
      - type: gauge
        class: col-6 col-sm-6 col-md-2 col-lg-2 col-xl-1
        entity: sensor.rtl_433_nexus_th_1_59_temp
        name: Nexus-TH 1 59
        min: -40
        max: 40
        needle: true
        severity:
          green: 10
          yellow: 25
          red: 30
      - type: gauge
        class: col-6 col-sm-6 col-md-2 col-lg-2 col-xl-1
        entity: sensor.rtl_433_nexus_th_1_200_temp
        name: Nexus-TH 1 200
        min: -40
        max: 40
        needle: true
        severity:
          green: 10
          yellow: 25
          red: 30
      - type: gauge
        class: col-6 col-sm-6 col-md-2 col-lg-2 col-xl-1
        entity: sensor.rtl_433_nexus_th_1_232_temp
        name: Nexus-TH 1 232
        min: -40
        max: 40
        needle: true
        severity:
          green: 10
          yellow: 25
          red: 30
      - type: gauge
        class: col-6 col-sm-6 col-md-2 col-lg-2 col-xl-1
        entity: sensor.rtl_433_ambientweather_f007th_1_28_temp
        name: AW F007TH 1 28
        min: -40
        max: 40
        needle: true
        severity:
          green: 10
          yellow: 25
          red: 30
      - type: gauge
        class: col-6 col-sm-6 col-md-2 col-lg-2 col-xl-1
        entity: sensor.rtl_433_ambientweather_f007th_1_69_temp
        name: AW F007TH 1 69
        min: -40
        max: 40
        needle: true
        severity:
          green: 10
          yellow: 25
          red: 30

I can fill a grid card with gauges with auto-entities, no problem, but grid cards are somewhat unpractical for varying screen formats. Is there a way to fill a bootstrap-grid-card row with auto-entities?

mirkin-pixel commented 1 year ago

@sgofferj

Not sure if this is what you're looking for, but this works:

- type: custom:auto-entities
    card:
      type: custom:bootstrap-grid-card
      class: "row"
    card_param: cards
    filter:
      include:
        - domain: light
          area: Keuken
          options:
            type: "custom:button-card"
            class: "col-3 col-md-3"
            template: button_light
      exclude:
        - domain: light
          name: /[Ll]ampen/
          area: Keuken
sgofferj commented 1 year ago

@mirkin1993 Awesome! That works! YAML is so confusing :laughing: @thomasloven Is there anywhere this example could be put? Docs? Wiki? ...?