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

Accuracy setting from the entity is ignored #25

Open
CommanderKSK opened this issue Jun 6, 2023 · 7 comments
Open

Accuracy setting from the entity is ignored #25

CommanderKSK opened this issue Jun 6, 2023 · 7 comments

Comments

@CommanderKSK
Copy link

Checklist:

  • [ X] I updated to the latest version available
  • [ X] I cleared the cache of my browser

Release with the issue:

Last working release (if known):-

Browser and Operating System:-

Description of problem:The card displays all 4 decimals like (7,2669) even if you set the accuracy in Home Assistant to a full number (7 in this case) it ignores this and still displays all 4 decimals.

Javascript errors shown in the web inspector (if applicable):-


**Additional information:
Screenshot_20230606-124349
Screenshot_20230606-124851
**

@CommanderKSK CommanderKSK added the bug Something isn't working label Jun 6, 2023
@t1gr0u
Copy link
Owner

t1gr0u commented Jun 6, 2023

@CommanderKSK Thank you for using the card, please read issue #13

@t1gr0u t1gr0u removed the bug Something isn't working label Jun 6, 2023
@bluediamond1984
Copy link

@t1gr0u I have read the issue and did some digging. According to the docs the formatting is controlled with rounded=True. https://www.home-assistant.io/docs/configuration/templating/#states

I have the rounded value in the developer tools with this {{ states('sensor.current_uv_index', rounded=True) }}
Hopefully this helps solving this issue.

@t1gr0u
Copy link
Owner

t1gr0u commented Jun 8, 2024

@bluediamond1984 oohhh, interesting, thank you, this may help :)

@hajo62
Copy link

hajo62 commented Jul 26, 2024

I have the rounded value in the developer tools with this {{ states('sensor.current_uv_index', rounded=True) }}
Hopefully this helps solving this issue.

@bluediamond1984: Hhm, I would need more help.
Have you created a new template sensor with the rounded value or is there a way to modify the value of the original sensor?

@t1gr0u : Maybe you could add a round parameter? to your card?

@bluediamond1984
Copy link

A template sensor is not needed. sensor.current_uv_index was created by the integration OpenWeatherMap. I have recently changed to OpenUV, and it works the same.

In the GUI go to the entity settings and change the display precision to desire.

@hajo62
Copy link

hajo62 commented Jul 26, 2024

In the GUI go to the entity settings and change the display precision to desire.

Did so an it reflects i.e. in the integrations site, but not on the card.
image
image

@bluediamond1984
Copy link

I misunderstood it. I used the developer tools to see the difference in the first place.
image

I have tested it with a template sensor and it's working with a rounded number.

I was trying to figure out what has to be added. I think something has to be added with this line in the code const entityState = entityId ? this.hass.states[entityId] : undefined;. But I don't understand the language.

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

4 participants