Skip to content

feat(ha): dynamic SoC icon reflects charging state - #458

Merged
nanomad merged 1 commit into
developfrom
feat/soc-charging-icon
Jun 24, 2026
Merged

feat(ha): dynamic SoC icon reflects charging state#458
nanomad merged 1 commit into
developfrom
feat/soc-charging-icon

Conversation

@nanomad

@nanomad nanomad commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Adds icon_template to the SoC MQTT discovery payload so HA renders mdi:battery-charging-{N} when the vehicle is charging and the standard mdi:battery-{N} icons otherwise. Thresholds match HA's native battery device_class icon mapping. Requires HA 2024.x for icon_template support in MQTT sensor discovery.

Adds icon_template to the SoC MQTT discovery payload so HA renders
mdi:battery-charging-{N} when the vehicle is charging and the standard
mdi:battery-{N} icons otherwise. Thresholds match HA's native battery
device_class icon mapping. Requires HA 2024.x for icon_template support
in MQTT sensor discovery.
@nanomad
nanomad merged commit 157bed8 into develop Jun 24, 2026
6 checks passed
@danielmsorensen

Copy link
Copy Markdown

@nanomad thanks implementing this change.

I can confirm the icon is now correctly updating based on SoC, however, doesn't seem to be changing based on the charging state.

See the image below which shows the battery is charging, but the SoC icon isn't showing that.
image

I have copied the template from the PR which does seem to correctly show that the icon should be the charging variant.
image

So I wonder if the issue is instead with how the charging_entity_id or soc_icon_template is constructed, meaning that it always falls into the else block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants