more disaster:
filter:
template: >
[{% set threshold = states('input_number.power_threshold')|float(0) %}
{% for s in states.sensor
|rejectattr('entity_id','search','solaredge|samen')
|selectattr('entity_id','search','_actueel|_current_power')
if s.state|float(0) > threshold %}
{{
{
'entity': s.entity_id,
'card_mod':
{'style':
':host {
--card-mod-icon-color:
{% set state = states(config.entity)|float(-5) %}
{% if state > 2000 %} purple
{% elif state > 1000 %} maroon
{% elif state > 450 %} darkred
{% elif state > 300 %} firebrick
{% elif state > 250 %} crimson
{% elif state > 150 %} darkorange
{% elif state > 70 %} orange
{% elif state > 10 %} lightsalmon
{% elif state > 0 %} var(--power-color)
{% else %} var(--no-power-color)
{% endif %};
}'
}
}
}},
{%- endfor %}]
no longer colors the icon based on states.
simpler version of that:
style: |
:host {
{% set signal = states(config.entity)|int(-5) %}
--card-mod-icon:
{% if signal == 'unknown' %} mdi:help
{% elif signal >= 80 %} mdi:wifi-strength-4
{% elif signal >= 50 %} mdi:wifi-strength-3
{% elif signal >= 40 %} mdi:wifi-strength-2
{% elif signal >= 30 %} mdi:wifi-strength-1
{% elif signal >= 20 %} mdi:wifi-strength-outline
{% else %} mdi:wifi-strength-alert-outline
{% endif %};
--card-mod-icon-color:
{% if signal == 'unknown' %} gray
{% elif signal >= 80 %} darkgreen
{% elif signal >= 50 %} green
{% elif signal >= 40 %} lightgreen
{% elif signal >= 30 %} gold
{% elif signal >= 20 %} orange
{% else %} maroon
{% endif %};
}
all stopped being appliedā¦icon or icon-color
this must be some generic dom path thingy change, or otherwise were borked. been working for, well, years
setting a straight forward simple color and icon doesnāt work either, so its not the template (of course it isnt)
really need some help test running the beta cycle this time, hope anyone of you can join.
We should consider this the end of times of card_mod orā¦ hope its a simple matter of adapting our mods in the config. given the amount of trouble I now see, I fear the formerā¦
in the UI:
type: entities
entities:
- entity: sensor.slaapkamer_hygro_temp_temperature
name: Slaapkamer
card_mod:
style: |
:host {
--card-mod-icon-color: red;
}
and yet, these all do work as before:
entities:
- entity: sensor.ws_5500_wind_direction
name: Wind Direction
card_mod: !include /config/dashboard/card_mods/wind_richting.yaml
- entity: sensor.ws_5500_wind_gust
name: Wind Gust
card_mod: !include /config/dashboard/card_mods/wind_snelheid_kmu.yaml
- entity: sensor.ws_5500_max_daily_gust
name: Max Daily Gust
card_mod: !include /config/dashboard/card_mods/wind_snelheid_kmu.yaml
or even
in a glance card
and they have the exact same format:
#wind_direction:
style: |
:host {
--card-mod-icon:
{% set dir = states(config.entity)|int(0) %}
{% set icons = ['down','bottom-left','left','top-left','up','top-right',
'right','bottom-right'] %}
{% set quadrant = (dir/45)|round %}
{% if quadrant < icons|count %} mdi:arrow-{{icons[quadrant]}}
{% else %} mdi:arrow-down
{% endif %};
}
or
# wind_snelheid:
style: |
:host {
--card-mod-icon-color:
{% set state = states(config.entity)|int(-5) %}
{% if state == 'unknown'%} gray
{% elif state < 0.5 %} lightblue
{% elif state < 1.5 %} paleturquoise
{% elif state < 3.3 %} aquamarine
{% elif state < 5.5 %} greenyellow
{% elif state < 7.9 %} lime
{% elif state < 10.7 %} mediumspringgreen
{% elif state < 13.8 %} yellowgreen
{% elif state < 17.1 %} navy
{% elif state < 20.1 %} gold
{% elif state < 24.4 %} orange
{% elif state < 28.4 %} tomato
{% elif state < 32.6 %} orangered
{% else %} crimson
{% endif %};
}
so its truly mesmerizing some of these work, and some dont