Lovelace - conditional card - only 1 card?

HI,

is it a bug, not a feature yet, or am I doing something wrong when I try to have a set of cards displayed based on the value of an input_boolean:

08

  - type: conditional
    conditions:
      - entity: input_select.mode
        state: 'Developer'
    card:
      - type: entities
        title: Developer tools
        show_header_toggle: false
        entities:
          - switch.mode_developer
          - script.scan_orphans
          - script.remove_orphans
          - script.scan_ghosts
          - script.remove_ghosts
          - input_select.log_level

      - type: entities
        title: Orphans sensor
        icon: mdi:magnify
        entities:
          - sensor.orphans_sensor

      - type: entities
        title: Ghosts sensor
        icon: mdi:ghost
        entities:
          - sensor.ghosts_sensor

      - type: entities
        title: Developer links
        show_header_toggle: true
        entities:
          - type: weblink
            name: Hassio Configurator
            icon: mdi:wrench
            url: !secret configurator_url
          - type: weblink
            name: Terminal
            icon: mdi:console
            url: !secret terminal_url
          - type: weblink
            name: NodeRED Flows
            icon: mdi:nodejs
            url: https://hassio.local:1880
          - type: weblink
            name: IDE
            icon: mdi:code-braces
            url: https://hassio.local:8321

      - type: entities
        title: Developer scripts
        show_header_toggle: false
        entities:
          - script.reload_frontend
          - script.reload_python
          - script.restart_ha
          - script.rc_reboot_iungo
          - script.sc_reboot_iungo
          - script.update_custom_ui

There is no documentation on multiple cards, so maybe I am asking for a feature not(yet) possible. Since we can’t set views based on a state (as we can in regular HA) this would come closest.

please have a look?

Well, i think its implied in the name:

    card:

Everywhere multiple cards are allowed, the section is called cards:.

Missed that…

tried it with cards: but this is the result:

00

I sense a feature request, unless you’d have a better solution.

I could ofcourse have multiple individual conditional cards, all with the same condition, but that would be silly.

cards is not an option for the conditional card, only card is. I think this is a perfect feature request as I’ve needed it myself. I’ve always just added multiple conditional cards. Pain in the ass but it gets the job done.

done: Lovelace - conditional card - allow for multiple cards

1 Like

Hi Mariusthvdb

If you are still trying to do multiple conditional cards, just change the entities (ie switch.bedroom1 etc ) to your needs. I just populated it with random info as a test. Also remember to change the states(Bedroom, sitting room etc) to your needs. Below an example I use.

cards:
  - entities:
      - entity: input_select.rooms
    type: entities
  - card:
      entities:
        - switch.bedroom1
        - switch.bedroom2
        - switch.bedroom3
        - switch.bedroom4
        - switch.bedroom5
      type: entities
    conditions:
      - entity: input_select.rooms
        state: Bedroom
    type: conditional
  - card:
      entities:
        - switch.bedroom4
        - switch.bedroom5
        - switch.bedroom2
      type: entities
    conditions:
      - entity: input_select.rooms
        state: Sitting Room
    type: conditional
  - card:
      entities:
        - switch.bedroom5
      type: entities
    conditions:
      - entity: input_select.rooms
        state: Living Room
    type: conditional
  - card:
      entities:
        - switch.bedroom4
      type: entities
    conditions:
      - entity: input_select.rooms
        state: Braai
    type: conditional
  - card:
      entities:
        - switch.bedroom1
        - switch.bedroom5
      type: entities
    conditions:
      - entity: input_select.rooms
        state: Passage
    type: conditional
title: Room Selection
type: vertical-stack
1 Like

He was trying to have multiple cards displayed based on one set of conditions. With your example, he’d still have to duplicate his efforts and create multiple conditional cards (which is what he was trying to avoid).

yes, as Petro says :wink: Thanks for thinking along though!