bimmerconnected / bimmer_connected

🚘 Library to query the status of your BMW or Mini from the ConnectedDrive portal
Apache License 2.0
362 stars 79 forks source link

A suggestion: add the 'state_class' property for the fuel and mileage entities to use the 'statistic' function in HA #398

Closed muxiachuixue closed 1 year ago

muxiachuixue commented 2 years ago

Describe the issue

The question: The historical data of the car in HA only applies to the past 10 days for default. If you want to analyse the fuel consumption for past several months, you can only set the parameter keep_days in recorder to a larger value which will impact all the entities in HA and increase the size of the database file.

The solution: According to the official instruction of HA, if a sensor entity contains the state_class property and the value is measurement, the statistic function will be available. So it will be useful if the state_class property is added to the mileage/fuel_percent/remaining_range entities.

Looking forward to see the update. Many thanks for your great work!

Expected behavior

Add the state_class property for the fuel and mileage entities to use the 'statistic' function in HA

Which Home Assistant version are you using?

core-2021.12.7

What was the last working version of Home Assistant Core?

No response

What is your region?

China

ConnectedDrive website

Number of cars

Output of bimmer_connected fingerprint

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

rikroe commented 2 years ago

Thanks, good idea! I'll have a look into this.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.