kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
3k stars 233 forks source link

Maxima showing the wrong value #936

Closed fschwarz86 closed 5 months ago

fschwarz86 commented 1 year ago

Hi there,

unfortunately, the maxima feature doesn't seem to display the right value. I have stripped down the code to the very minimum:

entities:
  - entity: sensor.speedtest_ping
type: custom:mini-graph-card

As you can see from the screenshot, the maxima is already showing the wrong value (Max is 5ms, while current value is already 12ms):

Screenshot 2023-03-07 11 15 36

I'm using mini-graph-card v0.11.0 and HA 2023.3.1

Any idea what I'm doing wrong?

Thanks, Florian

ildar170975 commented 1 year ago
  1. I doubt you posted a valid card's picture since it shows "extrema" data - which is not supposed to be displayed by default (https://github.com/kalkih/mini-graph-card#available-show-options).

  2. Do not use default values for important options. Set: ponts_per_hour same as a real update freq (or x2 bigger - just in case) smoothing: false aggregate_func: last

fschwarz86 commented 1 year ago
  1. You're correct, it seems like the preview didn't update correctly.
  2. I've tried that as well, now using the following:
    type: custom:mini-graph-card
    entities:
    - entity: sensor.speedtest_ping
    show:
    extrema: true
    points_per_hour: 2
    smoothing: false
    aggregate_func: last

However the result is still the same:

Screenshot 2023-03-07 15 51 34

ildar170975 commented 1 year ago

You have not set hours_to_show (which is obviously!!!!) and have not provided info about a real update freq. How can you compare graphs based on different input data?

To be 100% sure - post a history-graph, not graphs from more-info (which may have a statistics instead of real graphs).

fschwarz86 commented 1 year ago

From reading the documentation, I was under the assumption that hours_to_show defaults to 24 if not set, but I've included it in the code. Output remains unchanged. Real update frequency is 1 per hour. Therefore, as per your recommendation, I've set points__per_hour to 2.

type: custom:mini-graph-card
entities:
  - entity: sensor.speedtest_ping
show:
  extrema: true
points_per_hour: 2
smoothing: false
aggregate_func: last
hours_to_show: 24

Screenshot 2023-03-07 17 20 03

Here's the output from history graph:

Screenshot 2023-03-07 17 21 23

ildar170975 commented 1 year ago

Your History view shows that is about 17:30 and your mini-graph says that extrema is 9:50PM - why? Are these graphs made at the same time ore be you posted a mini-graph from another day?

fschwarz86 commented 1 year ago

Exactly this is my question! These screenshots are taken within 1 minute.

ildar170975 commented 1 year ago

Hmmm, try clearing a browser cache...

fschwarz86 commented 1 year ago

Tried that, doesn't help...

ildar170975 commented 1 year ago

What HA do you use? I am using 2023.3.0, just updated to 3.1

Also, have you rebooted HA and did it solve the issue? People experience a similar flatline issue - https://github.com/kalkih/mini-graph-card/issues/933 - which is gone after HA reboot.

markgllin commented 1 year ago

experiencing the same issue with other entities, e.g. temperature, download/upload speed, and is not limited to maxima, but also minima, avg., and datapoints as well.

For instance, with temperature: image temperature here reports a max of 99 Celsius (obviously incorrect). On hovering over one of the datapoints, the reported values are also incorrect. This can be seen by comparing it to the native history-graph in homeassistant, which shows the highest temp is only 8.9 Celsius: image image Card configuration:

type: custom:mini-graph-card
entities:
  - sensor.vancouver_temperature
show:
  extrema: true
  minima: true

Currently using Home Assistant 2023.3.3 w/ the latest frontend (Frontend 20230309.0 - latest) in a docker container. Using v0.11.0 of the Lovelace Mini Graph Card.

ildar170975 commented 1 year ago

@markgllin

  1. Provide a correct detailed info (https://github.com/kalkih/mini-graph-card/issues/933#issuecomment-1464932117).
  2. Not possible to analyse since your graphs could be just not correct from the beginning; so set up options to ensure that the graph is "close" to the "real data" (points_per_hour, smoothing, aggregate_func).

Suggest you to EDIT your post to avoid scattering info in several posts. Also, at least read previous comments, like this - https://github.com/kalkih/mini-graph-card/issues/936#issuecomment-1458021640.

NiamoR42 commented 1 year ago

Hello, it looks like I have the same issue : image image

the code is so simple, I don't understand what's wrong ?!

type: custom:mini-graph-card entities:

  • sensor.co2
ildar170975 commented 1 year ago

@NiamoR42 read one post above

NiamoR42 commented 1 year ago

@NiamoR42 read one post above

Hello & thanks for your feedback : that looks better today, don't know why... I did not change anything...

ildar170975 commented 1 year ago

@NiamoR42 Your code which you posted could be WRONG. It has default values which probably make your graph absolutely different from a real picture. Even looking at the History from more-info popup (which is also WRONG since this is not a real data but an approximate statistics) I see a difference between your mini-graph & History. I recommended what you should do. Not it looks that I am begging you to improve your setup.

ildar170975 commented 8 months ago

Is this issue still observed?

ildar170975 commented 5 months ago

No feedback within 3.5 months, closing