Sonoff POW Energy reset automation

Hello guys,

I have several Sonoff POW that I’m using for power monitoring and usually I reset the energy counters 2 and 3 every first of the month but now manually and I was wondering if it cannot be done with an automation or a script something within Home Assistant .

This is what I put every beginning of the month in the console of each pow “energyreset2 0”,“energyreset3 0” , the problem is that some times I forget to doit and I need to do other calculations after.

Did anyone did that already ?

thanks in advance.