ThomDietrich / miflora-mqtt-daemon

Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼πŸ₯€πŸ‘🌳
MIT License
606 stars 141 forks source link

Set state_class to support HA long term statistics #158

Closed cbarreholm closed 1 year ago

cbarreholm commented 1 year ago

By setting the state_class="measurement" in accordance with https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics we can leverage the long term statistics of Home Assistant.

Here is an example where I have configured three Xiamo Mi Flora devices and plotting the temperature over time. image Before making the change in this change I was not able to pick those entities, due to the missing state_class.

ThomDietrich commented 1 year ago

Agree, this is a needed change :) Thanks for the PR!!