PVOutput Question and re-upload

@overeasy wondering your thoughts on the issue with power values after I made the one addition of my home battery to the PVOutput equation for consumption; see image below. I’m wondering if there is some negative issues or other math but I would think consumption is consumption no mater the number of loads, etc. Once I added the battery to the PVOutput consumption my “Energy Used” kWh went from being normal to 227. I thought it might be a calculation issue on their end so I did a re-upload of today’s data and now it has me at that high usage starting at midnight and going though the day. Just wondering your ideas, I can also take this up with the team at PVOutput (making sure I’m not missing something obvious. I can set it back and re-upload again, but any ideas?

Here you can see the high usage from the start after doing a re-upload.

This simply shows after the re-upload I can see it starting at midnight and going the whole day.


When I first made the change I saw this in my logs in PVOutput

My setting look like this in the WebServer PVOutput config. with a focus on “Consumption” I did add two extended values but I’m assuming these do not matter to that calculation.


If I remove the Battery and re-upload I get back to a somewhat normal looking screen.

I am a little befuddled here. You have no idea how many scenarios I’ve dealt with, and yours was a long time ago. I don’t know how the powerwall is connected and I’m not sure it’s still the same with respect to how the solar ties in.

It might help to see an Iotawatt plot of a day with the raw solar, mains, and battery.

EDIT: I’ve looked at the powerwall documentation. I’m assuming you have a “partial-home backup system”. But I don’t think that’s important right now.

If I understand you correctly, you would like the PVoutput “consumption” to be the total of your loads sans what is going to the battery. I think that’s possible, but like the old Chinese saying, careful what you wish for, you might get it.

PVoutput is a very simple model. It takes in two metrics: The output of the solar inverter and the energy consumed by the home. From those numbers, it assumes any solar in excess of generation is exported, and conversely any consumption in excess of solar is imported. There are menu choices to display import and export.

Assuming “battery” is positive when charging and negative when discharging,I believe you can eliminate it from the consumption feed by subtracting it:

Consumption = (mains + solar - battery) max 0 [should not be negative]

Logically, this should also add in to consumption when the battery is discharging.

So PVoutput will not be able to know when you are exporting to the grid because it does not know if you are exporting to the battery or the grid. It also will not know when you are importing because it will not know if you are importing from the grid or the battery. If you don’t care about that, and it isn’t a part of the graph you seem to prefer, then maybe that’s OK.

I think there is another slight problem with this setup though. I don’t think it accounts for the efficiency of the powerwall. That is, if the powerwall is gives you back 90% of what you put in, I think you lose the 10%:

Lets say that while the powerwall is charging (or more accurately not discharging) your numbers are:

mains -5 kWh
solar 20 kWh
battery 10 kWh
So your consumption (sans battery) is 5 kWh

Now evening rolls in and your numbers are:

mains 20 kWh
solar 0 kWh
battery -9 kWh
So your consumption is 29 kWh

Total consumption is 34 kWh for the day. Yet you imported 15 kWh from the mains and generated 20 kWh with solar for a total of 35 kWh. Your battery is at the same state of charge as at the beginning of the cycle.

Just thinking out load here. Sure the battery time-shifts your consumption, and you can measure that with other outputs in IoTaWatt and/or Emoncms, but PVoutput will not show accurate consumption, import or export.

@overeasy, this is not a rush or requirement as I know it is a bit outside the norm, but I thought I would bounce it off you for ideas. Do not rack your brain too much on it as I know you are dealing with many other install types, etc.

Just some raw data if it helps in any way. I ran a RAW chart as you suggested of “MAINS1 + MAINS2 + BATTERY1 + BATTERY2 + SOLAR1 + SOLAR2” which should be my home consumption; works for the IoTaWatt reporting and my EmonCMS dashboard but as you saw with the PVOutput chart sent yesterday it seems to really skew the kWh used (consumption) and feels I consumed 270+ kWhs.

When I pull the two BATTERY feeds from the PVOutput consumption equation, I get back to a rather normal chart. But, as you said, PVOutput sees my battery charge as being consumption when it really is simply doing storage and not being consumed; no energy being consumed at that time by the home.

I configured and treat the battery as a load like the grid. Like the home has two potential grid feeds. A negative number means I’m charging (Exporting) the battery and a positive is discharging (Importing). Using the formula in the IoTaWatt, I can see that home consumption it correctly reported. Here are how my IoTaWatt is configured (mirroring the grid) for battery usage.


And the status looks like:


Where Con is home consumption.

When I do a RAW graph in the IoTaWatt I see this for the last 24 hour period.

With the RAW CSV attached here:
RAWGraph.txt (45.2 KB)

Again, I understand this is a bit abnormal, but all appears correct with the IoTaWatt and EmonCMS reporting when I simply add the two Battery feeds to calculate consumption. It is only the PVOutput that the change seems to impact. That is the odd part.

Ok, you intend for the battery to be negative when charging. That’s somewhat arbitrary and only changes the sign on what I entered above.

One point I made is that PVoutput does not accept negative consumption. You must use the max function to force zero when actually exporting.

Looking at your raw Iotawatt graph for the early morning before solar kicks in, it looks like the battery is providing the power, but the mains ar3 not zero, and in fact appear to be nearly mirror images of each other, indicating to me that one of the CTs may be reversed or that I don’t understand how the powerwall works.

Let me play with a few things and see. I guess what was more odd was that all is valid when reporting via both the IoTaWatt and EmonCMS (which is feed from the IoTaWatt). I will go back and make the change to the PVOutput feed and see what I get.

I see the battery as a load like the grid, so I configured it to act as one where Negative is Export and Positive is Import. As you said, it is arbitrary, and more following simular formulas as the Mains. Right or not, I’m still working though it. I always love a good challenge with such, keeps me young. :slight_smile:

Here is what my feeds look like when the sun is starting to shine. Does that look like one of the mains is backwards? It looks like my consumption is correct.


Your consumption is correct to the extent the math in the formula is being calculated correctly. Whether your actual consumption is correct is unproven to me. I cannot understand why your mains are of nearly equal magnitude but opposite signs. I suppose the powerwall could be achieving zero export by balancing one leg to offset the other, but that seems like unlikely to me. Another flag is the power factors. They are very low. Your fridge power factor is unusually low.

So I’m curious that the way powerwall achieves its mission involves more complex interaction than a typical circuit.

Just an interesting note. Below you can see what the daily consumption is from the data the IoTaWatt sent to my EmonCMS server and it shows the correct home consumption so far today as 11.29kWh.


But the PVOutput chart includes the battery export and is seen as consumption instead of being removed as I would expect when using the same formula in both places. I’m not saying the IoTaWatt had a bug or issue, just interesting that it works apart from the PVOutput feed as I would have expected.

PVOutput is showing my home consumption as home consumption plus battery export (charge) as my daily total energy kWh usage. I may try to add it in the early am again with the MAX 0 function and see what I get. I think in some way I’m confusing or wrapping the number being sent with my earlier test.

Thanks for your thoughts.

OK, I have identified the cause of this. IoTaWatt uploads both power and energy for the live data interval. Energy is cumulative from the start of the day. When the script changes during the day, the base still reflects the old script. This should have corrected as midnight was passed. Not sure how to solve the issue just yet, but I don’t think it’s an ongoing problem and should only effect the day when the change is made. I believe it is a red-herring with respect to the primary issue of consumption.

How do you know it is correct?

Looking at the first post in this thread, notwithstanding the problem with energy discussed above, the battery charge is not part of consumption. So what is the difference between that consumption export script and where it includes the battery charge?

I am still bewildered by the negative and positive mains values in the IoTaWatt graph. Is there a wiring diagram for your setup? Are the mains CTs completely on the grid side of everything?

I believe from this data that you could get along fine with a single CT for the solar and clicking the “double” box. It would simplify everything and also open up another input for you.

Also, does the powerwall use a neutral connector? It appears both inputs are identical. Again, a single CT with “double” would probably be simpler.

With those changes, it would be easier to visualize what is going on. For instance, in this graph:

The battery would show up as a new distinct line because it would have double the magnitude. The illusion is that the battery is the same power as mains_2, but in reality, there are two traces there and it is double Mains_2.

Thy it out, create outputs solar = Solar_1 + Solar_2 and battery = Battery_1 + Battery_2 and mains = Mains_1 + Mains_2. Then plot mains, solar, and battery for this day.

@overeasy, please be aware that I’m not trying to stir things up here, more an observation and I’m very thankful for your input on the matter and see you as an expert on the data.

I’m more than happy to simplify the install and put one CT on both the battery and solar with the double option. My intention is not to complicate or get you upset with my questions; if this is the case. Forgive me. I’m a stats and numbers guy, so I would love to correct anything I have incorrect so I can have reliable data points to work with.

I have created the feed combinations as you have requested and here is what I see in the chart from the IoTaWatt.

When I compare this with the chart from yesterday’s PVOutput, I can see this

What I have observed is that as the battery charges (negative value), only in PVOutput, include the battery charge process as part of home consumption. If this is the script you stated and it only impacts the one day, I’m happy to add it in and simply reload the day afterwards; assuming that would fix it for PVOutput.

With that said, I can check my Mains to ensure one is not reversed as you suspected, combine the battery two CTs and Solar two CTs into single CTs and double them. If you have any suggestions to help me better improve or correct any perceived issues, I’m here to do what you think is right. Understanding the battery is a new variable that you may not be accustom too. I may wait and make the requested changes on a new day (Tomorrow) morning to keep things as they are in the event you have any other input.

Again, sorry if I have come across as being pushy or demanding, I’m just wanting to make sure I use the product as intended to get me the best data I can. If you have other items you would recommend or change, or anything that would give you more insight, let me know. Thanks for all your hard work and support.

Not sure if any of this helps, but below are my Inputs, Outputs, and the two (Emon/Pvoutout) webserver settings.




Below is the PVOutput Outputs as it does not display where I cropped it. Note I did remove the Battery after the first day seeing the issue and have not added it back yet.

Lastly, my recent Status Page if that provides any insight.


Don’t give it a second thought. I’m interested in resolving these issues and it has already turned up one problem with the daily base. Sorry if I’m a little gruff.

I think that looks better and tells the story more clearly, but it does hide the fact that the mains are not really zero, but just add up to zero.

These are two different things. The one day problem is the inflated energy used at the top of this post. The issue with the battery charge being part of consumption in PVoutput is something else.

Unless I’m missing something, this is why you show the battery charge in PVoutput. It’s not being removed (by adding) from consumption.

If you change it and at the same time reload from a day in the past, it should become consistent with a EmonCMS and the energy should start at zero each day.

Again, thank you for the look and input, and rest assured two technical types here looking at different sides of the same object; maybe even an elephant. No issue with gruffness, just want to make sure I’m not over stepping my bounds.

I had noted the below in my previous post

Yes sir, I had the info previously put in the PVOutput configuration but was unsure when the energy value was way off and if it would break something down the line, so I removed it and all my previous day’s data was back to “Normal”. Tonight I will add it back in closer to midnight and re-upload the entire day on Sat. that should fix it like the IoTaWatt and EmonCMS with it being removed.

Based on that, do you still think there is an issue with my Mains here in the home? I can check the CTs and ensure one is one direction and the other is the opposite for the phases. Apart from a few reversed CTs after Tesla performed some work in my panel, I thought things were looking good. However, I also see the Mains question of the phases nearly zero when the battery is in the equation. I can say when it is in that odd phase, the battery is fully running the home.

Here is a screenshot of my IoTaWatt Status with the battery dead (wife and daughter used too many things last night). Once the solar and battery kick in, that is when I notice the Mains being in that Odd phase where the values are polar opposites as we saw previously.

I’m thinking through the switch to a single CT for Solar and Battery (if things look good to you) based on my EMonCMS setup. It would take a few minutes to make the change in the IoTaWatt, but a few hours with feeds and dashboard changes the more I thought about it. If you believe this is the right way to go, I was more using two CTs thinking it would give me more precision to my numbers. Apart from simplicity do you still think I should make the change?

I’m sure you saw this or understand it from your Powerwall research, but the battery unit comes self-contained with both a battery pack for energy storage and its own bi-directional inverter. So, in some ways it can be seen as a “Solar-like” feed converting DC to AC when the house needs extra power or AC to DC when charging from any excess solar. Once the home’s consumption and battery needs are met, excessive energy is sent to the grid as Exporting. There is also a generator transfer switch that manages and monitors the grid for loss grid power. This may be doing something to the mains phase while the battery is supplying power? So many variables and so little time in a day.

Thanks again for the pointers and thoughts.

Below you can see that my battery died this morning around 5:08am now that I’m fully importing from the grid. I guess one needs to use their solar credits some time. :slight_smile:


I don’t know what’s going on there, but I don’t think it’s as simple as a reversed main. The power factors are not believable.

What I think is happening is that when you are using the battery, the voltage reference is wrong. Not necessarily everywhere though. Again, I don’t really know very much about how they do what they do, and there are a lot of different scenarios in the documentation. Is it possible that the two panels are disconnected from each other when running on battery? That could explain this. If the voltage reference for the IoTaWatt is, say, from the panel fed by the battery and inverter, and the “main” panel with the larger loads is being fed from the mains, even though the voltage may be nearly the same, the phase will be arbitrarily different. That would seriously effect the power-factor of any measurements on circuits not fed from the inverter.

This would also have an effect on the actual power measurements as well. That’s why I’m skeptical that your consumption is accurate. Sure it all reconciles to the formulas, but if the raw numbers are off, it will not be accurate.

If this is the case, and I can figure out what’s going on, I can upgrade you to a new V5 PCB and add a second voltage reference for the other side.

@overeasy, once again, I think you are on to something here. I would agree that the voltage in the mains box may be off at the transfer when only on solar/battery power. I agree that the formulas are correct but the raw collection may be incorrect. I may end up having to do some testing in the various combinations, and it may come down to the single voltage source. Let me do some research and just to let you know, I did modify the PVOutput early this AM before the little sun we have now and the battery was dead. So the charts over there look good.

Hello @quella

What’s the status with this? I took another look at the Powerwall documentation and the more I look at it, the more I believe you have a switch between the two panels that disconnects them while on battery. Adding a VT to the other side and assigning those circuits to the other VT would get all the CTs on the correct reference. When the switch is closed, they will have the same voltage and phase, but when it opens, the panel on the mains side will get mains voltage and phase and produce accurate results.

@overeasy Thanks for checking in and following up on this, rest assured I’m still working things on my end to get some info for both of us.

This past week I have begun importing data directly from my smart/net meter into EmonCMS (912mhz) and have a few days worth of results to start comparing. When I compare my Grid import and Export from the smart/net meter and the IoTaWatt findings, I see a few tenths of a difference each day. Not bad and much better than expected when putting things side-by-side. As I get more I will get a better idea of any major differences.

My next move, hopefully this week, it to connect up the PV Inverter’s RS485 system and begin importing this into EmonCMS. This will give me an additional data point to measure the IoTaWatt against with my other parts of the electric system. It may take more time on this one due to some decoding of the commands and output of the inverter’s management system.

I have an electrician coming out today and plan on asking him a few questions and or his thoughts on the difference. He is going to be doing some basic home wiring and I’m looking to have him move the dryer circuit form the battery backup panel to the grid only side because it has been putting a strain on the cells with the rapid discharge and charge, etc. Our dryer pulls 5800w and the battery is good for 7000w peak and 5000w continuous. Just do not need one device pulling all my stored power in a single load of laundry; more than you needed I’m sure.

While the electrician is here, I will also take a few samples of voltage between panels and see if I can see some differences. Today, as you know, is a bad solar and battery charge day, so right now I’m 100% grid. :frowning: But this will give me one baseline and I can take another on a sunny day.

I did see your release of the V5 IoTaWatt. If we go this direction, I assume it would be just the unit/case and a secondary VT plug for the other side. Would migration only required swapping out the SD card? Thoughts on this?

More to come.

Correct. I’ll take the old in trade.


If I’m right about the inter-panel switch, the voltage between the two will only vary when you are on battery and the switch is open.

I agree that running a dryer off battery is probably not a great idea. The lousy recent weather notwithstanding, we are just now switching over to the more time-tested solar driven dryer technique.

Here’s a solar house in your area that is getting as much as 70 kWh/day from a 10kW system. Data driven by IoTaWatt.