slipx06 / sunsynk-power-flow-card

⚡A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.
MIT License
184 stars 53 forks source link

general options - show grid - decimal places #390

Closed matomatusov closed 5 months ago

matomatusov commented 5 months ago

Is there an existing issue for this?

Current Behavior

hi, 2 decimal places should be displayed 2

Steps To Reproduce

No response

Expected behaviour

display the number of decimal places according to the setting.

Card Version

4.30.1

Home Assistant Version

2023.12.2

Configuration

No response

Relevant log output

No response

slipx06 commented 5 months ago

Hi. Daily energy values are rounded to one decimal place

auto_scale: Optional true If set to true the card will use the entities unit_of_measurement attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the decimal_places card attribute apart from the daily energy values which are rounded to 1 decimal place
matomatusov commented 5 months ago

Hi, and wouldn't it be possible to have 2 decimal places?

slipx06 commented 5 months ago

It's not part of the current energy conversion function. It would require some code changes but not sure its worth the effort.

slipx06 commented 5 months ago

@matomatusov I've added a new attribute (decimal_places_energy) in the latest release that lets you set the number of decimal places displayed for the daily energy values. https://github.com/slipx06/sunsynk-power-flow-card/releases/edit/v4.32.0

matomatusov commented 5 months ago

Hi, thanks for implementing those decimal places for energy.