Open ildar170975 opened 1 year ago
I'll try to look into it this weekend, thnx for the report!
When searching the repo for update
, I found #250 . Maybe related.
I noticed the problem recently - may be same time when history-graph became "streaming"; not sure if it could be related...
I just want to add that I believe I am observing the same issue. Graphs only seem to be accurate on refresh, and have really unexpected behavior when displaying them for a long time. (in addition to not updating regularly, I am having issues where two entities on the same graph/axis will not line up properly, or will disappear)
Before refreshing:
After refreshing:
- type: custom:mini-graph-card
entities:
- entity: sensor.octoprint_actual_tool0_temp
show_fill: false
- entity: sensor.octoprint_target_tool0_temp
smoothing: false
show_fill: true
show_line: false
show_state: false
show_points: false
hours_to_show: 1
points_per_hour: 10
min_bound_range: 5
show:
icon: true
extrema: false
fill: fade
legend: false
name: false
icon: mdi:printer-3d-nozzle-heat
align_icon: state
update_interval: 5
Just confirming that with the same version of mini-graph-card & HA 2024.1 - still same glitch:
From your animation, it looks to me like our graph does not update the most recent point, but only shows the second-most recent data point. 🤔
Seems so (
While thinking about #1075 , I realized, we have two places where we react to HA state changes:
render
is called every time this.hass
changes. And it actually only renders data cached in this.points
and the likes.updateData
is called every time this.hass
is set. And it actually generates the cached data rendered later by render
.So, I wonder if maybe render
is called before updateData
. This might explain the behaviour described here.
@akloeckner Have you found anything? Is there any workaround? Except forcing a user to press F5 periodically )))
No, I don't have that many "binary" sensors plotted with mini-graph-card. Plus, I don't keep the graphs open for long times, usually. :shrug: Also, I have no clear idea how this could be fixed. Not even, if my hypothesis above is correct: I have no clue how the order of execution could be changed without changing the architecture of the code. 😕
HA 2023.3.5 latest
mini-graph-card
Win10+ChromeConsider this code:
where
cache: false
seems to be not affecting at all,points_per_hour: 240
is defined to ensure that changes made frequently by a user (here interval is 15 sec) are displayed properly.Clear browser cache.
The initial state:![image](https://user-images.githubusercontent.com/71872483/227688764-f1b03363-30b1-4ee4-80da-d702058e2e57.png)
Now change value and see how the![image](https://user-images.githubusercontent.com/71872483/227688950-33b5f63b-e925-4b0d-a57f-af0f32bc3ac2.png)
mini-graph-card
is updated. After 1 minute the graph is not updated:Change again:
Immediately after changing the graph is redrawn - but we see only "0 -> 1" change instead of "0 -> 1 -> 0".
Go to Editor - the graph is displayed properly:![image](https://user-images.githubusercontent.com/71872483/227689050-1907629f-424f-4863-b7dc-e8b959fcd34b.png)
Go back, refresh (F5) - the graph is displayed properly:![image](https://user-images.githubusercontent.com/71872483/227689116-cceb0488-b1c1-47b5-b6be-01cdc34889fc.png)
Setting
points_per_hour: 3600
, playing withcache: false
do not help.And now the weirdest part: