Hi, for me it fills in incorrect data.
Sample: at about 5pm local time I switched on lights in a room, the the database 0=off, 1=on
SELECT value FROM "autogen"."state" WHERE ("entity_id" = 'arbeitszimmer') and time >= now() -20m tz('Europe/Berlin')
name: state
time value
---- -----
2021-01-21T17:03:03.038395904+01:00 1
Using a query to show data for the past 20 minutes in 1 minute intervals it does this, first using “mean” and fill(0) like you did it:
SELECT mean(value) FROM "autogen"."state" WHERE ("entity_id" = 'arbeitszimmer') and time >= now() -20m group by time(1m) fill(0) tz('Europe/Berlin')
name: state
time mean
---- ----
2021-01-21T16:51:00+01:00 0
2021-01-21T16:52:00+01:00 0
2021-01-21T16:53:00+01:00 0
2021-01-21T16:54:00+01:00 0
2021-01-21T16:55:00+01:00 0
2021-01-21T16:56:00+01:00 0
2021-01-21T16:57:00+01:00 0
2021-01-21T16:58:00+01:00 0
2021-01-21T16:59:00+01:00 0
2021-01-21T17:00:00+01:00 0
2021-01-21T17:01:00+01:00 0
2021-01-21T17:02:00+01:00 0
2021-01-21T17:03:00+01:00 1
2021-01-21T17:04:00+01:00 0
2021-01-21T17:05:00+01:00 0
2021-01-21T17:06:00+01:00 0
2021-01-21T17:07:00+01:00 0
2021-01-21T17:08:00+01:00 0
2021-01-21T17:09:00+01:00 0
2021-01-21T17:10:00+01:00 0
2021-01-21T17:11:00+01:00 0
before switching on lights the value is 0 ( would be correct), but after the the event it fills all remaining slots with 0 again, however light is still on. In my graphs this means the colour changes to green once, then goes back to red for the rest of the line.
with fill previous the slots after the event are filled with “1” (because it keeps the value), but then slots from the first timestamp until the event are empty:
SELECT mean(value) FROM "autogen"."state" WHERE ("entity_id" = 'arbeitszimmer') and time >= now() -20m group by time(1m) fill(previous) tz('Europe/Berlin')
name: state
time mean
---- ----
2021-01-21T16:57:00+01:00
2021-01-21T16:58:00+01:00
2021-01-21T16:59:00+01:00
2021-01-21T17:00:00+01:00
2021-01-21T17:01:00+01:00
2021-01-21T17:02:00+01:00
2021-01-21T17:03:00+01:00 1
2021-01-21T17:04:00+01:00 1
2021-01-21T17:05:00+01:00 1
2021-01-21T17:06:00+01:00 1
2021-01-21T17:07:00+01:00 1
2021-01-21T17:08:00+01:00 1
2021-01-21T17:09:00+01:00 1
2021-01-21T17:10:00+01:00 1
2021-01-21T17:11:00+01:00 1
2021-01-21T17:12:00+01:00 1
2021-01-21T17:13:00+01:00 1
2021-01-21T17:14:00+01:00 1
2021-01-21T17:15:00+01:00 1
2021-01-21T17:16:00+01:00 1
2021-01-21T17:17:00+01:00 1
worst case, there is no change to the data within the requested timeframe, in this case the resultset is just empty and neither method to fill in values can help:
SELECT mean(value) FROM "autogen"."state" WHERE ("entity_id" = 'arbeitszimmer') and time >= now() -5m group by time(1m) fill(previous) tz('Europe/Berlin')
so far I did not have a solution for me, but … positive side effect, you added the statusmap to your panels