Allow custom tariff function - Tiered TOU


It would be awesome if we could implement our own tariff functions, perhaps in javascript. That would allow us to build one complex function, valid all year, that accounts for TOU, baselines, etc.

In my case (PG&E E-6), the only input I would need would be net consumption.

You would probably want to limit function processing time.

EDIT - thinking about this a bit more, PG&E baselines are a complicating factor; my function would need to be able to accumulate usage over a billing cycle. Perhaps the function should only execute once per day, and it would have access to all the datapoints going back since the beginning of the billing cycle (configured parameter). Either that or the function would need to be able to persist multiple accumulations on its own.


To properly replicate the bill requires the following features to be supported -

The last feature needs to be calculated for each 5-minute update for all systems, this is the more challenging change.