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

history-graph: wrong auto-refresh (input_boolean) #15498

Closed
3 tasks done
ildar170975 opened this issue Feb 19, 2023 · 8 comments
Closed
3 tasks done

history-graph: wrong auto-refresh (input_boolean) #15498

ildar170975 opened this issue Feb 19, 2023 · 8 comments
Labels

Comments

@ildar170975
Copy link
Contributor

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

Continuation of this problem: #13128
Currently I observe the problem for non-numerical entities only.

Test card:

image

type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: input_boolean.flag
        secondary_info: last-changed
  - type: history-graph
    entities:
      - input_boolean.flag
    hours_to_show: 1
    refresh_interval: 0

Toggle the entity:
image

The graph is updated not immediately, after ~1 minute:
image

Describe the behavior you expected

The graph is updated immediately.

Steps to reproduce the issue

as above

What version of Home Assistant Core has the issue?

2023.2.5

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Chrome 110.0.5481.97

Which operating system are you using to run this browser?

Win10x64

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@ildar170975 ildar170975 changed the title history-graph: wrong auto-refresh (binary_sensor) history-graph: wrong auto-refresh (inpuut_boolean) Feb 19, 2023
@ildar170975 ildar170975 changed the title history-graph: wrong auto-refresh (inpuut_boolean) history-graph: wrong auto-refresh (input_boolean) Feb 19, 2023
@karwosts
Copy link
Contributor

I'm not understanding what you say the problem is. What does it mean to be "updated" immediately when you click the button?

If the graph "updates" instantly, then the new state will be essentially 0 time or 0 pixels wide, so it would not even be visible on the graph. What do you expect to happen exactly?

I observed a boolean changing in both directions and I didn't see anything that seemed wrong to me. Both graphs seem to update at roughly once per minute, which I don't think is unreasonable?

graph_progress_on_to_off

graph_progress_off_to_on

@ildar170975
Copy link
Contributor Author

ildar170975 commented Feb 19, 2023

What does it mean to be "updated" immediately when you click the button?

Agree, this was not a correct statement from my side.
Right after toggling the new state is ~1px, which is OK.
But it keeps staying this "1px" for a minute.
If you press F5 (before 1 minute) - then the graph is updated and the new state is much bigger than "1px".
So, the problem is that this update does not happen "soon" (not "immediately"), it happens after ~1 minute.

How to test:

  • toggle
  • new state = 1px
  • new state is "wide" after 1 minute
  • toggle
  • new state = 1px
  • wait a few seconds (~10)
  • F5
  • new state is "wide"

Both graphs seem to update at roughly once per minute, which I don't think is unreasonable?

This is a long period compared to numerical graphs.
IMHO non-numerical graphs should update FASTER, not within 1 minute.
The "1px" bar occurs immediately, but it may not be visible in some conditions (like with a big value of "hours_to_show"), and auto-refreshing the graph after a period <1minute will make this change more "vivid".

@karwosts
Copy link
Contributor

karwosts commented Feb 19, 2023

I can't speak to the tradeoffs of performance for increasing the refresh interval to faster than 1 minute. I question if it really makes that much difference, if you have large number of hours to show, if you refresh it 10 seconds after changing, the bar may be 2px wide instead of 1px, not really a significant notable difference.

If what you're saying is it's hard to see the current state, maybe it would be nice if there was a little bubble/circle to the right of the chart that just prominently displayed the color of the current state, to make it obvious to see recent changes, but I'm not sure if that would be useful or just distracting.

And interestingly enough it looks like line (numeric) charts have a much slower refresh interval than timeline (state), at least when there are no data changes. They seem to be enforcing a 5 minute refresh interval to redraw the X axis that is not enforced for timeline charts. But I do agree that it is easier to notice instant changes on the line chart, due to the large vertical line. Not sure if that's a bug or not.

https://github.com/home-assistant/frontend/blob/dev/src/components/chart/state-history-chart-line.ts#L149
https://github.com/home-assistant/frontend/blob/dev/src/components/chart/state-history-chart-timeline.ts#L67

Timeline redraws anytime "endTime" changes, which seems frequent, but Line chart does not.

@ildar170975
Copy link
Contributor Author

ildar170975 commented Feb 19, 2023

Thank you for a detailed research.
Let me explain an origin of this issue.

Since I started working with HA, I am registering questions/tasks/problems in some document (kind of registry).
I am revising old issues, closing them / doing additional research if needed.

Last year I noticed that history-graphs stopped updating.
Some issues were registered here in GitHub for this problem (by me, by other people).
Today I revised my old records in my registry for this problem; an issue for a numerical graph is solved; and for a non-numerical graph I see a comparingly significant delay.
This delay is NOT critical.
As you noticed in a real life with hours_to_show: 24 the "new-state-bar" will be thin and not vivid even after 1 minute.
Let's say that my issue is for a "perfection".

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 20, 2023
@ildar170975
Copy link
Contributor Author

up

@github-actions github-actions bot removed the stale label May 24, 2023
@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 22, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
@ildar170975
Copy link
Contributor Author

Do not observe the issue in 2024.6.2.
Consider as "closed normally".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants