I’m trying to color the secondary info text of an Enteties card using Card_mod.
This also works as follows:
card_mod:
style:
hui-generic-entity-row $: |
.info.pointer .secondary ha-relative-time {
color: red;
}
However, if I try to combine this with other CSS code, it does not work.
card_mod:
style: |
.entities-row div.entity:nth-child(1) {
color: green;
}
hui-generic-entity-row $: |
.info.pointer .secondary ha-relative-time {
color: red;
}
Is there a way to combine both?
The whole code should be something like this:
type: vertical-stack
cards:
- type: entities
entities:
- entity: sensor.temphum_arbeitszimmer_jo_temperature
type: custom:multiple-entity-row
secondary_info: last-changed
format: precision1
name: Arbeitszimmer Jo
styles:
width: 50px
text-align: right
entities:
- entity: sensor.tc_temphum_arbeitszimmer_jo_absolute_luftfeuchtigkeit
name: false
format: precision1
styles:
width: 80px
text-align: right
- entity: sensor.temphum_arbeitszimmer_jo_humidity
name: false
format: precision1
styles:
width: 50px
text-align: right
card_mod:
style: >
{% if
(float(states('sensor.tc_temphum_arbeitszimmer_jo_absolute_luftfeuchtigkeit'))
-
float(states('sensor.tc_temphum_balkon_kue_absolute_luftfeuchtigkeit')))
> 5 %} .entities-row div.entity:nth-child(1) {
color: orange;
} {% endif %} {% if
float(states('sensor.temphum_arbeitszimmer_jo_humidity')) > 60 %}
.entities-row div.entity:nth-child(2) {
color: orange;
} {% endif %}
hui-generic-entity-row $: |
.info.pointer .secondary ha-relative-time {
{% set last_updated = states.sensor.temphum_arbeitszimmer_jo_temperature.last_updated %}
{% set time_difference = as_timestamp(now()) - as_timestamp(last_updated) %}
{% if time_difference > 1800 %}
color: orange;
{% endif %}
}
title: Temperatur / Luftfeuchtigkeit
state_color: false