mannebk
(ManneBK)
March 13, 2022, 10:43am
1
HI folks,
I have two cards,
one is only a “switch on when pressed” and goes off by itself, when consumption does reach a certain level. the lightning symbol in yellow and grey is perfect for it.
Ho ever right next to it I have a toggle button, that should not display the lightning symbol but a slider just like the table based switches.
I tried it with this
state_icons:
"off": "mdi:toggle-switch-off-outline"
"on": "mdi:toggle-switch-outline"
and with this
square: false
columns: 2
type: grid
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: switch.steckdose_sm_printer
name: Printer
icon: >-
'${if (states['switch.steckdose_sm_printer'].state === 'on')
'mdi:toggle-switch-outline';else 'mdi:toggle-switch-off-outline'}'
both result in errors or no symbol at all, what am I doing wrong here?
THX
pedolsky
(Pedolsky)
March 13, 2022, 6:51pm
2
I assume the standard button card is not templatable. Use e.g. custom:button-card
instead.
1 Like
mannebk
(ManneBK)
March 14, 2022, 8:02am
3
I cant get button-card to work. my lovelace tells me there is no button-card available aside from the stock card.
I tried all I could find in here about what to put into the yaml to make it available.
hacs put in a url to hacsfiles with a hacstag on it.
I searched and found hints to put in this:
thats where it really is:
so by all means it should load, so what do I do wrong?
Most core lovelace cards are not templatable. Some custon cards like Custom Button Card , Card Templater , and Card Mod do allow templating.
mannebk
(ManneBK)
March 14, 2022, 8:23am
5
Yes, thank you, I already installed custom:button-card from hacs, but it does not work, that was my follow up question…
pedolsky
(Pedolsky)
March 14, 2022, 9:07am
6
Did you clear the browser cache?
pedolsky
(Pedolsky)
March 14, 2022, 9:18am
8
Then it could be a messed up HACS installation. Repeat the installation.
mannebk
(ManneBK)
March 14, 2022, 9:41am
9
the hacs or the button card?
pedolsky
(Pedolsky)
March 14, 2022, 10:09am
10
Reinstall custom:button-card.
1 Like
mannebk
(ManneBK)
March 14, 2022, 10:28am
11
Thanks,
so I did a reinstall of the custom button-card, what i found was that HACS did indicate the button-card not being loaded in lovelace. this error in HACS is now gone
but still I get this:
mannebk
(ManneBK)
March 14, 2022, 10:35am
12
i got it to work, i had to remove the " ’ " on type,
why would an empty card start with those " `` " when its not needed?
HA is so confusing sometimes.