Glance-Card working example of icon color based on sensor state

I’ve been searching a while to found an example performing icon color change in Glance-Card based on the states of sensor

I’ve an Shelly 1PM connected to an radiator
I’ve an Xiaomi window sensor to cut the power of the radiator when window is opened
image

Using HACS card-mod plugin and ShellyForHass intégration

I was looking to change the color of the window sensor, green when window open, standard color otherwise.
For the radiator, grey when the Shelly relay is off, standard color if relay if on but radiator off and red if radiator is powered.
I was also looking to change the radiator icon from mdi:radiator-disabled to mdi:radiator when heating is on but this is not possible yet I think.

This is my Glance-card configuration

  - entity: binary_sensor.xdw_br11_window
    name: Fenêtre
    style: |
      :host {
        --iron-icon-fill-color: 
          {% if is_state('binary_sensor.xdw_br11_window', 'on') %}
            rgb(0, 204, 102)
          {% else %}
            rgb(68, 115, 158)
          {% endif %}
          ;
      }
  - entity: switch.shelly_shsw_pm_766afc
    name: Prise
    icon: 'mdi:radiator-disabled'
    style: |
      :host {
        --iron-icon-fill-color: 
          {% if is_state('switch.shelly_shsw_pm_766afc', 'off') %}
            grey
          {% elif states.sensor.shelly_shsw_pm_766afc_current_consumption.state | int > 10 %}
            red
          {% else %}
            rgb(68, 115, 158)
          {% endif %}
          ;
      }    
  - entity: sensor.shelly_shsw_pm_766afc_current_consumption
    name: Chauffage
    style: |
      :host {
        --iron-icon-fill-color: rgb(255, 153, 102)
      }

I’m trying to do a similar thing with a picture glance but not having much joy. I want the light icon to be white when off (default) but yellow or solid yellow when on. Any thoughts on that?

aspect_ratio: 50%
camera_image: camera.proxy_entry_720_2fps
camera_view: live
entities:
  - entity: lock.frontdoor_deadbolt
  - entity: light.foyer_front_light
  - entity: script.activate_gateway_siren
type: picture-glance

Looks exactly like something im trying to do but it simply doesnt work. I have tried using the examples, i have also tried changing :host to :ha-card and --iron-icon-fill-color to --paper-item-icon-color. None of this seems to work (change the icon color)

  1. Picture glance card, not a Glance card.
  2. Card-mod thread - 1st post - link at the bottom