Daily totals from forward and reverse active energy in platform atm90e32 [SOLVED]

Solved this by reference to Template sensor with last good value stored in attribute - #2 by wigster