Total energy consumed in kWh day/week/mont/year

I have read lots of thread about calculating energy but sadly most of them cannot help to solve my problem :frowning:
Found only one Sum energy values stored in influxdb - #9 by Josar which seems to be similar but proposed solution was to made in grafana - maybe someone knows how to solve it in OH rules ?