aX+bY to a feed

I’d like to compute the saving I made by using the energy produced by the solar panels on a bi tarrif meter. I compute the power consumed and produced by solar panels using the ‘max by input’ operation which I log to a feed. I have a schedule called ‘peak’ and two feed containing the cost per kwh during peak and off peak periods.

I found out how to use the Zero when schedule or !schedule but I struggle in creating the final formula being aX+bY where a is €/kwh during peak, X auto conso during peak, b € per kwh off peak and Y auto conso off peak.

I feel stupid as I’m obviously not the first one confronted but I could not find anything on the topic… probably using the wrong terms :wink:

Hello @vdesmedt, @nchaveiro might be able to help with this, he is the author of the schedule module.

Thank you for following up @TrystanLea. I’m af.raid this has not much to do with the Schedule module but more with how ‘complex’ operation including parenthesis can be implemented.

I usually use the Octopus Agile emoncms app for this kind of thing it has the option to enter a simple off peak tariff as well. There’s also the time of use tariff apps which might be useful as well.