I am scraping my water meter readings from my water utility. All I get is the running volume consumed from when the meter was installed. Billing occurs every 2 months and there is a rate tier applied. We get the first 60m3 at the cheapest rate and then the rates increase from there (to a maximum billing rate of 4X the base consumption - something that happens to us regularly in the summer). A billing cycle goes from Jan 16 to March 15, March 16 to May 15 etc. I think this is a template sensor I want to create but not really sure. I want the following information:
- every bi-monthly billing cycle reset the bimonthly meter to zero - so this has to happen on midnight March 15, May 15 etc 6 times per year. With this log the meter reading at the start of the cycle
- My utility will let me scrape the meter reading once per day so each day, calculate the running bi-monthly volume
- Once I have this, I can calculate my running bi-monthly water bill which is the all the base tarifs and then simple calculation at your move through the tiers.
I would like this sensor to give me my running bi-monthly consumption and water bill estimate. I want to put the water consumption into a gauge that shows my progression into each of the 4 billing tiers and show my running water bill to date in the billing period.
Looking for some advice and/or pseudo code as to how to implement this, especially with some of the time aspects and events that have to happen at the start of a billing cycle and then daily logging.
On a side note, I think the energy section in HA should be renamed Utility and water tracking added to this subsystem - the basic logic is already there - water and electricity can be treated as household consumables. I really want the $ value presented on my dashboard - nobody in my house cares that we used 300m3 meters of water but the $500 coming water bill may. Same applies to electricity.