I fixed it. But now thisâŚ
- entity: sensor.problems_any
name: Probleme
icon: mdi:check-circle
style:
ha-state-label-badge:
$:
ha-label-badge:
$: |
.badge-container .label-badge {
border-radius: 20% !important;
}
.badge-container .label-badge .value::after {
{% if is_state('sensor.problems_any','1') %}
content: "{{states(config.entity)}}";
{% endif %}
}
.: |
ha-label-badge ha-state-icon {
{% if is_state('sensor.problems_any','0') %}
display: none;
{% endif %}
}
:host {
{% if states(config.entity) | int(0) == 0 -%}
--label-badge-text-color: green;
--label-badge-red: green;
{% else %}
color: red;
--label-badge-text-color: red;
--label-badge-red: red;
--label-badge-background-color: yellow;
{% endif %}
}
âŚshows:
- when value is 0 (error: icon missing)
- when value is 1 (error: icon shown)
So: it got even worse.