Energy dashboard weekly or monthly consumed solar figure incorrect with daily

I have configured home assistant with GivEnergy using GivTCP v3.0 using Youtube Tutorial - https://www.youtube.com/watch?v=rHSI4oTZyTI&t=3484s and all seems to work as expected except energy usage and energy flow charts mismatch with daily vs weekly figures.

Energy Flow - Daily view - solar to home (consumed solar)

25 May 2026 : 3.8 Kwh
26 May 2026 : 6.5 Kwh
27 May 2026 : 6.7 Kwh

Total Consumed Solar : 17 Kwh

Energy Usage - Weekly View - solar to home (consumed solar)

25 May 2026 : 0 Kwh
26 May 2026 : 4.6 Kwh
27 May 2026 : 3.7 Kwh

Total Consumed Solar : 8.3 Kwh

The consumed solar 0 Kwh on 25 May seems to incorrect as i have used solar on that day. Please review attached image for 25 May - Energy Flow daily and Energy Usage weekly. The weekly chart I see no consumed solar but daily showing 3.8 Kwh used by home from solar generation.

Can you please advise how can i resolve this issue so weekly / monthly figures matches with daily ?

Please review below energy source config from diagnostic json file.

    "energy_sources": [
      {
        "type": "solar",
        "stat_energy_from": "sensor.givtcp_energy_energy_pv_generation_today",
        "config_entry_solar_forecast": null,
        "stat_rate": "sensor.givtcp_REDACTED_pv_power"
      },
      {
        "type": "battery",
        "stat_energy_from": "sensor.givtcp_energy_energy_battery_out_today",
        "stat_energy_to": "sensor.givtcp_energy_energy_battery_in_today",
        "power_config": {
          "stat_rate": "sensor.givtcp_REDACTED_battery_power"
        },
        "stat_rate": "sensor.givtcp_REDACTED_battery_power"
      },
      {
        "type": "grid",
        "stat_energy_from": "sensor.givtcp_energy_energy_imported_today",
        "stat_energy_to": "sensor.givtcp_energy_energy_exported_today",
        "stat_cost": null,
        "stat_compensation": null,
        "entity_energy_price": "sensor.octopus_energy_electricity_REDACTED_current_rate",
        "number_energy_price": null,
        "entity_energy_price_export": "sensor.octopus_energy_electricity_REDACTED_current_rate",
        "number_energy_price_export": null,
        "cost_adjustment_day": 0,
        "power_config": {
          "stat_rate_inverted": "sensor.givtcp_REDACTED_grid_power"
        },
        "stat_rate": "sensor.givtcp_REDACTED_grid_power_inverted"
      }
    ],

Regards
Bhavesh

On the day (25th May) you have generated solar, most of which was exported to grid, a smaller amount to charge the battery, and just 3.8 kWh used directly as "consumed solar".

This appears to show correctly on the chart when selected for the specific day.

However, for a 'week' selection, yes the individual day for the 25th does not show any solar consumed.

Looking at the size of the bars (without the actual figures) my guess is that, on the 25th, as well as 3.8 kWh consumed solar, there was roughly the same 3.8 kWh consumed from the battery. On the day-in-week chart, the 'consumed battery' is 7.5 kWh, so the inference is that the 'consumed solar' has disappeared and is included in the 'consumed battery'.

As a guess, I am going to suggest that this is because you are using 'daily reset' sensors.

All of your sensors for solar, grid import, export and battery charge, discharge are "_today". Whilst the Energy Dashboard is quite robust, using 'self-resetting' sensors as source data can/does/may cause issues. This is because the data used in the Energy Dashboard is all from the long-term statistics, which are captured hourly by the Recorder. The values are written at about 8 seconds after the top of the hour, based on HA time. For the day-graph, the data used is the 24 hourly values over the day. And, by a strange quirk of fate, solar is generated only during the day, so the figures will go up each hour, and then plateau after dark. Where you use a 'today' figure from the inverter, the inverter itself will reset this, around midnight. And this will be midnight as the inverter sees it. My inverter gains 20 seconds every 5 days, so there is almost guaranteed to be a case where the inverter resets the daily solar to 0 either before HA midnight or after.

So, the midnight figure captured might be 20 kWh of solar and the 01:00 figure zero, or midnight might be 0 kWh of solar. This is not a problem for the day-graph, since the hourly values plotted are not reset during the day. However, for the day-in-week graph, the graph now has to summate all the day figures and roll them up into just one figure for the day. If the inverter reset has occurred at the 'wrong' time, Monday will see no solar.

Anyway, that is my theory on the cause of the issue.

I switched all my energy sensors to Reiman Sum sensors, which provide a "total-ever" value that is total-increasing, and therefore never resets, and all the graphs work correctly.

The only way to tell for certain is to dig into the data. You can download the energy dashboard data (used to create the graphs) using the download option on the date-picker side menu. This dumps the values to csv file, based on the date selected. So for a one-day (today / yesterday / 25th) graph this will be hourly values. The file generates a column for every 5 minutes, but there is only hourly data every 12 columns, and the timestamps are in UTC, so a degree of tidying is required. If you add a sum() column, you also get the today total-day figures from the sum of all 24 hours.

Using the 'week' display, the data download generates a new file. Tediously this has 288 columns at every 5 minutes for each day, but only one containing the midnight sum of the day's data, so a lot of work to compact this and remove the unwanted columns. This then gives the data for each day.

In my case you can see that the sums of 24 hourly values for the 26th May do match (almost perfectly) the day figures from the 'weekly' graph. You can, if you wish, repeat this yourself and this should pin down at what point the solar consumed is (apparently) vanishing from the figures.

The fact that my figures match, but not exactly, suggests another reason for the discrepancy when comparing one day with a day in a week. There are, with solar and a battery, seven different energy pathways, and with just hourly data to work with, there is insufficient information to determine exactly what goes where. The calculations work (I believe) in the order shown, allocating energy using a set of priority rules.

Any grid import is assumed to go first to the house as consumed grid (in priority over consumed battery or solar). Then any import not accounted for goes to any battery charge (in priority over charging the battery from solar). Then battery discharge goes to grid (in priority over solar to grid), then to the home as consumed battery. Finally the consumed-solar is solar to make up any consumption not already supported from grid or battery. Then solar to battery, and finally solar to grid as the lowest priority.

This works on an hour-by-hour basis. If the day-figures are added up first, and the calculations re-done on a day-by-day basis, they will be slightly different. I find the source code in GitHub too difficult to understand myself, so the code-author will have to confirm if there is a possibility for the figures to be computed differently for the day graph to the weekly graph. There are certainly a couple of slight rounding differences appearing in my data, which suggests that the day-in-week figures are not just the sum of the 24 hours-in-day figures.

Hope this helps!

Yes you're exactly right about this. Because we really don't have enough information to know exactly what goes where, the result changes depending on whether you calculate the energy on an hourly granularity or a daily granularity. It's an unfortunate fudge but that's all we've got to work with :person_shrugging:

Thank you. I presumed from previous postings on the subject that are the likely code author, and therefore we should ask you first!

I have attempted to undertake the pathway calculations myself (using my own captured data), and it is an open question as to the ideal priorities. I think you have done an excellent job with the [hourly long-term stats] data that is available. The Energy Dashboard works very well.

I surmise from your response that the overall pathway calculations are done on the whole-day sum (of the 24 hours), rather than each day's calculations being performed first then all hours summed to day-values. This would certainly provide different results, but depending on the individual circumstances.

The answer to the OP would, I guess, be that for the day-graph the hour-values are allocated to the calculated figures by hour, resulting in this case with a sum for the consumed-solar [from one or more individual hours]. For the week-graph, in contrast, the hour-values for each day are summated first, then the allocation to the calculated figures is done afterwards. In the OP's particular situation this means that the otherwise consumed solar is allocated to consumed-battery as a higher priority.

In short - that is the way it works.

Thanks @Biscuit @karwosts for your reply.

@Biscuit - you are right, I have created utlity meter with 'daily reset' which resets to zero at midnight for Battery Charge & Discharge, Grid Export & Import and PV Generation which i feed to energy dashboard.

You suggested all works for you with comment "Reiman Sum sensors, which provide a "total-ever" value that is total-increasing, and therefore never resets".

@karwosts please let me know using utility meter with daily reset is culprit and we should switch to "Reiman Sum sensors".

In addition, as per your suggestion I have downloaded daily - 25 May and weekly data (25 - 28 May) and removed unwanted empty columns and did a sum for 24 hours.

If you review above figures I see "calculated_solar_to_battery" matches fine between daily and weekly figures but other figure are out of sync.

If you add up daily total for "calculated_consumed_battery" and "calculated_consumed_solar" (3.7+3.8 = 7.5), this matches to weekly "calculated_consumed_battery" (7.5 Kwh). I am not sure why we moving consumed_solar to battery for weekly.

Similar issue also happened for "calculated_solar_to_grid" and "calculated_battery_to_grid".

Regards
Bhavesh

The Energy Dashboard has been much improved, and I believe that daily resetting source entities are no longer the problem they might once have been.

If you have utility meters with 'daily reset' then you could, if you so wish, change this to non-resetting. This would leave the utility meter as a total-increasing value, which personally I think is a better option, but as I understand is (now) not required. It was a suggestion only.

Karwosts post above confirms that the 'issue' you are seeing is actually due to the way the weekly calculations are being done. In short, this is the way it works, and no, there is no 'fix'.

Specifically [explained as best I can]

For the day-graph, each hour is computed. Where you have a battery discharge value, regardless of what was actually happening (eg battery to house) this is assumed to be going to the grid first. This means that, the day figures will pass battery to grid for each hour. The consumed-solar comes at the end of the list, so it will only appear for those hours where nothing much else has been going on.

For your one day, you just happen to have one or two hours where, for the individual hour calculations, consumed solar appears (because there is nothing else in the higher priority to use the grid / battery first, during that hour).

Now, take the week-graph. All the day-hour values are added up first. This means that, over the whole day, if you have several individual hours with battery discharge and grid import (at night) both of which are assumed to go to the house first (even if they were not) then, the consumed battery total will replace consumed solar. In your specific case, it means that the day values in the weekly graph are significantly different to the day figures in the day graph.

Thanks @Biscuit

@karwosts With GivEnergy using GivTCP we have power sensor which provides details where energy goes such as "Battery to House", "Solar to House" and "Grid to House".

Can we use above with template sensor to find out total energy used by home on hourly, weekly or monhtly bases ?

Let me know ?

Regards
Bhavesh