Utility meter reports (daily/monthly/yearly)

First of all many thanks for this writeup! I feel little bit guilty that I have left this thread without traction and I’m very glad to see that kind of post here (proposal how to tackle the problem).

Let me just understand your suggestion. If I understand correctly you propose that utility-meter will expose sensor (e.g. sensor.pump_monthly_report) and recorder should be disabled for it. To store the data it should make a direct DB call. Is this what you are proposing?

If that is the case I see few potential issues:

  • Currently utility-meter is a regular sensor. It is just producing some values (it’s state) based on other sensor states. It doesn’t interacts with DB directly.
  • I’m not sure if direct access to DB is allowed
  • Recorder stores all it’s records in the tables which have a general purge settings so I guess we won’t be able to store such data in the regular tables
  • HA core team is doing table structure changes from time to time
  • So we will need to maitain special table in the DB, I assume we don’t want to have there any retention policy