Setting up emonpi with mulitple solar inverters. How best to create feeds

I have a solar installation that I want to use emonpi to monitor three basic values:

  1. Live solar export to the grid (plus end of day kwh)
  2. Live import from the grid (plus end of day kwh)
  3. Live consumption use (plus end of day kwh)

I am using two solar inverters of which dont fit in the standard setup of version 1 or 2 in the emoncms setup instructions. One of my inverters has a grid fail battery backup system as well it can generate solar back to the load circuits or even export back to the grid. I have though about putting CT sensors on the output of the inverters but as one of the inverters is a hybrid with grid fail system it makes it too complicated to measure it through the emonpi.
I am thinking that I should be able to calculate the solar export , grid import and consumption just with the two CT sensor values

Below is my current setup where CT1 is placed on the main grid supply. Here I want to measure grid import and grid export. CT2 I have placed on the load circuits. Here I want to measure consumption use.

I have the AC power supply connected, and the CT sensors connected in the correct direction. When looking at emoncms input data, CT 1 gives raw data of positive when importing from the grid and negative when exporting to the grid.

My problem is how to setup the feeds so that I can view in emoncms via the default solar dashboard so I can see my solar export, grid import and consumption? So far I cannot seem to get it to work.

Has anyone done a setup similar or encountered similar problems? I would appreciate if anyone can share their solar feed setup

I have given up on trying to measure usage and solar output from my inverters. I have instead connected CT1 and CT2 both on the main supply grid. One will be used for monitoring grid import and the other to monitor grid export.

from this I can keep track of current state if I am exporting to the grid or importing and also how much kwh is accumulating. I can also calculate export revenue and import revenue and track what is my net liability with the electricity supplier.

Measuring usage is not that important although at night my grid import value is my usage. I just cannot measure usage during the day when solar is exporting. Solar production although important, for an overall picture, it is more important to know how much I am exporting and the revenue for that. I can always check the inverters locally to know what each are producing.

Anyhow, if the main focus of using an emonpi to measure solar export and grid import, then just connecting the two CTs to the grid main power supply (one ct in reverse direction so one is export and one is import) and you will be able to monitor several renewable energy production systems back to the grid. (wind, mulitple solar inverters etc)

I have managed to build a nice dashboard that gives cumulative import and export values with costs as well as live import/export .

I don’t understand why you need to use the two CTs on the grid connection, one to measure energy in one direction and one in the other. Did you see the operators “Allow positive” and “Allow negative” in the list of input processors? These will do as they say, and block the opposite condition, allowing you to send either import or export to a feed, then you “Reset to zero” and start again with the same input “+ input” and do the opposite to a second feed. Or have I completely misunderstood your problem?

That would free up one CT to go back onto your house feed for house consumption. But whatever you do with 2 CTs, you cannot get the full picture, especially the balance of energy being stored or used in the battery bank and inverter 2’s output. Adding a pulse count from your generation meter on inverter 2 (assuming it has one of its own) would possibly resolve that.

Hi Robert, thanks for your feedback. I tried to have CT#2 on the house feed but I was getting incorrect readings from it. At times it would be positive and other times it would be negative. I could not figure out why it would go negative and I just could not use it.
You are right about using only 1 CT on the grid side. I will modify my setup to run just with one CT and maybe use the spare CT on one of the inverters for production measuring.

But what was the magnitude of those readings? Remember that the standard “shop” CT is a 100 A device, and it’s accuracy is not quoted below 10% (10 A). We do see acceptable performance at currents less than that, but it really struggles below 1 A. If you were trying to measure powers down below a few hundred watts, then I would expect unreliable results.

my normal usage is 500 to 6000W . At times it would go -1500 W . This was mainly during the day when the solar inverters were exporting. So I think that when my inverters are exporting power , it somehow has affected the usage CT sensor to read differently but at night when the inverters are not exporting , it seems to measure correctly.
I think the CT are accurate even around 50W as I have currently two CTs on the main grid supply and they measure down to 50W quite accurately.

I have tried to run with only 1 CT on the grid import and calculate off the positive and negative values give me the grid import and grid export values as you have suggested. However, in reality it seems that there are issues with setting up the feeds to get these two separate live values as well as the Kwh end of day values.

on the local emoncms , you can create a feed directly from the input and then add the function of “allow positive” or “allow negative” , however, you cannot get more than one output value when creating feeds this way. eg. I can only create that feed for export live and export kwh if I allow negative.
the only way to solve this is to use virutal feeds from the source input. I can create 1 virtual feed from the input and make that positive for grid import and make a second virtual feed that allows negative for grid export.

This also has problems as when creating virtual feeds, you cannot use the function kwh as it is not available for virtual feeds (I dont know why that is as I would have thought it would be essential) . So it means I cannot get total export kwh and total import kwh readings this way.

Another issue is when reading the results remotely through there is no support for virtual feeds .

it is really frustrating as really the best way is to not have standard feeds created from inputs but just have only virtual feeds that have full functions available like kwh calculations. That way you can have multiple virtual feeds getting data all from ONE input. It just makes sense as you will then have full flexibility to calculate what ever data you want from 1 feed. Currently you can only create 1 feed output value from 1 input (without using virtual feeds)

This is actually the reason why I have two CTs on the main grid (one in reverse direction) as it is the only way I can create the feeds that display the data and also accumulated kwh.

Anyhow, maybe I am missing some other way to do it.

I think @nchaveiro might be able to help with explaining how virtual feeds work. I’m not an emonCMS expert.

The other point to bear in mind is your local emonCMS has much more capability than, which is limited as it needs to share the facility amongst a wide user base.

You do not need to use virtual feeds for what you are trying to do (that doesn’t mean you can’t or shouldn’t, just you do not NEED to), as suggested by @Robert.Wall you can use reset to zero in between the import and the export calcs.

Try a processing list along the lines of

log to feed “net power”
power to kWh “net kWh”
allow negative
log to feed “export power”
power to kWh “export kWh”
reset to zero (This zero’s the value passed to the next process giving you a clean sheet)

  • input (Add the same “grid” input that you started with)
    allow positive
    log to feed “import power”
    power to kWh “import kWh”

This “resetting to zero” can be done locally on emoncms as well as and as many times as you need.

Pb66 ir right. A quick tip, instead of:
‘reset to zero’
‘+ input’’
You can use ‘reset to original’ its quicker to proccess and cleaner to implement.

Robert the kwh accumulator process, as-is, can’t be used on virtual feeds as they are only active when you use them and are calculated for the time range you choose on a graphic. But should be possible to implement a new process that work with VF.

Nuno, I don’t think I said it could. All I said was, I thought you could explain how virtual feeds work (and by implication, their capabilities or otherwise).

There is a good topic about virtual feeds on the old forum:

And a nice starting thread here:

True, but the ‘reset to original’ is only available on local emoncms, not, so in the interest of simplicity and to avoid detracting from the point by outlining 2 different methods of doing the same thing and explaining why, I opted for the universal approach.

Thanks guys for your explanations. I will try and setup some feeds from inputs on local emoncms as you suggest and see if I can get the data I need this way.

As for not having virtual feeds, if I install it on my own server, does the opensource version have virtual feed functionality built in it or is that something only available to local emoncms?