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

Teslametry gives long entity states when its set to nothing afther the dot #137749

Closed
twanjaarsveld opened this issue Feb 7, 2025 · 5 comments
Closed

Comments

@twanjaarsveld
Copy link

The problem

i've changed the state to be 2 characters long but when i pull for the state it gives me many characters after the dot

Image
Image

What version of Home Assistant Core has the issue?

core-2025.2.0

What was the last working version of Home Assistant Core?

core-2025.1.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Teslametry

Link to integration documentation on our website

https://www.home-assistant.io/integrations/teslemetry/

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Feb 7, 2025

Hey there @Bre77, mind taking a look at this issue as it has been labeled with an integration (teslemetry) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of teslemetry can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign teslemetry Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


teslemetry documentation
teslemetry source
(message by IssueLinks)

@Bre77
Copy link
Contributor

Bre77 commented Feb 7, 2025

Display precision is only in Home Assistant dashboards, the actual data provided by Tesla has all that extra precision which is why it's shown in the developer tool.

If you have a reason to need the actual state value to be rounded you can use a template sensor.

@twanjaarsveld
Copy link
Author

Weird that it worked just fine until the last update

[[[ return states['sensor.tesla_battery_level'].state + '%'; ]]]

but ill try and make a tamplate sensor thanks for the tip

@twanjaarsveld
Copy link
Author

This fixed it for me
[[[ return Math.floor(states['sensor.tesla_battery_level'].state) + '%'; ]]]

@Bre77
Copy link
Contributor

Bre77 commented Mar 27, 2025

@home-assistant close

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

No branches or pull requests

2 participants