PiotrMachowski / Home-Assistant-Lovelace-Local-Conditional-card

This card can show and hide a specific card on current device while not affecting other windows. It does not require any integration to run.
MIT License
61 stars 6 forks source link

Conditional card on dashboard not loading #22

Open eMeF1 opened 10 months ago

eMeF1 commented 10 months ago

Hi there, I have an issue with the below dashboard.

When reloading the View 1 page in the browser the custom:local-conditional-card will not load.

If I navigate to View 2 and then back to View 1 the card appears.

See this in action here https://i.imgur.com/gwjAjOq.gif

views:
  - title: View 1
    type: custom:vertical-layout
    badges: []
    cards:
      - show_name: true
        show_icon: false
        type: button
        tap_action:
          action: fire-dom-event
          local_conditional_card:
            action: set
            ids:
              - livingroom: show
              - bedroom: hide
        entity: zone.home
      - type: custom:local-conditional-card
        default: show
        id: livingroom
        card:
          type: vertical-stack
          cards:
            - type: entity
              entity: sensor.time
  - title: View 2
    path: fan
    subview: false
    badges: []
    cards:
      - type: vertical-stack
        cards:
          - type: entity
            entity: zone.home

I have found a couple of ways to eliminate the issue

  1. Adding the below pop-up card to the View 1
    type: custom:popup-card
    card:
    type: vertical-stack
    cards: []
  2. Removing vertical-stack from the custom:local-conditional-card
type: custom:local-conditional-card
default: show
id: livingroom
card:
  type: entity
  entity: sensor.time