Die custom:button-card can mann die sensoren zufugen wie dieses vorbild mit der PM1 messwerte.
- type: 'custom:button-card'
template: airq_btn_t
entity: sensor.airq_device
name: PM1
icon: 'mdi:blur'
custom_fields:
accuracy: |
[[[
var b = states['sensor.airq_device'].attributes.pm1[1].toFixed(1);
return '±' + b + ' %';
]]]
unit: ' µg/m3'
label: |
[[[
return states['sensor.airq_device'].attributes.pm1[0].toFixed(1);
]]]
Das button-card template soll so aussehen wenn sie dasselbe wie die PM sensoren in bild (einige nachrichten fruher) zeigen wurden
;
button_card_templates:
airq_btn_t:
show_label: true
show_state: false
show_name: true
styles:
grid:
- grid-template-areas: '"n i" "l unit" "accuracy accuracy"'
- grid-template-columns: 1fr 1fr
icon:
- color: var(--state-icon-color)
- width: 24px
- height: var(--mdc-icon-size)
name:
- font-size: 110%
- color: var(--secondary-text-color)
- justify-self: start
- padding-left: 15px
label:
- font-size: 100%
- color: var(--primary-text-color)
- justify-self: end
custom_fields:
accuracy:
- font-size: 80%
- color: var(--secondary-text-color)
- padding-right: 10px
unit:
- font-size: 60%
- color: var(--secondary-text-color)
- justify-self: start
- padding-left: 5px