Skip to content

fix: Add missing state_class to MQTT HA discovery topics - #61

Merged
BorisBrock merged 1 commit into
BorisBrock:mainfrom
sebatze:fix/ha-mqtt-state-class-and-missing-phase-sensors
Apr 21, 2026
Merged

BorisBrock merged 1 commit into
BorisBrock:mainfrom
sebatze:fix/ha-mqtt-state-class-and-missing-phase-sensors

Conversation

@sebatze

@sebatze sebatze commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Problem
Home Assistant only records long-term statistics (and shows sensors in the Energy Dashboard) for sensors that have a state_class in their MQTT discovery payload. Additionally, charging_current phase 2 & 3 and all three charging_voltage phases were published to MQTT but had no discovery topics, making them completely invisible to Home Assistant.

Changes

Add "state_class":"measurement" to charging_power, charging_current, charging_current_limit, and temperature
Add missing HA discovery topics for charging_current phase 2 & 3
Add missing HA discovery topics for charging_voltage phase 1, 2 & 3
Rename charging_current discovery topic to charging_current_phase1 for consistency
Reference: https://www.home-assistant.io/more-info/statistics/

@BorisBrock

Copy link
Copy Markdown
Owner

@sevorl Hi, danke für den PR. In den Osterferien habe ich hoffentlich Zeit draufzuschauen und ihn zu testen. Könntest du noch die Konflikte auflösen?

- Add state_class:measurement to charging_power, charging_current,
  charging_current_limit, and temperature sensors so HA records
  long-term statistics and shows them in the Energy Dashboard
- Add missing discovery topics for charging_current phase 2 and 3
  (previously published to MQTT but invisible to Home Assistant)
- Add missing discovery topics for charging_voltage phase 1, 2 and 3
  (previously published to MQTT but invisible to Home Assistant)
- Rename charging_current discovery topic from 'charging_current' to
  'charging_current_phase1' for consistency with the new phase sensors
@sebatze
sebatze force-pushed the fix/ha-mqtt-state-class-and-missing-phase-sensors branch from 401ddfc to 97fd9b2 Compare March 30, 2026 06:48
@sebatze

sebatze commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

@BorisBrock, die Konflikte sind gelöst...

@BorisBrock
BorisBrock merged commit 9d9e391 into BorisBrock:main Apr 21, 2026
3 checks passed
@sebatze
sebatze deleted the fix/ha-mqtt-state-class-and-missing-phase-sensors branch April 21, 2026 19:07
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