unixorn / ha-mqtt-discoverable

Python module to create MQTT entities that are automatically discovered by Home Assistant
Apache License 2.0
98 stars 24 forks source link

Support for state_class property on sensors #96

Closed AnotherDaniel closed 1 year ago

AnotherDaniel commented 1 year ago

Certain features in Home Assistant (e.g. Energy dashboard) require sensors be marked up with the "total_increasing" state_class property - there might be other cases, this is the one I've run into.

Now even while I try to publish state_class information for sensors in my code (https://github.com/AnotherDaniel/smahub - the ha_mqtt plugin), this does not make it's way into the MQTT ha autodiscovery topics.

So the request is to add Sensor state_class property publication to ha-mqtt-discoverable.