Picture Elements Card and State attributes

I’m using a Picture Elements Card to make a replica Air Conditioning control panel for an AitTouch 4 system. I’ve got it working all bar one issue.

When I added the AC modes I used an image element. As per the configuration variables below the card picks up cool, fan_only etc. And works.

  - type: image
    entity: climate.ac_0
    style:
      top: 60%
      left: 53.7%
      title: null
      width: 10%
    state_image:
      cool: http://192.168.86.25:8123/local/mode_cool.png
      fan_only: http://192.168.86.25:8123/local/mode_fan_only.png
      dry: http://192.168.86.25:8123/local/mode_dry.png
      heat: http://192.168.86.25:8123/local/mode_heat.png
      auto: http://192.168.86.25:8123/local/mode_auto.png
      'off': http://192.168.86.25:8123/local/power_off.png

The problem I have is when trying to create another image element for the fan. I can’t work out what I need to add as the state_image: is not detecting the fan state attributes of high, medium, low, and auto. (auto is also a duplicate as that’s under hvac_modes:

  - type: image
    entity: climate.ac_0
    style:
      top: 60%
      left: 84.5%
      title: null
      width: 10%
    state_image:
      low: http://192.168.86.25:8123/local/fan_low.png
      medium: http://192.168.86.25:8123/local/fan_med.png
      high: http://192.168.86.25:8123/local/fan_high.png
      auto: http://192.168.86.25:8123/local/fan_auto.png

It appears as though the Picture Elements Card is only discovering the State attributes under hvac_modes and not those under Fan_modes. Do I need to add something like attribute: fan_mode somewhere in the - type: image?

The entity State attributes are

hvac_modes:
  - cool
  - fan_only
  - dry
  - heat
  - auto
  - 'off'
min_temp: 7
max_temp: 35
fan_modes:
  - high
  - medium
  - low
  - auto
current_temperature: 25.9
temperature: null
fan_mode: high
friendly_name: AC 0
supported_features: 9

Did you find solution?

I think the issue is that it only looks at the main state of the entity, which is the current hvac mode, and not the attributes. If there is no way to tell it to look at a specific attribute (in this case, fan_mode), you can create a template sensor that just duplicates the attribute and then use that as an input for the image element.

I think the only element that supports looking at state attributes at the moment is the state-label one. It would be nice if the others did as well, but until they do, an intermediate template sensor does the job. See here for how these things work: Template - Home Assistant