Virtual battery feed - Capping kwh at 0

I’m trying to use emoncms to calculate what size battery storage I would need based on my export profile. I’ve got as far as creating a virtual battery drain feed (export - use) and then log a kwh accumulation, which does give me the right kind of graph. Shows reduction in kwh when using more than generating, but the problem is I want to cap the minimum level of the kwh figure at 0kh. Once the virtual battery is empty it shouldn’t go negative…
How do I do this. I can’t use allow positive as the kwh is not passed to the next stage.

Any help??

A belated welcome to the forum, Mark.

@nchaveiro is the creator of virtual feeds, he might be able to help you.