jwillemsen / saj_collector

Pull stats from SAJ Solar Inverter and push them to PVOutput
https://www.remedy.nl
MIT License
9 stars 0 forks source link

saj_output_collector off by factor 10 #3

Closed degerrit closed 6 years ago

degerrit commented 6 years ago

Just had a new PV system installed last week. saj_collector did its job wonderfully, first time! Only issue is when there are connectivity issues (flaky Powerline), I lose some stats, ah well.

However, saj_output_collector appears to be using generation stats off by factor 10?

$ cd /etc && ruby /usr/local/bin/saj_output_collector Number of days until now for this month 26 ... Energy generated 20171225: 4800 WH Energy generated 20171226: 13500 WH

Actuals -> see attachment

pvoutput system_id: 29573

Inverter info:

Model: | Sununo Plus 2K Grid Compliance: | C10_11 Maste Control Firmware Ver: | V1.050 Slave Control Firmware Ver: | V1.050 Display Board Firmware Ver: | V1.125 Ethernet Module Firmware Ver: | V1.018

pvoutput_29573_inverter_webpage_daily_monitoring

jwillemsen commented 6 years ago

Good to hear the regular capture works. Can you retrieve /day_trend.xml from your saj collector and attach it here. That is the raw output the script uses, with that I can test it here. Probably it is a regional setting issue with the decimal separator handling.

degerrit commented 6 years ago

Here it is: day_trend.xml.txt No decimals, and it's not in Wh or in kWh, but in decawatts ?!

jwillemsen commented 6 years ago

Looks SAJ made a change in newer versions to be more precise in the day_trend.xml, attached my version, granularity is 100Wh where yours is 10Wh. Will make a change later this week to make it possible to configure the multiplication factor.

day_trend.xml.txt

jwillemsen commented 6 years ago

Looks SAJ made a change in newer versions to be more precise in the day_trend.xml, attached my version, granularity is 100Wh where yours is 10Wh. Will make a change later this week to make it possible to configure the multiplication factor.

day_trend.xml.txt

jwillemsen commented 6 years ago

I have just uploaded a new v0.5.0 release of the gem, can you install that and add the new day_trend_multiplication_factor to your yaml file with a value of 10 and trigger the script again?

jwillemsen commented 6 years ago

@degerrit Does the new version work with your inverter?

degerrit commented 6 years ago

Yep, it works - thanks.

Oddly, the day totals of my consumption data is being wiped on pvoutput.org (which I can restore via more->recalculate, since the hourly data is still there). Will need to look into that. It must be related to saj_output_collector somehow, since only the data from this month is affected (and production only started December 21st, though consumption was being measured long before).

jwillemsen commented 6 years ago

Maybe the underlying pvoutput ruby code sends a zero, saj_output_collector only sends the energy generated

degerrit commented 6 years ago

I expected so. I'll check out the pvoutput code, I see it's also on github.

I guess this is the snippet that is relevant?

options.each do |date, values|
  puts "Energy generated #{date}: #{values[:energy_generated]} Wh"
end

pvoutput.add_batch_output(options)
jwillemsen commented 6 years ago

Yes

degerrit commented 6 years ago

FYI: seems like that last "consumption wiping" side-effect (of saj_output_collector) is a pvoutput.org API bug -> https://forum.pvoutput.org/t/api-post-addbatchoutput-of-generation-data-results-in-consumption-data-automatic-upload-being-zeroed/386/2

I could stick to using only _sajoutput, once my network connectovity stabilizes with new cabling :-) _saj_outputcollector seems unnecessary, if _sajoutput has already logged everything.