I have been trying out the energy panel. I am using consumption and production data as measured using a Sense Solar package, using the sense integration. I observe the bars in the usage section and each bar is listed for a 1hr period exactly 1 hr later than similar data reported by my provider (SunPower), or my direct observations in the sense platform. The latter two are in agreement, but compared to values in the energy panel they are listed 1 hr earlier. It gets dark here before 6PM and my sense reports solar production of 0.1 kWh in the 5PM to 6PM window and zero after that. The energy production panel shows 1.2 kWh in that range, and 0.1 kWh between 6PM and 7PM. Clearly the latter cannot be true with it being dark at that point. The 1.2 kWh corresponds directly with what sense reports in the 4PM to 5PM window.
I think I figured this one out. The sense integration makes available only the following sensors: Daily From Grid (sensor.daily_from_grid), Daily Production (sensor.daily_production), Daily To Grid (sensor.daily_to_grid), Daily Usage (sensor.daily_usage). These are all in kWh and I used them to configure the energy panel.
Turns out these only update once an hour or so and the update it typically not produced until some time into the next hour. It causes the problem described.
I think the solution is to define new sensors based on sensor.energy_usage and sensor.energy_production, which are both instantaneous reads in W. Using the Riemann integral functionality they can be integrated into more frequently updated kWh.
Yes. It was caused by using a sensor that was only updated once an hour to reflect the prior hour. However the update happened just a second or two inside the next hour so it registered for the wrong hour. More detail in reply above.