Negative solar production after midnight on energy dashboard

Good morning

Have an ESP32 here collecting data from a HM-600 microconverter and a Shelly 3EM getting energy usage and return and set them up in the energy dashboard…all fine so far, except after midnight:

In the hour after midnight it shows the solar production as a negative value, which is the total production from the previous day as AhoyDTU resets the counter at midnight.

So how can I tell HA that it should start from 0 as well at midnight?

I could disable the daily reset, but I assume once the counter overflows it will show one day a solar production of negative TriZillion GigaWatts/h (o;

thanks in advance
richard

1 Like

I guess, you will need to set the state_class of your sensor to total_increasing

You can do that by creating a template sensor that reads your original sensor’s value and sets its own meta-data.

total_increasing
Similar to total, with the restriction that the state represents a monotonically increasing positive total which periodically restarts counting from 0, e.g. a daily amount of consumed gas, weekly water consumption or lifetime energy consumption. Statistics of the accumulated growth of the sensor’s value since it was first added is updated every 5 minutes. A decreasing value is interpreted as the start of a new meter cycle or the replacement of the meter.

1 Like

Sorry for late reply…but had to run it over night to see the effect…

And it works :slight_smile:

many thanks
richard

Hi!
I have the same problem with my solar inverter sungrow (iSolarCloud platform).
Could you please share an example of the Sensor template?
I’m confused about the yaml format.
Thanks in adavnce!

Samenfor me, please share your solution with yaml?

Same here, how and where do I set the state_class of my sensor to total_increasing

You can set it in configuration.yaml

homeassistant:
customize:
sensor.battery_energy_out:
state_class: total_increasing
sensor.battery_energy_in:
state_class: total_increasing