Open sheaur opened 1 month ago
type: tile
name: Alarma Metereológica
entity: binary_sensor.meteo_alarma
show_entity_picture: true
vertical: false
hide_state: false
icon_tap_action:
action: none
tap_action:
action: more-info
card_mod:
style:
.: |
ha-card {
{% if is_state_attr("binary_sensor.meteo_alarma","awareness_level", "2; yellow; Moderate") %}
--tile-color: yellow !important;
{%- else -%}
{% if is_state_attr("binary_sensor.meteo_alarma","awareness_level", "3; orange; Severe") %}
--tile-color: orange !important;
{%- else -%}
{% if is_state_attr("binary_sensor.meteo_alarma","awareness_level", "4; red; High") %}
--tile-color: red !important;
{% endif %}
{% endif %}
{% endif %}
;
}
ha-tile-info$: |
.secondary {
visibility: hidden;
}
.secondary:before {
visibility: visible;
white-space: pre-wrap !important;
content: ' '
"Empieza: {{ as_timestamp(state_attr("binary_sensor.meteo_alarma","onset")) | timestamp_custom ("%d-%m-%Y %H:%M") }} " ' '
"Expira: {{ as_timestamp(state_attr("binary_sensor.meteo_alarma","expires")) | timestamp_custom (" %d-%m-%Y %H:%M") }} " ' '
' '
" {{ state_attr("binary_sensor.meteo_alarma","headline") }}. " ' '
" {{ state_attr("binary_sensor.meteo_alarma","description") }} "
}
visibility:
- condition: state
entity: binary_sensor.meteo_alarma
state: 'on'
Can confirm this issue.
The fault is in card-mod with the latest update from homeassistant
Hi, do you know if an update to Card Mod is planned?
I also have the same issue, any workaround known?
I solved it without updating card mod
type: tile
name: Alarma Metereológica
entity: binary_sensor.meteo_alarma
show_entity_picture: true
vertical: false
hide_state: false
icon_tap_action:
action: none
tap_action:
action: more-info
visibility:
- condition: state
entity: binary_sensor.meteo_alarma
state: 'on'
card_mod:
style:
.: |
ha-card {
{%if is_state('binary_sensor.meteo_alarma', 'off')%}
--card-mod-icon-color: grey;
{%- else -%}
{% if is_state_attr('binary_sensor.meteo_alarma','awareness_level', '2; yellow; Moderate') %}
--card-mod-icon-color: yellow;
{%- else -%}
{% if is_state_attr('binary_sensor.meteo_alarma','awareness_level', '3; orange; Severe') %}
--card-mod-icon-color: orange;
{%- else -%}
{% if is_state_attr('binary_sensor.meteo_alarma','awareness_level', '4; red; High') %}
--card-mod-icon-color: red;
{% endif %}
{% endif %}
{% endif %}
{% endif %}
;
}
ha-card {
--tile-color: transparent !important;
}
ha-tile-info {
height: 115px;
}
ha-tile-info$: |
.primary {
visibility: visible;
}
.secondary {
visibility: visible;
}
.secondary:after {
visibility: visible;
position: absolute;
left: 0px;
right: -180px;
top: 38px;
white-space: pre-wrap !important;
content:
"Empieza: {{ as_timestamp(state_attr("binary_sensor.meteo_alarma","onset")) | timestamp_custom ("%d-%m-%Y %H:%M") }} "
"Expira: {{ as_timestamp(state_attr("binary_sensor.meteo_alarma","expires")) | timestamp_custom (" %d-%m-%Y %H:%M") }} "
'- '
" {{ state_attr("binary_sensor.meteo_alarma","headline") }}. "
" {{ state_attr("binary_sensor.meteo_alarma","description") }} "
}
Before:
After: