Not with the little bit of information you’ve provided so far. “some forumlas to calculate averages” isn’t detailed enough to give you any concrete advice. What are the forumlas? Averages of what data ranges? How often is it calculated/updated?
If you upgrade to OH 4 you might be able to just use Actual energy consumption [4.0.0.0;4.9.9.9] and Historical energy consumption [4.0.0.0;4.9.9.9] not need to do anything else.
If you stay on OH 3 I’m afraid you’ll have to build the equivalent of these rules yourself. I can help somewhat but it’s been years since I’ve writting rules for OH 3 at this point so it won’t be easy.