Thanks. Fixed that now.
Not sure what Iām doing wrong here. Iād like my fan icon to spin when the fan is in an on
state, yet that doesnāt seem to happen as configured. Has anyone managed to get spin:
working with a fan?
Template
button_card_templates:
ceiling-fan-icon-settings:
show_icon: true
show_label: false
show_name: false
styles:
card:
- height: 36px
- width: 50px
grid:
- grid-template-areas: '"i"'
- grid-template-columnns: auto
icon:
- height: 26px
- width: 26px
state:
- value: 'on'
styles:
icon:
- spin: true
Button
- type: custom:button-card
template: ceiling-fan-icon-settings
entity: fan.living_room_fan
tap_action:
action: call-service
service: fan.toggle
service_data:
entity_id: fan.living_room_fan
try:
state:
- value: 'on'
spin: true #(uncomment this line for spinning icon)
That did the trick. Thank you sir!
The icon size is by default 40% of its area width. You can use size: 100%
or any other value to resize the icon. This is a main config parameter,itās not is styles.
Coincidentally, I was able to manipulate the icon size via styles using:
styles:
icon:
- height: XXpx
- width: XXpx
This gave me exactly what I needed to tweak icon sizes down to the pixel.
Thatās also a solution, size
does exactly this with the value you provide but it existed before you where able to do the same thing with styles, so I keep it.
Hi peeps,
Any way to display more then one label, or multiple state attributes via label_template (but each in itās own row)?
Use <br />
between rows you want to display. label_template
supports HTML thatās why this works.
Did you get the templates to work.
I am stuck at trying to import the file with the styles
No errors but the buttons looks like the plain old ones.
Hmmā¦canāt make this workā¦if I add HTML break it doesnāt render the card
This is the example codeā¦
label_template: >
return 'Moisture: ' + states['plant.dracaena'].attributes.moisture + '%' <br /> + states['plant.dracaena'].attributes.conductivity + 'ĀµS/cm'
Youāre missing a ā+ā before your break (quotes too). Try:
label_template: >
return 'Moisture: ' + states['plant.dracaena'].attributes.moisture + '%' + '<br />' + states['plant.dracaena'].attributes.conductivity + 'ĀµS/cm'
Awesome! That works!
Much appreciated
Itās exactly the behaviour expected (for now) but Iāll work on something to make this possible. Thereās no easy way to achieve that (it will involve adding an id
to your state so that I can match what you want to merge).
Thereās already a feature request for this here : #165
yes, i did. show us your code and we can help
cool, the exact issue yes. Thanks for working on that, will make the configs much easier.
great time to think about the entity_picture_template again ā¦
Itās already done, in the next release also
wow, youāre fast! canāt wait to give it a try!
hello
in the following code how and where do i add an image instead of an icon?
i want to use different icons for different states
thank you
cards:
- name: INFORMAĆĆO
template: header_marcelo
type: 'custom:button-card'
- cards:
- entity: sensor.riscoincendio
name: RISCO DE INCĆNDIO
show_label: true
show_state: true
size: 70%
state:
- color: red
value: REDUZIDO
type: 'custom:button-card'
- dbltap_action:
action: more-info
entity: binary_sensor.meteoalarm
name: ALERTA METEO
show_label: true
show_state: true
size: 70%
state:
- color: green
value: 'off'
- COLOR: RED
VALUE: 'on'
tap_action:
action: toggle
type: 'custom:button-card'
type: horizontal-stack
type: vertical-stack
I take it you mean you want to use different images for different statesā¦?
you do so under the state:
you already have, and then set an entity_picture, as is explained in the docs: button-card/README.md at master Ā· custom-cards/button-card Ā· GitHub