Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value 0 shown as 0.0 #335

Open
iz8mbw opened this issue Mar 28, 2024 · 3 comments
Open

Value 0 shown as 0.0 #335

iz8mbw opened this issue Mar 28, 2024 · 3 comments

Comments

@iz8mbw
Copy link

iz8mbw commented Mar 28, 2024

Hello.
I use "lovelace-multiple-entity-row" mainly to show switches to turn on and turn off lights and see as second entity the power (in Watt).

See here:
image

As you can see, when the switches are off the Power value is 0.0 W (this is the default when Home Assistant boot/starts).
If I turn on the switch I can see the Power value in watt (using the default entity decimals) but when I turn off the Power value becomes 0 W (and so not more 0.0 W).
See here:
image

So it seems that by default (when Home Assistant boot/starts) the default value is "0.0" but after a value changes and when it come back to zero, it changes from "0.0" to "0".

Well, is it possible to always show "0" and not "0.0" or "0.00" when the value is 0 and have one or more 0 decimals?

Thanks.

@ildar170975
Copy link

I would suggest you to check the entity’s state in Dev tools after HA boot and after turning on/ off.

@iz8mbw
Copy link
Author

iz8mbw commented Apr 2, 2024

What I discovered is that "lovelace-multiple-entity-row" is using the decimals for "0" provided by Home Assistant so it seems the number of decimals after 0 is a value that come back from Home Assistant per each specific entity.
So if/when an entity has one decimal after zero (0.0) or two decimals after zero (0.00), "lovelace-multiple-entity-row" is going to use that values.
So it seems a "behaviour" of Home Assistant and not an issue of "lovelace-multiple-entity-row".

Anyway, if in some way can be possible to "force" the number of decimals to use when the value is zero it will be very usefull.

Thanks.

EDIT:
I cannot reach my goal using "precision" field since it will always affect decimals not only when the number is 0 or 0.0 or 0.00

@bisquit2003
Copy link

I have a similar problem. The sensor transmits a value, for example 38.5 (everywhere in the interface and in the developer panel), and the card may contain a large number of numbers after the decimal point. I noticed that this happens with xiaomi ble sensors
IMG_5302
IMG_5303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants