Hi all,
Is it possible to have a conditional card inside a vertical stack card ?
My attempts do not seem to display any of the cards inside the vertical stack (although the condition is met perfectly)…
Thx
Koen
Hi all,
Is it possible to have a conditional card inside a vertical stack card ?
My attempts do not seem to display any of the cards inside the vertical stack (although the condition is met perfectly)…
Thx
Koen
Yes, it works for me. I actually have three conditional cards at the top of a vertical stack. Here’s the first one:
- type: vertical-stack
cards:
- type: conditional
card:
type: entity-filter
title: Doors Unlocked
show_header_toggle: false
entities:
- lock.dr_door_lock
- lock.front_door_lock
- lock.garage_side_door_lock
state_filter:
- 'unlocked'
show_empty: false
card:
type: glance
title: Doors Unlocked
show_state: false
conditions:
- entity: sensor.doors_unlocked
state: 'True'
Maybe you need quotes around the condition? Maybe I can spot the difference if you post the code.
Thx, Rob. I’ll investigate a bit further !
Still puzzled…
Can’t get it working still.
# "Test" View
# ==================================================================
- title: Test
path: Test
background: var(--background-image)
badges: []
cards:
- type: vertical-stack
cards:
- type: conditional
conditions:
- entity: input_select.algemeen
state: 'Home'
card:
- type: markdown
content: Test 1
Try with two fewer spaces before - type: conditional
. I haven’t seen this documented anywhere, but mine as well as rccoleman’s seem to be working this way…
# "Test" View
# ==================================================================
- title: Test
path: Test
background: var(--background-image)
badges: []
cards:
- type: vertical-stack
cards:
- type: conditional
conditions:
- entity: input_select.algemeen
state: 'Home'
card:
- type: markdown
content: Test 1
Finally ! Got it working.
The solution is not to use “- type: …” in the “card:” section of the conditional card, but rather use “type: …” without the dash…
Many thanks for your kind support !!!
# "Try" View
# ==================================================================
- title: Try
path: Try
background: var(--background-image)
badges: []
cards:
- type: vertical-stack
cards:
- type: conditional
conditions:
- entity: input_select.algemeen
state: Home
card:
type: markdown
content: test 1
Ah, good eye!
I overlooked that, but it makes sense in retrospect since each condition only applies to a single card (and dashes are for multiple cards).
Hi Jason
I have the opposite problem.
The card i displayed even if the condition “state_not” is meet?
The card was setup using the UI.
type: horizontal-stack
cards:
- type: conditional
conditions:
- entity: sensor.pollen_viborg_graes
state_not: '''-'''
card:
type: gauge
entity: sensor.pollen_viborg_graes
min: 0
max: 100
name: Græs
severity:
green: 0
yellow: 10
red: 50
- type: conditional
conditions:
- entity: sensor.pollen_viborg_bynke
state_not: '''-'''
card:
type: gauge
entity: sensor.pollen_viborg_bynke
min: 0
max: 100
name: Bynke
severity:
green: 0
yellow: 10
red: 50
- type: conditional
conditions:
- entity: sensor.pollen_viborg_elm
state_not: '''-'''
card:
type: gauge
entity: sensor.pollen_viborg_elm
min: 0
max: 100
name: Elm
severity:
green: 0
yellow: 10
red: 50
- type: conditional
conditions:
- entity: sensor.pollen_viborg_birk
state_not: '''-'''
card:
type: gauge
entity: sensor.pollen_viborg_birk
min: 0
max: 100
name: Birk
severity:
green: 0
yellow: 10
red: 50
- type: conditional
conditions:
- entity: sensor.pollen_viborg_hassel
state_not: '''-'''
card:
type: gauge
entity: sensor.pollen_viborg_hassel
min: 0
max: 100
name: Hassel
severity:
green: 0
yellow: 10
red: 50
- type: conditional
conditions:
- entity: sensor.pollen_viborg_el
state_not: '''-'''
card:
type: gauge
entity: sensor.pollen_viborg_el
min: 0
max: 100
name: El
severity:
green: 0
yellow: 10
Any Idea what is going wrong?
I thank you in advance
Found the solution.
it was a typeO
state_not: '-'
#instead of
state_not: '''-'''