Create a statistics sensor using sensor.fronius_day_energy. Set the max_age to hours: 24. In this example we will assume it’s named sensor.fronius_last_24_hours.
Create a date sensor that updates at midnight (default). It will default to the name sensor.date.
Create a template sensor that pulls the total attribute from the statistic sensor. But you’ll have to get inventive with this to cause it to only update at midnight. The following template sensor should only update at midnight, meaning you’ll only have yesterdays results in it.
The reason we have to split the entity_id up is because we don’t want the template parser to create a listener for this sensor. If it creates a listener, it will update when the sensor updates and we don’t want that. We want it to only update at midnight. Using entity_id set to sensor.date should cause it to only update at midnight. Meaning this will always have yesterdays total energy in it.