lovelace-card-templater icon indicating copy to clipboard operation
lovelace-card-templater copied to clipboard

Wrapped gauges jump to zero before updating to new value

Open StephanSchuster opened this issue 2 years ago • 4 comments

This updates seamlessly:

type: gauge
entity: sensor.solaredge_battery1_state_of_charge
name: Batterieladung
needle: true
min: 0
max: 100
severity:
  red: 0
  yellow: 15
  green: 50

Here the needle quickly jumps to 0 before moving to the new value:

type: custom:card-templater
card:
  type: gauge
  entity: sensor.solaredge_battery1_state_of_charge
  name: Batterieladung
  needle: true
  min: 0
  max: 100
  severity:
    red: 0
    yellow: 15
    green: 50
entities:
  - entity: sensor.solaredge_battery1_state_of_charge
    state_template: '{{ states("sensor.solaredge_battery1_state_of_charge") | round(0) }}'

This looks awkward and currently requires me to write a template sensor just to round the value.

StephanSchuster avatar Mar 22 '22 19:03 StephanSchuster

I am having the same issue, but using it for RSSI BLE topics, where the thresholds are changing. The gauge is also jumping to zero every refresh of the value. Does not matter if I use this state_template trick or not. Why are you using this state_template? And why does it not work for my values (from -100 to 0)?

lweberru avatar Jan 08 '23 12:01 lweberru

Having the same issue here - card-templater is the best way to allow the severity levels to be templated, but the needle jumping back to zero each time is very distracting.

thigger avatar Apr 26 '23 10:04 thigger

Yeah I also have this issue. I'm hoping a few more people chming in might get it to move towards the top of the devs to do list...?

OzGav avatar Oct 25 '23 04:10 OzGav

Id say this is related https://github.com/gadgetchnnel/lovelace-card-templater/issues/37

OzGav avatar Dec 15 '23 22:12 OzGav