Hello,
i have a code running on my dashboard, see below. As you can see, label row shows me the current power consumption and the Icon is changeing based on
this.
my question, is it possible, to replace the “W” info in the label row by a text?
- for example:
– <= 0.5W = OFF
– between 0.6W and 10W = FINISHED
– above 10W = RUNNING
- type: custom:button-card
show_entity_picture: false
entity: sensor.s1plug_s_eg_gs_power
name: DISHWASHER
show_state: false
show_label: true
label: |
[[[
return + states['sensor.s1plug_s_eg_gs_power'].state + " W"
]]]
card_mod:
style: >
:host {
{% set WasherStatus = states("sensor.s1plug_s_eg_gs_power") | float %}
{% if WasherStatus <= 0.1 %}
--card-mod-icon: mdi:dishwasher-off;
--card-mod-icon-color: steelblue;
{% elif WasherStatus <= 2 %}
--card-mod-icon: mdi:dishwasher-alert;
--card-mod-icon-color: darkorange;
{% else %}
--card-mod-icon: mdi:dishwasher;
--card-mod-icon-color: green;
{% endif %}
}
styles:
card:
- font-size: 20px
- height: 127px