flixlix / energy-flow-card-plus

An upgraded Energy Distribution Card for Home Assistant, with added features like Individual Devices and refined UI enhancements, while maintaining the Energy Dashboard's original design.
146 stars 7 forks source link

[FEATURE REQUEST] Drop decimals for values when they're above x kWh (for example 100) #61

Open erikgeurts opened 1 year ago

erikgeurts commented 1 year ago

When looking at energy consumption or generation for a single day or a shorter period of time, it makes sense (at least for me) to see the values with 1 decimal, for example: image

However, for longer date ranges or for high energy devices, the decimals aren't that important anymore: image

I'd like to propose that a setting is added, that acts as a user defined threshold. Below the threshold, the values are displayed with decimals, above it, they are rounded to whole numbers.

To some extent, that could even be similar to the way we can define the number of decimals for Watthours and Kilowatthours separately now, there would be a third setting that only applies to values once they've crossed the user-defined threshold, for example 25 kWh or perhaps 100 kWh. Personally I'd set that to 0 decimals, but others might prefer a more detailed view.

flixlix commented 1 year ago

Hi, I think this would get out of hand relatively quickly in terms of the implementation / ui-editor. I would recommend creating a template entity that rounds to different decimal places depending on its value.

I'm assuming you are also requesting this to avoid overflows in case of very large numbers. In that case, I would recommend using the new Mwh unit revealed in 0.1.2

erikgeurts commented 1 year ago

I like the notion of a MWh setting, and I will have a look once that's available. However, that's not going to be helping me for this specific case (as an example): image In this kind of situation, I'd like Solar to automatically switch to rounding to 308 kWh and so on.

I understand your hesitation, but I don't think using a template to make the numbers look nice and round is a good approach. This is a presentation issue, not a data issue.