Where did you put the button_card_templates?
It goes in your lovelace (or dashboard) config file anywhere before “views”.
Thanks, got it working.
Is this topic still alive?
Anyway
I’m trying to hide a button when the input boolean is off, is this correct?
- entity: switch.kerstverlichting_buxus
name: Kerstlicht buxus
icon: mdi:pine-tree
hide: >
[[[
var state = states['input_boolean.kersmodus'].state;
return state = off;
]]]
Cause when i add it, all my buttons are gone, so i think something is wrong p:
I tried chatgpt to fix my issue, but with all possibilities there, it still doesnt work.
I tried this now:
entity: switch.kerstverlichting_buxus
name: Kerstlicht
icon: mdi:string-lights
hide: >
[[[
var state = states['input_boolean.kersmodus'].state;
return state == 'off';
]]]
But when i do, all my buttons are hidden
I don’t use this card, but just use conditional card and put that button inside there. The conditional card will determine based on entity state to show/hide the card.
yeah that was my first intent, but i dont think that will work?
edit: just tried
The tile is colored completely so it doesnt work
This i tried
type: conditional
conditions:
- condition: state
entity: input_boolean.kerstmodus
state: 'off'
card:
type: entities
entities:
- light.kerstverlichting_buxus
Fixed using
entity: light.kerstverlichting_buxus
name: Kerstverlichting
icon: mdi:led-strip
hide: |-
[[[
var state = states['input_boolean.kerstmodus'].state;
return (state == 'off');
]]]