#Visibility on vertical-stack not functional?

1 messages · Page 1 of 1 (latest)

upbeat tulip
#
type: vertical-stack
cards:
  - type: entity
    entity: sensor.home_assistant_core_memory_percent
visibility:
  - condition: state
    entity: sun.sun
    state: below_horizon

shows always, completely ignoring the visibility? made in the ui, so no typos or what have you... Couldnt find an issue on the matter, so figured I must be doing something wrong

it would be a nasty bug, because adding the type conditional replacing the visibility causes a gap in the view (type: sections)

#

Visibility on vertical-stack not functional?

tough crescent
#

I think the visibility conditions for cards operate like triggers in automations - they only get checked when the state changes.

upbeat tulip
#

hmm, never heard about that tbh, they either work or they dont. Using an entities card with the exact same condition just works correctle

#

I could make it happen just now, after some other edits. The above was a UI example, this is a realmlife use case:

type: custom:mod-card
visibility:
  - condition: state
    entity: binary_sensor.dst_alert
    state: 'on'
card_mod:
  style: |
    :host {
      --stack-card-gap: 0;
    }
card:
  type: vertical-stack
#   visibility:
#     - condition: state
#       entity: binary_sensor.dst_alert
#       state: 'on'
  cards:
    - type: custom:button-card

where I added a mod on the vertical-stack, and moved the conditional to the mod-card

#

and even the direct card I showed opening the thread now works... huh

tough crescent
#

wait.. potentially silly question

upbeat tulip
#

could it have been a temporary fluke in the Dashboard..

tough crescent
#

did you go out of edit dahsboard mode?

#

because in edit dashboard mode all the visibility rules are overrridden

upbeat tulip
#

yes 😉 I know that doesnt work with those

tough crescent
#

lol fair enough, thought it was worth checking

upbeat tulip
#

it sure is, thanks

#

it is odd though, because I checked the Dash and saw my Daylight savings time card still showing.... while the binary in the visibility check had long changed. needs more research 😉

tough crescent
#

Hmm weird

#

if you figure it out lmk in case it pops up again 🙂

upbeat tulip
#

sure. thanks for your time (1 thing to note is that the binary is a trigger based template triggering on day change. Thats why I know ( I also checked ofc) the state had actually changed at 24:00 hours)

tough crescent
#

I unfortunately don't have mod-card so can't easily check your exact real usecase - but i tried a vertical stack inside a horizontal stack and it works fine

upbeat tulip
#

it was designed to make card-mod work with cards that dont have a ha-card element. Like the stack cards

tough crescent
#

Oh does it? Fair enough. I don't use card mod much but I do have it

upbeat tulip
#

my most used mod-card trick is to remove the gap between cards, so the card looks like one. especially useful to mimic regular entities card-header using a button-card so you can use templates in all fields.

tough crescent
#

Yeah, it looks like mod-card overrides the sub-cards visibility

upbeat tulip
#

probably yes. but that doesnt explain why my earlier UI example didnt work either...

tough crescent
#

witches did it