Energy stats no longer showing on dashboard

I am really hoping someone can help me with this.

About a month ago I purchased a Shelly energy clamp meter and installed it on my mains connection. This integrated with HA without issue and I was able to get the data on the Energy Dashboard. I also added a couple of other energy devices (hot tub and washing machine which are both generated from TP-Link Energy Plugs). Again this all worked fine:

Then on 19th April my HA instance stopped responding. This happens periodically annoyingly I haven’t been able to track down the issue (HomeAssistantOS running in VirtualBox). I rebooted the VM and it came back fine. I then updated to 2022.4 from 2022.3. After the upgrade, I noticed that my stats working. Initially, I thought it was the upgrade but then I realised that they actually stopped during the downtime on 19th April:

I read about the breaking change regarding energy but I don’t think there is any action for me to do here. When I search in the Energy config area for energy sources all of my sources show up:

image

The three sources all show data in kwh which, AFAIK, is what the Energy Dashboard requires:

image

There is nothing in the log related to the energy dashboard.

I did find this post which sounds similar and mentions that ‘The Energy dashboard now uses state_class: total_increasing instead of last reset’ but these entities are not template sensors that I have created. They have been created by the integrations so there is nothing for me to change here that I can see. Although, as a test I did create template sensors and add them to the Energy config but this still displayed no data on the Energy Dashboard:

    - name: Mains Energy Monitor New
      unit_of_measurement: "kWh"
      state: '{{ states(''sensor.shelly_mains_energy_monitor_total_consumption'') }}' 
      device_class: energy
      state_class: total_increasing

That about sums it up. I am at a loss and I am gutted I am not tracking my energy for the past few days. If anyone has any ideas it would be greatly appreciated!

Cheers

Is this sensor still updating?

48e12a1bc0e7ffa3598eb5324f46086d60c694ea

If so, do you see any issues in the Developer Tools / Statistics menu?

Yes, it is still updating - currently reading ~623kwh.

Never really looked in the Statistics menus before but it is showing there without issue (as are two consumption sensors):

Cheers

This randomly started working for me yesterday at around 15:00:

It doesn’t make much sense though as I wasn’t doing anything HA related all day. It had also been a couple of days since I had messed around with Energy Config so the message stating ‘it may take two hours for stats to show…’ had well and truly passed. It seems to have fixed itself as oddly as the issue started in the first place.

This has led to me missing some historical energy usage unfortunately:

Although, I thought I might be able to fix this with the Statistics page! I was able to fix partial days where there was a statistic (I can get the data out of the Shelly app) to adjust (so I can fix the 19th and 26th) but for the days in the middle where there is no data I cannot edit:

image

I’m sure this is a long shot but does anyone have any ideas on inserting a new statistic record? I would be more than happy with a single stat covering the entire day but I am not hopeful.

Cheers.

Developer Tools / Statistics , find your energy sensor and click the icon at the right. You can make adjustments there.

That’s what I tried in the last screenshot above but because there are no values recorded there is nothing to change. It seems that I need a way to insert a new statistics record on a given day. Once it is in the DB then I could adjust it in the front end Statistics GUI as you have mentioned.