history-explorer-card icon indicating copy to clipboard operation
history-explorer-card copied to clipboard

stateColors ignored for binary sensor with device class (and state translation)

Open lisz8 opened this issue 4 months ago • 0 comments

You can configure state colors for timeline charts, e.g.

type: custom:history-explorer-card
stateColors:
  on: --state-active-color
  off: --state-icon-color
graphs:
  - type: timeline
    entities:
      - entity: binary_sensor.gate

However, colors are ignored if binary sensor has a device class (like "gate", "garage gate", etc.), which changes state text displayed. Also, my frontend lagnuage is Polish, so the text gets translated:

states("binary_sensor.gate") --> "off"
state_translated("binary_sensor.gate") --> "zamknięto" ("closed" in English)

I tried adding both English and Polish translations to stateColors but it didn't change the color.

stateColors:
  on: --state-active-color
  off: --state-icon-color
  closed: --state-icon-color
  zamknięto: --state-icon-color

lisz8 avatar Oct 05 '24 21:10 lisz8