HI,
have a sensor that is dynamically created when a script is run. Before that the sensor is ‘none’…
so, trying a conditional card:
- type: conditional
conditions:
- entity: sensor.hassio_main_loaded_components
state_not: 'none' # tried none and None also, no change.
card:
- type: markdown
content: >
{{state_attr('sensor.hassio_main_loaded_components','text_lovelace')}}
but this errors out saying:

which is mystifying to me… please have a look what is wrong with this card config?
thanks!
dwinnn
2
Try removing the dash ‘-’ from
- type: markdown
It should look like
type: markdown
That’s my guess. I think I ran into the same problem as you. Conditional card can only handle one card, so it doesn’t use the dash.
1 Like
of course. I keep forgetting and overlooking that. thanks. Makes the config valid.
But still, the test for state_not is not working, no matter what I try… Cant we test for a non-existing state?
I keep getting this:

using:
- type: conditional
conditions:
- entity: sensor.hassio_main_loaded_components
state_not: 'None'
card:
type: markdown
content: >
{{state_attr('sensor.hassio_main_loaded_components','text_lovelace')}}
or any variant in the state_not:
field
aneisch
(Andrew)
4
Did you find any solution?