Graphs for Solar Power showing wrong numbers

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
arnolde
Posts: 9
Joined: Fri Feb 17, 2012 4:42 am

Graphs for Solar Power showing wrong numbers

Post by arnolde »

Hi everyone,

I'm really confused and after fumbling around a couple days, I'd like to ask for some help please.

I'm collecting the AC Power output values from 2 solar inverters at my home. I wrote an SNMP exec script which delivers the 2 values I'm interested in, and SNMPWALK reads them correctly:

Code: Select all

cacti/rra> snmpwalk -v 1 -c xxxxx host:port .1.3.6.1.4.1.2021.8.1
[...]
UCD-SNMP-MIB::extOutput.1 = STRING: 601
UCD-SNMP-MIB::extOutput.2 = STRING: 372
I have a data source which logs the correct numbers into 2 rrd files, at least "rrdtool info" shows me:
ds[Output].last_ds = "557" for the one file and
ds[Output].last_ds = "345" for the other one --> the values look good and I assume if the last_ds is correct, the rest of the logged values are correct too. (This part has been running unchanged since yesterday)

Now I'm trying to make a graph (duplicating and modifying the "interface in/out" graph template) to plot the 2 values, stacked upon each other, with a "sum of both" line of top. At first glance it looks pretty good:
1-minute.png
1-minute.png (22.48 KiB) Viewed 2323 times
5-minute.png
5-minute.png (22.31 KiB) Viewed 2323 times
But at second glance:
- The heights of the areas seem correct, and match the scale at the left edge.
- But the values printed at the bottom are way off (for comparison, the 4200 is currently producing about 500W, and the 3000 about 300W)

It almost seems like the numbers in the top 2 lines at the bottom are multiplied by 8, but why don't they match the graph scale?
I tried selecting "Turn Bytes into Bits" in the Graph Template Items, then the graphing matches the numbers but everything is 8x too high.

How can I correct the graphing?

Here is my template item list:
template-items.PNG
template-items.PNG (24.76 KiB) Viewed 2323 times
thanks,
Ethan
Last edited by arnolde on Mon Mar 05, 2012 12:12 pm, edited 2 times in total.
arnolde
Posts: 9
Joined: Fri Feb 17, 2012 4:42 am

Re: Graphs for Solar Power showing wrong numbers

Post by arnolde »

If I look at "graph debug mode" I see in the rrdtool command:

[...]
DEF:a="/srv/www/htdocs/cacti/rra/nas02_extoutput_64.rrd":Output:AVERAGE \
DEF:b="/srv/www/htdocs/cacti/rra/nas02_extoutput_63.rrd":Output:AVERAGE \
CDEF:cdefb=a,8,* \
CDEF:cdeff=b,8,* \
[...]

That CDEF looks like the *8 that I'm looking for, but I can't find where it's defined???

EDIT: Found it! In the graph template item definitions for the text lines.
I don't understand why I didnt see that before...

Now the only thing that isn't working yet is the Total display, which should sum up both data sources, but I dont know how to do that? At the moment it just displays the same data as the 4200. How it it supposed to "total all datasources" when the first line only allows me to select one datasource?
Total-all-Datasources.PNG
Total-all-Datasources.PNG (18.47 KiB) Viewed 2316 times
EDIT2: I'll be darned, I found that out too... It's not enough to select "total all datasources" in the item with the purple line, I also had to do that on the 3 textlines below that, and hey presto :-) it works.

Thanks for giving me the possiblility to explain all this to myself! ;-)

regards,
Ethan
arnolde
Posts: 9
Joined: Fri Feb 17, 2012 4:42 am

Re: [SOLVED] Graphs for Solar Power showing wrong numbers

Post by arnolde »

me again ;-)

i have another question that I hope isnt quite as stupid as the first ;-)

My graph now:
Image

Notice that the "Total: ... Average" number is not the "sum of the averages" above it, but the average of the 2 averages, which is not really interesting. How can I make it display the sum of the 2 AVERAGE's of both datasources?

EDIT: Note that since this IMG-Link is the live graph, now that the problem was solved further on, it shows the correct values now.

thanks,
Ethan
Last edited by arnolde on Wed Mar 07, 2012 9:17 am, edited 1 time in total.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: [SOLVED] Graphs for Solar Power showing wrong numbers

Post by BSOD2600 »

Please post the graph debug output.

My guess is the need for a CDEF.
arnolde
Posts: 9
Joined: Fri Feb 17, 2012 4:42 am

Re: [SOLVED] Graphs for Solar Power showing wrong numbers

Post by arnolde »

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Solar Energy' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='Watts' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="/srv/www/htdocs/cacti/rra/nas02_extoutput_64.rrd":Output:AVERAGE \
DEF:b="/srv/www/htdocs/cacti/rra/nas02_extoutput_63.rrd":Output:AVERAGE \
CDEF:cdefi=TIME,1330414243,GT,a,a,UN,0,a,IF,IF,TIME,1330414243,GT,b,b,UN,0,b,IF,IF,+ \
AREA:a#FF0000FF:"SolarMax 3000"  \
GPRINT:a:LAST:"Current\:%8.0lf"  \
GPRINT:a:AVERAGE:"Average\:%8.0lf"  \
GPRINT:a:MAX:"Maximum\:%8.0lf\n"  \
AREA:b#F5F800FF:"SolarMax 4200":STACK \
GPRINT:b:LAST:"Current\:%8.0lf"  \
GPRINT:b:AVERAGE:"Average\:%8.0lf"  \
GPRINT:b:MAX:"Maximum\:%8.0lf\n"  \
LINE1:cdefi#8D00BAFF:"Total"  \
GPRINT:cdefi:LAST:"        Current\:%8.0lf"  \
GPRINT:cdefi:AVERAGE:"Average\:%8.0lf"  \
GPRINT:cdefi:MAX:"Maximum\:%8.0lf\n" 
arnolde
Posts: 9
Joined: Fri Feb 17, 2012 4:42 am

Re: [SOLVED] Graphs for Solar Power showing wrong numbers

Post by arnolde »

Thanks, the first link I had already tried to understand, the second one was a little easier for me.
If I could just write the graph definition by hand, it would probably be easy, something like:
CDEF:cdefx=average1,average2,+

But when editing the graph items, I only have limited options. Right now I have (for the 2nd last line):

GPRINT, AVERAGE, CDEF=Total All Datasources

But when going to the CDEF editor, I can add elements like SIN,COS or +,-,* or "total of all datasources" or "one datasource" but I dont see how to calculate the average of a, the average of b, and then add the two?
arnolde
Posts: 9
Joined: Fri Feb 17, 2012 4:42 am

Re: [SOLVED] Graphs for Solar Power showing wrong numbers

Post by arnolde »

I'm still stumped on this.
I want to add the average of a to the average of b to readout the total average power output.
But I see no way to calculate the "average of a" in a CDEF, except maybe in a complicated way by adding all the values up and then dividing them by the count. I can't find a way to insert the already calculated average from the item above into my new CDEF.
arnolde
Posts: 9
Joined: Fri Feb 17, 2012 4:42 am

Re: Graphs for Solar Power showing wrong numbers

Post by arnolde »

can nobody give me a hint?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: [SOLVED] Graphs for Solar Power showing wrong numbers

Post by gandalf »

arnolde wrote:... but I dont see how to calculate the average of a, the average of b, and then add the two?
This will be done by Cacti in the background. The docs (see 1st link of my sig) describe, which parameters are available and how to use them.
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: [SOLVED] Graphs for Solar Power showing wrong numbers

Post by gandalf »

arnolde wrote:I'm still stumped on this.
I want to add the average of a to the average of b to readout the total average power output.
But I see no way to calculate the "average of a" in a CDEF, except maybe in a complicated way by adding all the values up and then dividing them by the count. I can't find a way to insert the already calculated average from the item above into my new CDEF.
You may of course manually add a CDEF that reads CDEF=a,b,+. But that's not a must
R.
arnolde
Posts: 9
Joined: Fri Feb 17, 2012 4:42 am

Re: Graphs for Solar Power showing wrong numbers

Post by arnolde »

duuuh. of course. the solution is to first add a+b and THEN use the automatic AVERAGE function.
Thanks very much!
I realize the docs spell it out real clear for you guys who know it already, but I'm afraid even after intensive studying I had trouble understanding some points. Maybe a few more examples (even really simple ones like this one) would help :-)

I still have one more issue though. The AVERAGE readout is still far from the actual average for any given graph.
i.e. right now (14:30 on wednesday) the average shown is 2164W, which means that if I counted all the colored squares and distributed them along the bottom of the graph (consider "melting the iceberg" and then looking how high the water level is) then I should reach 2164 on the scale. But in reality it's much less, should be more like 500-1000. Does the AVERAGE function only sum up >0 values? How can I make it count 0 as 0 and calculate the correct average? If it works correctly, at the end of the day the average kW multiplied by 24 should be equal to the total kWh generated by the system on that day, which is usually between 5 and 30.

regards,
Ethan
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Graphs for Solar Power showing wrong numbers

Post by gandalf »

arnolde wrote:duuuh. of course. the solution is to first add a+b and THEN use the automatic AVERAGE function.
Thanks very much!
I realize the docs spell it out real clear for you guys who know it already, but I'm afraid even after intensive studying I had trouble understanding some points. Maybe a few more examples (even really simple ones like this one) would help :-)
Ok. Please write an example and I'll consider integrating that into the docs.
If it works correctly, at the end of the day the average kW multiplied by 24 should be equal to the total kWh generated by the system on that day, which is usually between 5 and 30.
No. rrdtool stores everything as a rate, so it's a "per second" value, not a "per hour value".
Please, first make sure, that the value coming from your script is correct. Have a read at 2nd link of my sig to know where to find the data fetched from your target system. Verify, that this number is correct (be it a COUNTER or a GAUGE).
Then, make sure to understand what value is stored into rrd files and that those values are "correct", keeping in mind that rrdtool stores rates only.
Last, make sure how to total the data found to get the daily amount of power printed correctly. It is correct, that multiplying the rate by the "timespan" will yield the "integral" of power. But it is necessary, to use the correct "timespan"
R.
DonMccarthy
Posts: 1
Joined: Fri Jan 10, 2014 1:43 am

Re: Graphs for Solar Power showing wrong numbers

Post by DonMccarthy »

arnolde wrote:Hi everyone,

I'm really confused and after fumbling around a couple days, I'd like to ask for some help please.

I'm collecting the AC Power output values from 2 solar inverters at my home. I wrote an SNMP exec script which delivers the 2 values I'm interested in, and SNMPWALK reads them correctly:

Code: Select all

cacti/rra> snmpwalk -v 1 -c xxxxx host:port .1.3.6.1.4.1.2021.8.1
[...]
UCD-SNMP-MIB::extOutput.1 = STRING: 601
UCD-SNMP-MIB::extOutput.2 = STRING: 372
I have a data source which logs the correct numbers into 2 rrd files, at least "rrdtool info" shows me:
ds[Output].last_ds = "557" for the one file and
ds[Output].last_ds = "345" for the other one --> the values look good and I assume if the last_ds is correct, the rest of the logged values are correct too. (This part has been running unchanged since yesterday)

Now I'm trying to make a graph (duplicating and modifying the "interface in/out" graph template) to plot the 2 values, stacked upon each other, with a "sum of both" line of top. At first glance it looks pretty good:
1-minute.png
5-minute.png
But at second glance:
- The heights of the areas seem correct, and match the scale at the left edge.
- But the values printed at the bottom are way off (for comparison, the 4200 is currently producing about 500W, and the 3000 about 300W)

It almost seems like the numbers in the top 2 lines at the bottom are multiplied by 8, but why don't they match the graph scale?
I tried selecting "Turn Bytes into Bits" in the Graph Template Items, then the graphing matches the numbers but everything is 8x too high.

How can I correct the graphing?

Here is my template item list:
template-items.PNG
thanks,
Ethan
Hello friend I know thread is bit old but is there any software which shows right information about energy generated from these panels? Waiting for reply thanks in advance:)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests