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

Temperature is missing #11

Closed degerrit closed 4 years ago

degerrit commented 4 years ago

Hi there, I just noticed on pvoutput.org that somewhere early 2019 it no longer logs temperature. It would be around the time I migrated to a new version on my Pi (saj_collector-0.5.2 -> saj_collector-0.5.8). To be fair; I haven't downgraded to see what happens.

The inverter's website is still displaying temperature; the XML also contains it.

Anything I can do to help troubleshoot? Or did the pvoutput.org API change? (I'm a donator, since I also log consumption)

Model: SAJ Sununo Plus 2K

real_time_data.xml:

<real_time_data>
<state>Normal</state>
<Vac_l1>240.7</Vac_l1>
<Vac_l2>-</Vac_l2>
<Vac_l3>-</Vac_l3>
<Iac_l1>4.03</Iac_l1>
<Iac_l2>-</Iac_l2>
<Iac_l3>-</Iac_l3>
<Freq1>49.99</Freq1>
<Freq2>-</Freq2>
<Freq3>-</Freq3>
<pac1>958</pac1>
<pac2>-</pac2>
<pac3>-</pac3>
<p-ac>958</p-ac>
<temp>39.0</temp>
<e-today>1.14</e-today>
<t-today>2.7</t-today>
<e-total>6513.80</e-total>
<CO2>6494.26</CO2>
<t-total>11548.1</t-total>
<v-pv1>244.5</v-pv1>
<v-pv2>0.0</v-pv2>
<v-pv3>-</v-pv3>
<v-bus>373.0</v-bus>
<maxPower>1006</maxPower>
<i-pv11>4.14</i-pv11>
<i-pv12>-</i-pv12>
<i-pv13>-</i-pv13>
<i-pv14>-</i-pv14>
<i-pv21>-</i-pv21>
<i-pv22>-</i-pv22>
<i-pv23>-</i-pv23>
<i-pv24>-</i-pv24>
<i-pv31>-</i-pv31>
<i-pv32>-</i-pv32>
<i-pv33>-</i-pv33>
<i-pv34>-</i-pv34>
</real_time_data>
degerrit commented 4 years ago

Temperature seems to be fetched correctly; here's my cronjob: */5 6-21 * * * saj_collector cd /etc && ruby /usr/local/bin/saj_collector >> /tmp/saj_collector_pvoutput.log 2>&1

And here's the last lines of that log file:

Time: 2020-09-11 10:10:04 +0200

Realtime:
  Temp: 39.0 C
  V: 240.9 V
  I: 4.39 A
  P: 995 W

Total:
  Power (today): 1.17 kWH
  Power (all time): 6513.83 kWH
  Run Time: 2.7 Hours
  Run Time: 11548.1 Hours
jwillemsen commented 4 years ago

The pvoutput ruby gem I am using doesn't have an easy way to enable logging, can you find pvoutput/client.rb on your system and on line 7 change the line

# debug_output $stdout

to

debug_output $stdout

And rerun saj_collector, in my case the temperature is there, see https://pvoutput.org/intraday.jsp?id=36937&sid=33783&dt=20200911

jwillemsen commented 4 years ago

The output of my system (with the Apikey removed)

Time: 2020-09-11 14:48:31 +0200

Realtime:
  Temp: 33.0 C
  V: 234.3 V
  I: 4.19 A
  P: 993 W

Total:
  Power (today): 9.9 kWH
  Power (all time): 20400.6 kWH
  Run Time: 7.4 Hours
  Run Time: 26010.8 Hours
opening connection to pvoutput.org:80...
opened
<- "POST /service/r2/addstatus.jsp HTTP/1.1\r\nX-Pvoutput-Apikey: \r\nX-Pvoutput-Systemid: 33783\r\nConnection: close\r\nHost: pvoutput.org\r\nContent-Length: 54\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n"
<- "d=20200911&t=14%3A48&v1=9900.0&v2=993&v5=33.0&v6=234.3"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Fri, 11 Sep 2020 12:48:32 GMT\r\n"
-> "Set-Cookie: JSESSIONID=1nym25v24qxjw1pz3dwayfa5ar;Path=/\r\n"
-> "Expires: Thu, 01 Jan 1970 00:00:00 GMT\r\n"
-> "Content-Type: text/plain;charset=ISO-8859-1\r\n"
-> "Connection: close\r\n"
-> "Server: Jetty(7.6.17.v20150415)\r\n"
-> "\r\n"
reading all...
-> "OK 200: Added Status"
read 20 bytes
Conn close
jwillemsen commented 4 years ago

According to https://pvoutput.org/help.html for addstatus.jsp the temperature is v5 which is a decimal, so 33.0 is correctly passed with my inverter

degerrit commented 4 years ago

Thanks @jwillemsen

How peculiar - it's right there! I guess I need to file an issue with the pvoutput.org guys?

-------------------------
Time: 2020-09-11 17:14:49 +0200

Realtime:
  Temp: 38.3 C
  V: 236.4 V
  I:  A
  P: 286 W

Total:
  Power (today): 9.10 kWH
  Power (all time): 6521.76 kWH
  Run Time: 9.8 Hours
  Run Time: 11555.2 Hours
opening connection to pvoutput.org:80...
opened
<- "POST /service/r2/addstatus.jsp HTTP/1.1\r\nX-Pvoutput-Apikey: REDACTED\r\nX-Pvoutput-Systemid: 29573\r\nConnection: close\r\nHost: pvoutput.org\r\nContent-Length: 54\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n"
<- "d=20200911&t=17%3A14&v1=9100.0&v2=286&v5=38.3&v6=236.4"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Fri, 11 Sep 2020 15:14:49 GMT\r\n"
-> "Set-Cookie: JSESSIONID=1jly76xhqsl2l1t4u7axj4qk6w;Path=/\r\n"
-> "Expires: Thu, 01 Jan 1970 00:00:00 GMT\r\n"
-> "Content-Type: text/plain;charset=ISO-8859-1\r\n"
-> "Connection: close\r\n"
-> "Server: Jetty(7.6.17.v20150415)\r\n"
-> "\r\n"
reading all...
-> "OK 200: Added Status"
read 20 bytes
Conn close
jwillemsen commented 4 years ago

Yes, can you open issue at pvoutput and maybe add a link here to it?

degerrit commented 4 years ago

If I don't find it, I will.

I suspect it may have to do with my other integrations (consumption is via flukso, but I see that at some point I also enabled Wunderground - perhaps it is overwriting the temperature, cause that sure is what it looks like).

image

So far, changing the "Main" to an "Extended data" stream hasn't helped, but I'll give it a few minutes.

degerrit commented 4 years ago

Closing the ticket.

The "competing" pvoutput.org Weather Device (under Edit System, Automatic Uploads) was the culprit, and was overwriting the Temperature (even though that specific input was in error state and not really logging anything).

It must have taken several hours for this change to go live: the Temperature field remained blank on yesterday the 11th, even while the PV logged data for 2 hours after I disabled that Automatic Upload ~18:00 CEST:

image

But as of this morning things look find & dandy again:

image

image

Thanks for your help with debugging the API call @jwillemsen !