gadgetchnnel / lovelace-card-templater

Custom Lovelace card which allows Jinja2 templates to be applied to other cards
119 stars 6 forks source link

Wrapped gauges jump to zero before updating to new value #51

Open StephanSchuster opened 2 years ago

StephanSchuster commented 2 years ago

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.

lweberru commented 1 year ago

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)?

thigger commented 1 year ago

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.

OzGav commented 10 months ago

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 commented 9 months ago

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