Color icons in header bar based on state

Edit: sorry, this question is not very clear. I am interested in changing the color of icons for different lovelace views in HA header. See my other post below.

original post:

Custom header is no longer maintained. I really liked the feature to change icon color based on a state or template. E.g. my plant tab icon turned red if flowers need water, etc.

Is there a way to achieve this without custom header?

Thanks

Like this?
https://community.home-assistant.io/t/lovelace-button-text-card/210687/8

Thanks for your reply. I guess I was not very clear :slight_smile: This is my home assistant header showing icons for the different views.

Note the different colors per icon (yellow, …), which are defined based on the following in my lovelace config (see tabs_color)

custom_header:
  active_tab_color: var(--state-icon-active-color)
  tabs_color:
    lights: >-
      {% if is_state('group.all_lights', 'on') %} var(--label-badge-yellow) {% endif %}
    climate: >-
      {% if states('sensor.humidity_max') | float >= 70 %}
      var(--label-badge-red) {% elif states('sensor.humidity_max') | float >= 60 %} var(--label-badge-yellow) {% endif %}
    floorplan: >-
      {% if is_state('group.all_windows', 'on') %} var(--label-badge-yellow) {% endif %}
    plants: >-
      {% if is_state('group.all_plants', 'problem') %} var(--label-badge-red) {% endif %}
    misc: >-
      {% if is_state('switch.coffee_plug', 'on') %} var(--label-badge-yellow) {% endif %}

Since this requires custom header, which is now archived and no longer maintained, I am looking for a new way to generate the same result (changing icon color based on some template)

3 Likes

hi, I am also looking a solution for this. have you found any?
Thank

Not really. :frowning: