Week/Month sum of midnight values

You can check my energy widget and the used rule templates