saj_collector 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/saj_collector +19 -19
- data/exe/saj_output_collector +6 -5
- data/lib/saj_collector/version.rb +1 -1
- data/saj_collector.gemspec +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aadd3eb567df88df560c127500d33875d0b39f8dbed4728dc58812034c6471d3
|
4
|
+
data.tar.gz: 10d9fbb5e8151cb7e44963ca4fb1d156e6b44bed4ba224677e2eba4611a39499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62c56c6a9bf49fd761bf16c74fc985fcb1717659d08b17b99db47264c90bcfd105d18a1376f09ce15379b216fbc64af7edc3233352907023daa9cb61b396cb5b
|
7
|
+
data.tar.gz: c340d3fc7171eac32cfb9c7fd6dfb0854401896f57fde87032e53dbc5f0b05bd51c638da478eb4a02fbae20a6b6f2ea22ba6b80a1f9cd1e2027b016e13624044
|
data/exe/saj_collector
CHANGED
@@ -21,7 +21,7 @@ options = {
|
|
21
21
|
'power_today' => 0,
|
22
22
|
'power_all_time' => 0,
|
23
23
|
'runtime_today' => 0,
|
24
|
-
'runtime_all_time' => 0
|
24
|
+
'runtime_all_time' => 0
|
25
25
|
}
|
26
26
|
|
27
27
|
# Get the current realtime data from the SAJ device
|
@@ -31,40 +31,40 @@ c = Net::HTTP.get(sajcollector_config[:saj], '/real_time_data.xml')
|
|
31
31
|
doc = REXML::Document.new c
|
32
32
|
|
33
33
|
# Get the temperature
|
34
|
-
doc.elements.each('real_time_data/temp'){
|
35
|
-
|
34
|
+
doc.elements.each('real_time_data/temp') { |e|
|
35
|
+
options[:temperature] = e.text
|
36
36
|
}
|
37
37
|
|
38
38
|
# e-today is in kWh where pvoutput is Wh
|
39
|
-
doc.elements.each('real_time_data/e-today'){
|
40
|
-
|
39
|
+
doc.elements.each('real_time_data/e-today') { |e|
|
40
|
+
options[:energy_generated] = e.text.to_f * 1000
|
41
41
|
}
|
42
42
|
|
43
43
|
# Get the power generated
|
44
|
-
doc.elements.each('real_time_data/p-ac'){
|
45
|
-
|
44
|
+
doc.elements.each('real_time_data/p-ac') { |e|
|
45
|
+
options[:power_generated] = e.text
|
46
46
|
}
|
47
47
|
|
48
48
|
# Get the current amperage
|
49
|
-
doc.elements.each('real_time_data/i-grid'){
|
50
|
-
|
49
|
+
doc.elements.each('real_time_data/i-grid') { |e|
|
50
|
+
options[:amperage] = e.text
|
51
51
|
}
|
52
52
|
|
53
53
|
# Get the voltage
|
54
|
-
doc.elements.each('real_time_data/v-grid'){
|
55
|
-
|
54
|
+
doc.elements.each('real_time_data/v-grid') { |e|
|
55
|
+
options[:voltage] = e.text
|
56
56
|
}
|
57
|
-
doc.elements.each('real_time_data/e-today'){
|
58
|
-
|
57
|
+
doc.elements.each('real_time_data/e-today') { |e|
|
58
|
+
options[:power_today] = e.text
|
59
59
|
}
|
60
|
-
doc.elements.each('real_time_data/e-total'){
|
61
|
-
|
60
|
+
doc.elements.each('real_time_data/e-total') { |e|
|
61
|
+
options[:power_all_time] = e.text
|
62
62
|
}
|
63
|
-
doc.elements.each('real_time_data/t-today'){
|
64
|
-
|
63
|
+
doc.elements.each('real_time_data/t-today') { |e|
|
64
|
+
options[:runtime_today] = e.text
|
65
65
|
}
|
66
|
-
doc.elements.each('real_time_data/t-total'){
|
67
|
-
|
66
|
+
doc.elements.each('real_time_data/t-total') { |e|
|
67
|
+
options[:runtime_all_time] = e.text
|
68
68
|
}
|
69
69
|
|
70
70
|
puts '-------------------------'
|
data/exe/saj_output_collector
CHANGED
@@ -34,16 +34,17 @@ day_trend_multiplication = 100
|
|
34
34
|
|
35
35
|
# Some SAJ Inverters provide they energy_generated in granularity of 0.1kWh and
|
36
36
|
# others in 0.01kWh.
|
37
|
-
|
38
|
-
|
37
|
+
unless sajcollector_config[:day_trend_multiplication_factor].nil?
|
38
|
+
day_trend_multiplication = sajcollector_config[:day_trend_multiplication_factor].to_i
|
39
39
|
end
|
40
40
|
|
41
41
|
while counter < days
|
42
42
|
value = {
|
43
|
-
:energy_generated => 0
|
43
|
+
:energy_generated => 0
|
44
|
+
}
|
44
45
|
# Get the power output of the day,
|
45
|
-
doc.elements.each("day_trend/d#{counter}"){
|
46
|
-
|
46
|
+
doc.elements.each("day_trend/d#{counter}") { |e|
|
47
|
+
value[:energy_generated] = (e.text.to_i * day_trend_multiplication).to_s
|
47
48
|
}
|
48
49
|
options[:"#{m}#{current_day.next!}"] = value
|
49
50
|
|
data/saj_collector.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johnny Willemsen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pvoutput
|