Replicating a utility usage dashboard

My utility creates this dashboard:

I am struggling to replicate this were

  • all 24 hours are shown regardless of being a zero/previous type value
  • have it show the full day’s data (midnight to midnight instead of now to minus 1d)
  • net positives/negatives are stacked

data sources available from home assistant:

  • sensor.eg4_energy_daily_grid_export
  • sensor.eg4_energy_daily_grid_import
  • sensor.eg4_energy_daily_grid_net
  • sensor.eg4_energy_cumulative_grid_export
  • sensor.eg4_energy_cumulative_grid import
  • sensor.eg4_energy_cumulative_grid net

This is about as close as I’ve gotten but I can’t get the 24h/24 bars to show a complete day worth of data

I’ve also tried the net value approach:

Your queries look reasonable. I don’t think the cumulative sensors are necessarily the issue → non_negative_difference() on cumulative energy counters is a common approach.

I’d first check whether the query is actually returning one row for every 1-hour bucket. fill(previous) only fills gaps between returned buckets; it doesn’t create buckets before the first returned value or outside the queried time range.
Also make sure you’re viewing Today (calendar day) rather than Last 24 hours, otherwise you’ll only see data up to the current time.

The Query Inspector or Table view will quickly show whether the datasource is returning all 24 hourly timestamps. If it isn’t, that’s why Grafana can’t render a bar for every hour.

I tested the panel config with TestData → panel showing the Time series + Bars setup with Today as the range, for reference

Ive got it a bit closer with a few odd behaviors:

  • have it for last 24h actually shows 25 bars
  • changing view to “today” or "yesterday breaks it and only shows a smaller number of bars

The screenshots suggest this isn’t a panel rendering issue. In the Yesterday view, the Table view itself starts at 11:00 → there are no rows at all for 00:00–10:00, not just zero values ,so the datasource isn’t returning anything for that window. Grafana can only render the timestamps it receives.

I’d check why the datasource isn’t returning data for those hours → for example, whether Home Assistant/InfluxDB actually has data for 00:00–10:00, or inspect the generated query in Query Inspector to verify the requested time range.