New Feeds and using +ve and -ve readings

Hi I have been monitoring my solar system using a raspberry pi and an emontx4. I have recently installed a giv energy battery. I have CT monitoring on the house load, the grid, and the solar feed which also acts a supply to the remote building where the solar is installed. I am trying to establish a dashboard showing use and battery use (I cannot access the battery suply with a CT because of the wiring installation). Simply I want to distinguish feeds +ve and -ve on the solar and grid inputs so that I can determine useage. I am not clear whether this needs to be done at the input stage or the feed stage and how the operators e.g allow positive etc can be used. Any ideas.

Hello @Richard1 the Solar PV input processing guide here might be useful Solar PV — OpenEnergyMonitor 0.0.1 documentation

Hi Trystan. Not really. Having added a battery I now have four feeds. House Load +ve, Solar Feed both +ve and -ve as it is also a supply to an outbuilding, Grid +ve and -ve. Battery not measured. I am trying create the +ve and -ve inputs/feeds on the solar and the grid and then manipulate them to create a battery demand/load. I am not sure how the opations e.g make multiple positive can be combined in the input/feed sections work. For example can I set the solar in put if positive solar feed if negative solar laod feed?

The general idea is you do all the maths and logic in the Inputs page processing. Operations like “Allow positive” are obvious, the first ‘gotcha’ is when you use +input etc. When all the information comes in the same packet of data from a single source, these should be used in the last input processed so that the data from values that arrived first are available - otherwise you might be using data that’s old by 10 s or more. Clearly the ‘Allow…’ conditions create logical branch, you can also create a branch with a ‘GOTO’ or an ‘if… skip…’ condition. You’ll almost certainly need at some point to use one of the ‘Reset’ conditions, which essentially wipe the slate clean so that you start again with the same input (or maybe another, but I can’t immediately see why you’d need to) but handle it differently this time round. You can write to as many different Feeds as you like from one Input’s processing, but you can’t write to the same Feed from different Inputs, and you can only write to a Feed once - that is, if you send two different numbers to a Feed, they’re not added, the last to arrive before the Feed updates overwrites all previous values. (Theoretically, I think you could if it was Variable Interval, but it would rarely make sense as the values would interleave.)

You might also want to look a Virtual Feeds. I’ve never used this, they don’t store data but I understand they can be used for intermediate processing. You’ll need to search the forum (here and archived) or experiment, because I’ve never seen any documentation apart from Chaveiro’s posts.

Our convention is power/energy consumed in the house is positive. Grid import, solar produced and battery discharge would all be positive, but grid export and battery charging would be negative, as would be solar ‘keep alive’ power consumed by the inverter overnight. You don’t need to adopt this, but if you have your own convention, make it clear when you ask for help.

I think you need to start with paper, pencil and eraser and draw the data flows and the operations on each before the numbers are added, and then try to fit the operation available to that.

The only way I’ve found is to try the various operations and observe the result. It takes a bit of time to get into the way of thinking, so be warned.

I’m afraid this is necessarily vague, only you know the exact conditions you need to apply.

Thanks Robery very helpful. So can I use allow positive feed A allow negative Feed B in the input line or do I need to separate allows with a rest operation.

1 Like

Robery? No, I give my time and expertise here for free. :wink: :rofl:

If I interpret you correctly, you can’t meaningfully follow an ‘allow negative’ (i.e. it blocks the positive but passes the negative down into the next condition) with an ‘allow positive’, because there’s no positive left for it to work on, and it blocks the negative, so there’s nothing left except zero to pass on to the next process.

What I think you’re missing is the fundamental concept of the process.
Data comes in at the top of the list. Each step can operate on the data and pass a value down the list to the step that follows, and it can send something out if that’s its purpose. An example of the first is one of the calibration steps, the text says
Output: Modified value passed onto next process step.”
An example of the second is ‘Log to Feed’, which sends the value it received to the feed and passes the value it received, unchanged, to the next step.

So if you want the positive numbers to go to one Feed and the Negative to another, you do

  1. Allow positive
  2. Log to Feed     MyPositiveFeed
  3. Reset to original
  4. Allow negative
  5. Log to Feed     MyNegativeFeed

After step 1, the positive and zero values are available. After step 2, they are still available for something else (‘power to kWh’ maybe?) but are overwritten by step 3. After step 3, all values are available once more. After step 4, negative and zero values can be used right through to the end of the list.
Any value that falls off the bottom of the list vanishes forever.

You’ll have to play with the numbers to see and understand how it works.

Hi Robert Got it. Thanks for the helpful responses.