I am just at the start of re-doing all my dashboards and cards using this method, but before I break it, can anyone just double check my assumptions below and tell me if I have done anything wrong:
I have a lost of these cards, most of which stays the same, I have Put “(variable)” next to the items that will change by instance:
A common observation:
I would choose names for variables in capitals (like “ENTITY”) to avoid “visual mixing” with native options. Just my preferences.
There is more than variables to using custom button templates. In custo button, you can reference multiple additive templates. I create like a base template, then action templates and style templates and then say use base + action2 + style1 + style4. In other words, you can template inside the card with more than variables.
I’m trying to conditionally display a button-card using decluttering-template. Entity is a battery sensor. If it falls below a certain % say 50, i’d like for the card to appear on dashboard. Else, it can stay hidden.
- type: custom:decluttering-card
template: friendly_warning_low_battery
variables:
- entity: sensor.door_battery
- name: "battery level about to fall into low zone”
Battery’s current state is 45%. Ideally, the condition in the template should be met, and this msg should be shown in the dashboard. But it isn’t. What might be wrong in the above? Also, how does one go about debugging front end issues? (Apologies for the naive question).
I’ve also tried various other suggestions adding state attribute to template but to no avail:
state:
value: 50
operator: '<'
styles:
- card: blue
Hello.
I have been using this card for a long time (lots of templates), and this is the first time I get a wierd behaviour, can’t spot what i’m doing wrong:
I have this code:
decluttering_templates:
cartao_leds_de_natal:
card:
type: vertical-stack
cards:
- type: grid
cards:
- show_name: true
show_icon: false
type: button
name: J3
tap_action:
action: call-service
service: remote.send_command
service_data:
device: leds-natal
command: jump3
target:
entity_id: remote.broadlink_ir_rf_rm4
... # then a bunch of other buttons
When I use this in a card in the dashboard directly, I get the full card:
but when I call it as a popup using browser_mod, I get an empty card:´
This is the code that I have for the popup, that works for other cards and templates:
I have build A LOT of remotes for each of my devices, with popups, with success; this one is driving me nuts since it’s one of the simplests ones… Any thoughts?