saj_collector 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +25 -4
- data/README.md +14 -10
- data/exe/saj_collector +4 -2
- data/exe/saj_output_collector +4 -2
- data/lib/saj_collector/version.rb +1 -1
- data/saj_collector.gemspec +2 -2
- metadata +17 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 142b2785eb3f49663f7e3c58cbb68e5396cbab7851725d5c2b50c1be75ca6bf4
|
4
|
+
data.tar.gz: 520737a4c49879ef23781f4cac71dfa9652cd6602953f2dff913e270d1647cad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b03aaa0f7c6907c5d0d6cebcae134e00c145e33e760c53693d551dc35823f1a9b61149eabdc8534e051906d8d0fc2f5ac488328d459847e6f5dfea65ab2835b
|
7
|
+
data.tar.gz: 02ea3bc2079243b2ccfb217381158d0a049d4332e80afc5c37176c7d6b69ea774bf899177336a60b92339e4143131d104500f733ce3dfd5d8b9698400e21ff40
|
data/.github/workflows/ruby.yml
CHANGED
@@ -1,18 +1,39 @@
|
|
1
1
|
name: Ruby
|
2
2
|
|
3
|
-
on:
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
pull_request:
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
schedule:
|
9
|
+
- cron: '0 7 * * SUN'
|
4
10
|
|
5
11
|
jobs:
|
6
12
|
build:
|
7
|
-
|
8
13
|
runs-on: ubuntu-latest
|
9
|
-
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
name: [
|
17
|
+
Ruby24,
|
18
|
+
Ruby25,
|
19
|
+
Ruby26,
|
20
|
+
Ruby27
|
21
|
+
]
|
22
|
+
include:
|
23
|
+
- name: Ruby24
|
24
|
+
RubyVersion: 2.4
|
25
|
+
- name: Ruby25
|
26
|
+
RubyVersion: 2.5
|
27
|
+
- name: Ruby26
|
28
|
+
RubyVersion: 2.6
|
29
|
+
- name: Ruby27
|
30
|
+
RubyVersion: 2.7
|
10
31
|
steps:
|
11
32
|
- uses: actions/checkout@v1
|
12
33
|
- name: Set up Ruby 2.6
|
13
34
|
uses: actions/setup-ruby@v1
|
14
35
|
with:
|
15
|
-
ruby-version:
|
36
|
+
ruby-version: ${{ matrix.RubyVersion }}
|
16
37
|
- name: Build and test with Rake
|
17
38
|
run: |
|
18
39
|
gem install bundler
|
data/README.md
CHANGED
@@ -23,6 +23,10 @@ PVOutput system id (```system_id```) and PVOutput API key (```api_key```). These
|
|
23
23
|
system id and API key can be found on your
|
24
24
|
[PVOutput account page](https://pvoutput.org/account.jsp).
|
25
25
|
|
26
|
+
Some SAJ Solar Inverters provide the generation of each day with a granularity of 0.1kWh and some with
|
27
|
+
a granularity of 0.01kWh. In case of the last you have to change the ```day_trend_multiplication_factor```
|
28
|
+
within your ```saj_collector.yaml``` to 10.
|
29
|
+
|
26
30
|
``` yaml
|
27
31
|
:saj: a.b.c.d
|
28
32
|
:system_id: 123456
|
@@ -30,27 +34,24 @@ system id and API key can be found on your
|
|
30
34
|
:day_trend_multiplication_factor: 100
|
31
35
|
```
|
32
36
|
|
33
|
-
Run the SAJ Collector
|
37
|
+
Run the SAJ Collector from the command prompt or shell
|
34
38
|
|
35
39
|
saj_collector
|
36
40
|
|
37
41
|
This will run the current power generation frm the SAJ Collector and push the
|
38
|
-
data once to PVOutput.
|
39
|
-
``saj_collector`` to your crontab or a custom script to let it automatically push with
|
40
|
-
a certain frequency.
|
42
|
+
data once to PVOutput.
|
41
43
|
|
42
44
|
The SAJ Output Collector will retrieve the generation of each day of the current month and
|
43
45
|
push the data once to PVOutput.
|
44
|
-
|
46
|
+
|
47
|
+
Run the SAJ Output Collector from the command prompt or shell
|
45
48
|
|
46
49
|
saj_output_collector
|
47
50
|
|
48
|
-
|
49
|
-
a certain frequency.
|
51
|
+
## Scheduling the collecor
|
50
52
|
|
51
|
-
|
52
|
-
a
|
53
|
-
within your ```saj_collector.yaml``` to 10.
|
53
|
+
On Linux you can add ``saj_collector`` and ``saj_output_collector`` to your crontab to let it automatically push with
|
54
|
+
a certain frequency.
|
54
55
|
|
55
56
|
At the moment you add any of these to your crontab you have to make sure
|
56
57
|
that the ``saj_collector.yaml`` file can be found. For example when you put the ``saj_collector.yaml`` file
|
@@ -59,6 +60,9 @@ add to your crontab
|
|
59
60
|
|
60
61
|
*/5 6-21 * * * cd /usr/local/bin && ruby /usr/local/bin/saj_collector
|
61
62
|
|
63
|
+
On Windows you can create a task using the Task Scheduler. Make sure that for the Action you specific the path
|
64
|
+
of the ``saj_collector.yaml`` file as ``Start in``.
|
65
|
+
|
62
66
|
## Development
|
63
67
|
|
64
68
|
After checking out the repo, run `bin/setup` to install dependencies.
|
data/exe/saj_collector
CHANGED
@@ -6,15 +6,17 @@ require 'pvoutput/client'
|
|
6
6
|
require 'yaml'
|
7
7
|
require 'ipaddress'
|
8
8
|
|
9
|
+
yaml_file = 'saj_collector.yaml'
|
10
|
+
|
9
11
|
# Load the configuration from the yaml file
|
10
|
-
sajcollector_config = YAML.load_file(
|
12
|
+
sajcollector_config = YAML.load_file(yaml_file)
|
11
13
|
|
12
14
|
# Create a pvoutput with the configured system_id and api_key which both
|
13
15
|
# can be obtained from the pvoutput website
|
14
16
|
pvoutput = PVOutput::Client.new(sajcollector_config[:system_id], sajcollector_config[:api_key])
|
15
17
|
|
16
18
|
unless IPAddress.valid?(sajcollector_config[:saj])
|
17
|
-
raise ("[#{sajcollector_config[:saj]}] is not a valid IP address")
|
19
|
+
raise ("[#{sajcollector_config[:saj]}] is not a valid IP address, please correct your #{yaml_file} file")
|
18
20
|
end
|
19
21
|
|
20
22
|
# Get the current realtime data from the SAJ device
|
data/exe/saj_output_collector
CHANGED
@@ -6,15 +6,17 @@ require 'pvoutput/client'
|
|
6
6
|
require 'yaml'
|
7
7
|
require 'ipaddress'
|
8
8
|
|
9
|
+
yaml_file = 'saj_collector.yaml'
|
10
|
+
|
9
11
|
# Load the configuration from the yaml file
|
10
|
-
sajcollector_config = YAML.load_file(
|
12
|
+
sajcollector_config = YAML.load_file(yaml_file)
|
11
13
|
|
12
14
|
# Create a pvoutput with the configured system_id and api_key which both
|
13
15
|
# can be obtained from the pvoutput website
|
14
16
|
pvoutput = PVOutput::Client.new(sajcollector_config[:system_id], sajcollector_config[:api_key])
|
15
17
|
|
16
18
|
unless IPAddress.valid?(sajcollector_config[:saj])
|
17
|
-
raise ("[#{sajcollector_config[:saj]}] is not a valid IP address")
|
19
|
+
raise ("[#{sajcollector_config[:saj]}] is not a valid IP address, please correct your #{yaml_file} file")
|
18
20
|
end
|
19
21
|
|
20
22
|
# Get the current day trend data from the SAJ device
|
data/saj_collector.gemspec
CHANGED
@@ -17,11 +17,11 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.require_paths = ['lib']
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
|
20
|
-
spec.add_dependency 'pvoutput', '~> 0.4.0'
|
21
20
|
spec.add_dependency 'ipaddress'
|
21
|
+
spec.add_dependency 'pvoutput', '~> 0.4.0'
|
22
22
|
|
23
23
|
spec.add_development_dependency 'bundler'
|
24
|
-
spec.add_development_dependency 'rake', '
|
24
|
+
spec.add_development_dependency 'rake', '>= 12.3.3'
|
25
25
|
spec.add_development_dependency 'rspec'
|
26
26
|
spec.add_development_dependency 'rubocop', '~> 0.52.0'
|
27
27
|
spec.add_development_dependency 'rubocop-rspec'
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saj_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johnny Willemsen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: ipaddress
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: pvoutput
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.4.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.4.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 12.3.3
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 12.3.3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,8 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
requirements: []
|
155
|
-
|
156
|
-
rubygems_version: 2.7.3
|
155
|
+
rubygems_version: 3.0.8
|
157
156
|
signing_key:
|
158
157
|
specification_version: 4
|
159
158
|
summary: Pull stats from SAJ Solar Inverter and push them to PVOutput
|