t1gr0u / uv-index-card

A Lovelace card that shows a the UV index and risk level for Home Assistant
MIT License
24 stars 20 forks source link

Entity precision ignored #13

Closed WoBBeLnl closed 1 year ago

WoBBeLnl commented 1 year ago

Checklist:

Release with the issue: 1.10 & 1.2.0

Last working release (if known): None

Browser and Operating System: Multiple systems/browsers including Android Companion App

Description of problem:

The precision set for my Max UV Index (see screenshots) gets ignored by the UV index card. I have rounded the entity but it still shows on the card, HA itself shows it rounded to 1 decimal (as configured).

uv1 uv2

t1gr0u commented 1 year ago

@WoBBeLnl the card doesn't manipulate the entity, it display what it receives. How do you set the precision on the entity? Do you set a new entity? What value do you get when viewing the entity in the developer tools --> states?

WoBBeLnl commented 1 year ago

How do you set the precision on the entity?

Do you set a new entity?

What value do you get when viewing the entity in the developer tools --> states?

I've added a few screenshots chaning my HA to English.

https://developers.home-assistant.io/blog/2023/02/08/sensor_presentation_rounding Released 2023.2 https://www.home-assistant.io/blog/2023/02/01/release-20232/ Some more info https://www.home-assistant.io/blog/2023/03/01/release-20233/#sensor-display-precision

Not sure how a addon works, but with templating you can choose to use the rounding. https://www.home-assistant.io/docs/configuration/templating/#formatting-sensor-states

entity_configuration states

t1gr0u commented 1 year ago

@WoBBeLnl thank you will try and have a look :)

t1gr0u commented 1 year ago

@WoBBeLnl I had a look and here are my findings: I installed the OpenUV integration and added precision to the Max UV Index

Screenshot 2023-05-10 at 21 52 49

Then added some debug to the code and this is what I get back from the entity:

Screenshot 2023-05-10 at 21 52 14

As you can see, the precision value is not returned :( and I haven't got a way to get this value.

WoBBeLnl commented 1 year ago

Ah thats a bummer. HA is not providing, thats a bummer.