Card_mod Change color of icon for current state and last changed

Hi guys,

I am struggeling with the following challenge, I have the following entity-filter:

type: entity-filter
entities:
  - entity: binary_sensor.bad_fensterkontakt
    card_mod:
      style:
        hui-generic-entity-row $:
          state-badge $: |
            ha-state-icon {
              {% if is_state(config.entity,'on') %}
              color: green !important;
            {% endif %}
            }

Is the window open, the icon color changes to green, now I want also the following:

The color should change into yellow if the windows is open since half an hour.
And the color should change into red if the entity “sensor.terasse_sensor_luftfeuchtigkeit” is higher than 60. The entity “sensor.terasse_sensor_luftfeuchtigkeit” is for the outside humidity :slight_smile:

Can someone assist?
Many thanks

solved by myself