Git Product home page Git Product logo

saj_collector's Introduction

SAJ Collector

Actions Status Codacy Badge Gem Version

Pull statistics from SAJ Solar Inverter and push them to PVOutput. This ruby gem is based on https://github.com/johnf/jfy_collector

Installation

First install ruby on your system through your favorite package manager. On Windows download and install ruby from Rubyinstaller.

Install saj_collector by running the following command from a linux shell or windows command prompt

gem install saj_collector

Usage

Create a config file for PVOutput in saj_collector.yaml. This should contain the IP address of your SAJ Solar Invertor (saj), your PVOutput system id (system_id) and PVOutput API key (api_key). These PVOutput system id and API key can be found on your PVOutput account page.

Some SAJ Solar Inverters provide the generation of each day with a granularity of 0.1kWh and some with a granularity of 0.01kWh. In case of the last you have to change the day_trend_multiplication_factor within your saj_collector.yaml to 10. An incorrect day_trend_multiplication_factor triggers a Bad Post exception when running the saj_output_collector script.

At the moment you are a PVOutput donator change donation_mode to true to enable the donation features of PVOutput.

:saj: a.b.c.d
:system_id: 123456
:api_key: fb6a2e3
:day_trend_multiplication_factor: 100
:donation_mode: false

Run the SAJ Collector from the command prompt or shell

saj_collector

This will run the current power generation frm the SAJ Collector and push the data to PVOutput.

The SAJ Output Collector will retrieve the generation of each day of the current month and push the data to PVOutput. Run the SAJ Output Collector from the command prompt or shell

saj_output_collector

Scheduling the collector

On Linux you can add saj_collector and saj_output_collector to your crontab to let it automatically push with a certain frequency.

At the moment you add any of these to your crontab you have to make sure that the saj_collector.yaml file can be found. For example when you put the saj_collector.yaml file in /usr/local/bin (and also the gem) and want to run it each 5 minutes between 6AM and 10PM you should add to your crontab

*/5 6-21 * * * cd /usr/local/bin && ruby /usr/local/bin/saj_collector

On Windows you can create a task using the Task Scheduler. Make sure that for the Action you specific the path of the saj_collector.yaml file as Start in.

Development

After checking out the repo, run bin/setup to install dependencies.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in lib/saj_collector/version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jwillemsen/saj_collector. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

saj_collector's People

Contributors

codacy-badger avatar dependabot[bot] avatar jwillemsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

saj_collector's Issues

Temperature is missing

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>

saj_output_collector off by factor 10

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

Connectivity issues

Dear Johnny,

I have a SAJ 3KM solar inverter.
I have noticed you have this interesting project to connect to the inverter. I wonder how you connect to the inverter. I only have an RS232 module. Did you buy an extra ethernet or wifi module to connect ? I am puzzled to figure out the right RS232 parameters.

Could you give me some more details ?

Thanks !

Paul

Add support for 3 phase inverter amperage

doc.elements.each('real_time_data/i-grid') do |e|

<real_time_data>
<state>Normal</state>
<Vac_l1>230.7</Vac_l1>
<Vac_l2>231.3</Vac_l2>
<Vac_l3>229.9</Vac_l3>
<Iac_l1>0.30</Iac_l1>
<Iac_l2>0.32</Iac_l2>
<Iac_l3>0.33</Iac_l3>
<Freq1>49.96</Freq1>
<Freq2>49.97</Freq2>
<Freq3>49.97</Freq3>
<pac1>28</pac1>
<pac2>27</pac2>
<pac3>33</pac3>
<p-ac>85</p-ac>
<temp>29.8</temp>
<e-today>1.15</e-today>
<t-today>5.5</t-today>
<e-total>9211.77</e-total>
<CO2>9184.13</CO2>
<t-total>4819.1</t-total>
<v-pv1>565.8</v-pv1>
<i-pv1>0.19</i-pv1>
<v-pv2>553.4</v-pv2>
<i-pv2>0.23</i-pv2>
<v-bus>620.0</v-bus>
<maxPower>627</maxPower>
</real_time_data>

Add unit tests

Would be a good thing to have some unit tests which validate that a certain SAJ input xml results in the expected calls to pvoutput, the tests within the pvoutput gem could help with this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.