history-explorer-card
history-explorer-card copied to clipboard
stateColors ignored for binary sensor with device class (and state translation)
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