WTH isn’t there an easy way to make a last-30-days energy use sensor

Long term statistics table (statistics) has the data per hour, so it should be relatively easy to calculate this on the fly without the need for extra sensors/entities/helpers or additional data records.
All the graphs and compare functionality in energy dashboard are also directly queried from this table.

So I imagine the compare functionality to not only compare to the last week/day, but a given period (in your case compare current with 30 days ago). The differences can be represented in graphs or textual. What also fits your request in this WTH.
There is also a separate WTH for that WTH, why can I only compare periods in the Energy Dashboard with the previous period? - #2 by Unlucky_Gagball.