button-card
button-card copied to clipboard
blink animation not working with template
Checklist
- [X ] I updated the card to the latest version available
- [X ] I cleared the cache of my browser
Describe the bug hi guys, I have this card that should make the status flash if it's different from zero, but instead it's not like that, it only flashes if I go from zero to a value xx.xx, this sensor is a scale sensor so it's made up of xx .xx.
Version of the card Version: 1.3.0
To Reproduce This is the configuration I used:
type: custom:button-card
entity: sensor.bilancia_xiaomi_vins
show_units: false
show_state: true
show_icon: false
show_name: false
styles:
card:
- border-width: 0px
- font-size: 35px
state:
- animation: >
[[[ if (states['sensor.bilancia_xiaomi_vins'].state != 0) return
'blink 5s ' ]]]
card_mod:
style: |
ha-card {
color: white;
text-align: center;
font-family: digital;
text-shadow: 1px 1px 0px white, 0 0 0.2em white;
letter-spacing: normal;
}
Screenshots If applicable, add screenshots to help explain your problem.
Expected behavior I would expect that at every change of state other than zero the state would flash for 5 seconds
Desktop (please complete the following information):
- Browser chrome
- Version Versione 118.0.5993.71 (Build ufficiale) (a 64 bit)
Smartphone (please complete the following information):
- Device: poco f3
- OS: android 13
- Browser chrome
- animation: >
[[[ return entity.state !== 0 ? 'blink 5s' : null; ]]]
- animation: > [[[ return entity.state !== 0 ? 'blink 5s' : null; ]]]
Unfortunately it doesn't work like that either... the card is in a custom_fields and when I enter your string it gives me an error