Zero an enphase envoy daily sensor at midnight

My enphase daily consumption sensor starts at around 30kw each day and tracks up correctly from this offset.
I guess this is due to my system being 2 phase.

I would like to zero this sensor at midnight, do I need to create a template sensor to fix this sensor?
as this start value varies each day, it’s a little beyond my knowledge to fix it.

How would you approach this issue?