I don’t think it does group_by 1min over 60min is creating 60 buckets worth of 1min of state history (if there’s nothing in the history for a specific bucket, because there is no home assistant state change, by default it will fill the empty buckets with the last known value). The groups are starting to be created from the end of the chart (minus 1min for each bucket), the end of the chart in your case being exactly now (at the millisecond precision). So it will sum 83 and 4, giving you 87, then everything after is just getting 1 value of 4 (because of fill: last) or 0 (if fill: zero).
You can’t, there’s not way to create data out of missing data
Yeah… understand that you cannot do anything if HA doesn’t provide data.
Strange is, that subsequent sensor values of the same value are intercepted by the HA, but somehow history provides the first one only.
This trying to imagine if it couldn’t be a problem while measuring other things. Like power which doesn’t change over time, but is still provided.
So for me, the only way is to count missing pings to infinity
Are you sure that last_updated or last_changed in your sensor is upating for consecutive states with the same value?
You might want to look at: https://developers.home-assistant.io/docs/api/rest/ -> /api/history/period/<timestamp>
If you can check that with significant_changes_only=0 it reports those consecutive states with the same value, and with significant_changes_only=1 it only provides the first one, then I can maybe do something for you.
Unfortunately, this api call doesn’t provide information about subsequent sensor changes if its state (value) is not changing. It sticks to the first known value regardless of significant_changes_only setting
Yeah… I was changing values… in my case no difference in the result.
BTW last_changed and last_updated attributes remains the same (hoped that last_updated is changing at least)
So I’m willing to introduce the color_threshold feature but at the same time it breaks some default stuff (there are bugs in the ApexCharts library). I’m thinking about still releasing it but as an experimental feature…
enabling the experimental flag would render apex_config.fill completely unusable (and if you use it, it will break)
What do you think?
- type: custom:apexcharts-card
graph_span: 20min
experimental:
color_threshold: true # that's new
series:
- entity: sensor.random_0_1000
type: area # or line or column
stroke_width: 2 # that's new
color_threshold: # that's new
- value: 0
color: blue
- value: 250
color: green
- value: 500
color: yellow
- value: 500
color: orange
- value: 750
color: orange
- value: 750
color: red
- value: 1000
color: red