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

Bug in value_template #899

Open
roumano opened this issue Mar 5, 2025 · 2 comments
Open

Bug in value_template #899

roumano opened this issue Mar 5, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@roumano
Copy link

roumano commented Mar 5, 2025

Before submitting a bug

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

Describe the bug
i'm using value_template in order to round the value, otherwise i get many number after the comma

Via this kind of code :

stats:
  default:
    - entity_id: sensor.q7_max_temps_restant_filtre
      unit: heure
      value_template: "{{ value | float(0) | round(0) }}"
      subtitle: Filtre
    - entity_id: sensor.q7_max_temps_restant_brosse_laterale
      value_template: "{{ value | float(0) | round(0) }}"
      unit: heure
      subtitle: Brosse Latérale
...

It's working most of the time, but sometime (can't always reproduce), it's not rounding value

Steps to reproduce

  1. Use round value via value_template:
  2. Use the type: custom:vacuum-card
  3. Sometime, it's will not round anymore value

Expected behavior
Value should be always as precise in the value_template

Screenshots

  • When it's working as expected :
* When it's NOT working as expected :

Versions:

  • Release: [v2.10.1]
  • Browser: [firefox + home assistant compagnion (android app to connect to HA]
  • HomeAssistant version: [2025.01.4]
@roumano roumano added the bug Something isn't working label Mar 5, 2025
@guanaco0403
Copy link

I have the same issue on my side, its verry anoying

@killi199
Copy link

killi199 commented Mar 6, 2025

I use this code and I don't have recognized this Problem using Chrome and the Android App:

stats:
  default:
    - entity_id: sensor.roborock_q_revo_verbleibende_filterzeit
      value_template: "{{ value | round(1) }}"
      unit: h
      subtitle: Filter
    - entity_id: sensor.roborock_q_revo_verbleibende_zeit_der_seitenburste
      value_template: "{{ value | round(1) }}"
      unit: h
      subtitle: Seitenbürste
    - entity_id: sensor.roborock_q_revo_verbleibende_zeit_der_hauptburste
      value_template: "{{ value | round(1) }}"
      unit: h
      subtitle: Hauptbürste
    - entity_id: sensor.roborock_q_revo_verbleibende_sensorzeit
      value_template: "{{ value | round(1) }}"
      unit: h
      subtitle: Sensoren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants