I have the following card that lists the current temperature readings from many different locations and color codes them by temp.
Is there a way to dynamically sort them from lowest to highest temperature?
That way, I can at-a-glance see the coldest locations?
Thank you.
type: entities
card_mod:
style: |
:host {
font-size: 20px;
height: 10px;
}
.card-content div {
margin-top: 0px !important;
margin-bottom: 0px !important;
}
entities:
- entity: sensor.pirateweather_temperature
name: Outdoors
icon: mdi:land-fields
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_1001e1064f_blue_water_temperature
name: Blue Water
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.76_thr316_1_water_temperature
name: 76 Water
icon: mdi:water
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_1001dabf2f_temperature
name: 630 Water
icon: mdi:water
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_100139392c_temperature
name: White Water
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
icon: mdi:water
- entity: sensor.sonoff_1001393418_temperature
name: Purple Water
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
icon: mdi:water
- entity: sensor.well_ecobee_temperature
name: Well
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.125_1st_floor_temperature
name: 125 1st Fl
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.125_2nd_floor_temperature
name: 125 2nd Fl
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_100182a1cc_temperature
name: 125 Attic
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.371_carmine_413709040008_temperature
name: 371 Carmine Hydronic
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.371_meadow_416484569487_temperature
name: 371 Meadow Hydronic
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.371_bedroom_temperature
name: 371 Meadow Front BR
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.371_large_bedroom_temperature
name: 371 Meadow Large BR
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.371_1st_floor_temperature
name: 371 1st Fl
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.371_2nd_floor_temperature
name: 371 2nd Fl
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.371_hydronic_temperature
name: 371 Hydronic
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.carmine_temperature
name: 371 Carmine
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_1001829f81_temperature
name: 371 Eddie
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.76_ecobee_temperature
name: 76
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_10013932b1_temperature
name: 629
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.630_ecobee_temperature
name: 630
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.1st_floor_room_temperature
name: 255 1st Fl
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.2nd_floor_east_room_temperature
name: 255 2nd Fl East
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.2nd_floor_west_room_temperature
name: 255 2nd Fl West
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.3rd_floor_room_temperature
name: 255 3rd Fl
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_1001392bce_temperature
name: White
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.blue_lr_ecobee_temperature
name: Blue Ecobee
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_1001dabe7c_temperature
name: Blue THR316
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_100139390d_temperature
name: Blue Closet
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_1001829f54_temperature
name: Green
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.sonoff_1001392bd9_temperature
name: Purple THR316
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
- entity: sensor.shop_temperature
name: Shop
card_mod:
style: |
:host {
{% if states(config.entity) | int <= 32 %}
{% set COLOR = 'blue' %}
{% elif states(config.entity) | int <= 48 %}
{% set COLOR = 'aqua' %}
{% elif states(config.entity) | int <= 62 %}
{% set COLOR = 'burlywood' %}
{% elif states(config.entity) | int <= 70 %}
{% set COLOR = 'orange' %}
{%- else %}
{% set COLOR = 'red' %}
{% endif %}
--card-mod-icon-color: {{COLOR}};
color: {{COLOR}};
}
This is what it looks like: