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

Needle in gauge card resets when entity is changed #131

Closed
swissdiver opened this issue Aug 26, 2023 · 3 comments
Closed

Needle in gauge card resets when entity is changed #131

swissdiver opened this issue Aug 26, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@swissdiver
Copy link

swissdiver commented Aug 26, 2023

Release with the issue:
Home Assistant 2023.8.4
Supervisor 2023.08.1
Operating System 10.5
Frontend 20230802.1 - latest

Last working release (if known):

Browser and Operating System:
Win 11, Firefox & Chrome

Description of problem:
I have created a customised gauge card in which I first define a variable max value and in a second step also want to make the deviations variable. But now I've noticed that when I change the entity, the needle jumps to "0" for a short time and the pointer wobbles.
With the standard gauge card, the status changes smoothly.

Screen_Recording_20230826_122721_Chrome.mp4.mp4

type: vertical-stack
cards:
  - type: custom:config-template-card
    variables:
      maxBar: Number(states['input_select.sensor_1_type'].state)
    entities:
      - sensor.bar_var_sensor1
    card:
      type: gauge
      entity: sensor.bar_var_sensor1
      name: Stufe 1
      needle: true
      min: 0
      max: ${maxBar}
      segments:
        - from: 0
          color: '#db4437'
        - from: 5
          color: '#ffa600'
        - from: 6
          color: '#43a047'
        - from: 8
          color: '#ffa600'
        - from: 9
          color: '#db4437'
  - type: gauge
    entity: sensor.bar_var_sensor1
    name: Stufe 1
    needle: true
    min: 0
    max: 10
    segments:
      - from: 0
        color: '#db4437'
      - from: 5
        color: '#ffa600'
      - from: 6
        color: '#43a047'
      - from: 8
        color: '#ffa600'
      - from: 9
        color: '#db4437'
  - type: entities
    entities:
      - entity: input_number.demo_smart_1_1


@swissdiver swissdiver added the bug Something isn't working label Aug 26, 2023
@ildar170975
Copy link
Collaborator

It happens because the nested card is REDRAWN when a monitored entity changed.
Consider this not as a bug but as an outcome of the card's design...

@mcmanigle
Copy link

Question: in this example, does sensor.bar_var_sensor1 need to be a monitored entity? Since the templated values (just max) depend only on input_select.sensor_1_type, couldn't that alone be listed in entities?

@ildar170975
Copy link
Collaborator

does sensor.bar_var_sensor1 need to be a monitored entity? Since the templated values (just max) depend only on input_select.sensor_1_type, couldn't that alone be listed in entities?

Both of them should be declared in "entities".

Explanations were provided.
No feedback from OP.
Closed.

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