I’ve been trying to sort this out for a few days now and not having any luck searching or trying things. With card-mod, I can change things about the ha-card in a horizontal-stack, but how would I change individual icons based on color and state? I’ve drilled into inspecting the html and I can find the area for the individual icons, just can’t figure out how to specify that. In the case of the battery item below, what do I specify in the place of ha-state-icon to get this working. Or am I completely off base?
Thanks so much for any hints!
- type: horizontal-stack
cards:
- camera_view: auto
type: picture-glance
image: http://homeassistant.local:8123/local/Ford_Explorer3.gif
entities:
- entity: sensor.fordpass_battery
show_state: false
card_mod:
style: |
ha-state-icon {
{% if is_state('sensor.fordpass_battery','STATUS_GOOD') %}
color: green !important;
{% else %}
color: yellow;
{% endif %}
}
- entity: sensor.fordpass_doorstatus
show_state: true
- entity: sensor.fordpass_fuel
show_state: true
- entity: sensor.fordpass_oil
- entity: sensor.fordpass_tirepressure
card_mod:
style: |
ha-card {
height: 142px !important;
}
state-badge $: |
ha-state-icon {
{% if is_state('sensor.fordpass_battery','STATUS_GOOD') %}
color: green !important;
{% else %}
color: yellow;
{% endif %}
}