Dielee / volvo2mqtt

Home Assistant addon for connecting AAOS Volvos
MIT License
143 stars 31 forks source link

"Average Energy Consumption" as "state_class: measurement" #175

Closed Grumblezz closed 6 months ago

Grumblezz commented 7 months ago

I have recently used this addon, and I loved it, as I was quite happy to see that I was able to read so many sensors. Anyways, as I was creating a dashboard with the various entities, but then I noticed that the Average Energy Consumption is not created with the option state_class: measurement. Whilst for example the Average Speed is created with this option enabled, and thus it allows to do historical (in my case monthly) statistics. As the Average Energy Consumption is a useful indicator to the driving style, therefor I wanted to plot these over an longer timeframe.

This is shown in the MQTT Debug panel for the Average Energy Consumption: image

And the Average Speed is what is shown for an entity which has the state_class: measurement enabled: image

Please add the state_class: measurement for the Average Energy Consumption.

Grumblezz commented 7 months ago

I found in the const.py the entities, but I don't know how I could test it in HA... otherwise I would have created an pull request :) https://github.com/Dielee/volvo2mqtt/blob/907440b81e8e2ba54dd11426b7328dd1070701c7/src/const.py#L125

Into: {"name": "Average Energy Consumption", "domain": "sensor", "id": "average_energy_consumption", "unit": ENERGY_KILO_WATT_HOUR, "icon": "car-electric", "url": STATISTICS_URL, "state_class": "measurement"},

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 15 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 6 months ago

This issue was closed because it has been stalled for 5 days with no activity.