Have inactive state go off the hvac_action attribute

I have a heading badge for a climate entity where the state is “heat_cool”. It looks like the entity one has a hvac_mode of “heat_cool”.

I want the icon color (Accent) to come on only when the hvac_action is not “idle”. You will see it is permanently on irrespective of the hvac_action.

How can I fix this?

Thanks


Well, you set a color of this heading’s badge in Config - and now wish to change this color dynamically dependently on some entity, right?
Your possible way is using card-mod: colorize an icon dependently on some entity.
Go to the main card-mod thread (cannot give a link) - go to the 1st post - find a link at the bottom titled “fantastic post” - scroll down to a “Heading card” chapter in that post.
Suggest to ask all card-mod related questions in that thread.

I’ve added card-mod but I have no idea how to write the code and can’t get my head round the instructions.

Are you able to help?

here is the current YAML in the heading:

badges:
  - type: entity
    show_state: true
    show_icon: true
    entity: climate.4_kitchen_neo
    state_content:
      - current_temperature
      - hvac_action
    color: accent
    tap_action:
      action: more-info

I would want the icon and the text to change to a certain colour when hvac_action is heating.

Thanks