Emoncms Input Processes, how to refer to the value of another Input

I would be grateful for some help please!
We have a single phase house with Solar and Battery.
Emonpi at Mains entry to house with CT on Mains feed (Emonpi:power1) - +ve importing and -ve exporting.
(Also pulse count on meter, but our meter pulses in both import and export).
Elsewhere EmonTx3 with CTs on Solar and some big useage circuits such as an electric cooker (on 24hrs a day at varying power levels)
We are on Economy 7 (2 time periods, 2nd of which extends into the solar generation period in the summer) and have successfully implemented a Schedule for Economy 7 called “Off peak”
I have set up the following Process List on the Cooker feed -
1 Log to Feed log emontx3: Cooker
2 Power to kwh kwh emontx3: Cooker_kwh
3 Power to kWh/d kwhd emontx3: Cooker_kwh_d
4 If Schedule,Zero sched 0 Off Peak
5 Power to kwh kwh emontx3: Cooker_kwh_Peak
6 Power to kWh/d kwhd emontx3: Cooker_kwh_d_Peak
7 Reset to Original ori
8 If !Schedule,Zero !sched 0 Off Peak
9 Power to kwh kwh emontx3: Cooker_kwh_Off_Peak
10 Power to kWh/d kwhd emontx3: Cooker_kwh_d_Off_Peak

Which works great to give me kwh and kwh/d figures for the Cooker on Off Peak or Peak.
However, since in both Peak and Off Peak both there are periods when the house is not importing, and therefore at those times any Cooker use we would not be paying for directly.
So, using process list functions (and presumably referring to emonpi:power1) I would like to build the following extra feeds in the above -

Cooker_kwh_Peak_paidfor
Cooker_kwh_d_Peak_paidfor
and
Cooker_kwh_Off_Peak_paidfor
Cooker_kwh_d_Off_Peak_paidfor

I believe I need after line 6 to refer to Power1 - test whether it is exporting (say, is it -ve and less than, say, -200kw (to allow for noise around zero),
if it is, then come back and ignore the rest of the lines to “ori”, if it isn’t (and therefore we are importing) come back and add to Cooker_kwh_Peak_paidfor and Cooker_kwh_d_Peak_paidfor.
And the same after line 10 for the Off_Peak ones.

I realise that it is a slight over-simplification to assume that we are paying for all that the Cooker is consuming when the house switches to import (as some of the consumption may be being handled by Solar and or Battery) - but am happy to live with that.

Could anybody see how the above could be achieved please in emoncms and using the inputs process functions, please?

Hello Chris,

A belated welcome to the forum.

I’m sorry nobody appears to have noticed your question - this is definitely one I think for @TrystanLea, though @borpin too might be able to help.

1 Like

Hello @cbn1, that’s impressive input processing, more advanced than I’ve ever built!
I wonder if you could use the max and min_value_allowed process to create a 1/0 value flag for import export and multiply the cooker consumption by this somehow… it might be easier to do it in an external tool such as nodered and feed the results back in for logging… @nchaveiro might be able to help with the schedule and conditional input processes

Hi, if i understood correctly @TrystanLea hint is correct, use the “if >, jump” condition to know when exporting.
I might add that the use of the GOTO process allows to jump after IF conditions so you can execute more processes on a condition.