ekm-omnimeter 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 758e496aeac9d9f1cf799c3beaee919f2f322060
4
- data.tar.gz: f703b60257dd10c354d4777ce804908cca9ed7dc
3
+ metadata.gz: 956b201ecc8c116268db81bb760d33d6f8a1fc64
4
+ data.tar.gz: b7ad7042d5e54af49457484ac419a9036727136f
5
5
  SHA512:
6
- metadata.gz: cd0305137f9ec0e3f4bf6c2cb3da5286210ba4d267c93f89ca1a71500c952bf67c6821d6f40fd99bf33f576c50d99dffcbee2e7e2cd33bb23a520f38773fc59f
7
- data.tar.gz: 6edc0ed3de4baefb7e57d72083aff3ea3b92cc0954480d9b39c4ff99d6c2be28a504a797c58e19bfe025ac1e7fb47903f48860f2bca14508e94d8a8227011c27
6
+ metadata.gz: 9746afa0fcbad02f08d06f82c316ee90793396afe7c8a8088d6042ed33780711e1d31d6a6469bbb9ac1c53ff6178cefc4455bddd64dbf6358e1b0ec72e2e61fa
7
+ data.tar.gz: c5cbd6cbd05c2fe74caed67c2a64a2e69c4c098d5fa490d671821dca18db0a7623b1f76504b7d9566ab9a1e3d7a93ff207ebf36facf506594f77f15a887f65a7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ekm-omnimeter (0.1.0)
4
+ ekm-omnimeter (0.2.1)
5
5
  log4r (~> 1.1)
6
6
  xively-rb-connector (~> 0.1)
7
7
 
data/README.md CHANGED
@@ -49,44 +49,75 @@ m = EkmOmnimeter::Meter.new(
49
49
  :remote_address=>'192.168.1.125', # The IP address of your iSerial device
50
50
  :remote_port => 50000) # The port on which your iSerial device is listening
51
51
 
52
- # Read some values
52
+ # These values change based on the value of :power_configuration in the constructor
53
+ m.volts # 248.7
54
+ m.amps # 21.6
55
+ m.watts # 2664
56
+
57
+ # Warning: Dates seem off
58
+ # My computer clock said 2014-04-03 3:32PM when these outputs came out
59
+ m.meter_timestamp # 2014-04-03 05:15:32
60
+ m.computer_timestamp # Time.now() = 2014-04-03 15:32:10 -0400
61
+
62
+ # Read meter values
53
63
  m.remote_address # 192.168.1.125
54
64
  m.remote_port # 50000
55
65
  m.meter_number # 000300000001
56
- m.address # 000300000001
57
- m.measurement_timestamp # 2014-04-03 05:03:01
58
- m.total_active_kwh # 00450609
59
- m.total_kvarh # 00080417
60
- m.total_rev_kwh # 00007590
61
- m.three_phase_kwh # 002115660023898000000000
62
- m.three_phase_rev_kwh # 000000000000759000000000
63
- m.resettable_kwh # 00450609
64
- m.resettable_reverse_kwh # 00007590
65
- m.volts_l1 # 1245
66
- m.volts_l2 # 1254
67
- m.volts_l3 # 0000
68
- m.amps_l1 # 00200
69
- m.amps_l2 # 00056
70
- m.amps_l3 # 00000
71
- m.watts_l1 # 0002504
72
- m.watts_l2 # 0000664
73
- m.watts_l3 # 0000000
74
- m.watts_total # 0003172
75
- m.cosϴ_l1 # 100
76
- m.cosϴ_l2 # 100
77
- m.cosϴ_l3 # C000
78
- m.var_l1 # 0000052
79
- m.var_l2 # 0000000
80
- m.var_l3 # 0000000
81
- m.var_total # 0000052
82
- m.freq # 6006
83
- m.pulse_count_1 # 00000003
84
- m.pulse_count_2 # 00000006
85
- m.pulse_count_3 # 00000000
86
- m.pulse_input_hilo # 4
87
- m.direction_of_current # 1
88
- m.outputs_onoff # 1
89
- m.kwh_data_decimal_places # 2
66
+ m.address # 000300000001
67
+ m.total_kwh # 4583.51
68
+ m.total_forward_kwh # 4507.610000000001
69
+ m.total_reverse_kwh # 75.9
70
+ m.net_kwh # 4431.710000000001
71
+ m.total_kwh_t1 # 2826.64
72
+ m.total_kwh_t2 # 1756.87
73
+ m.total_kwh_t3 # 0.0
74
+ m.total_kwh_t4 # 0.0
75
+ m.reverse_kwh_t1 # 47.93
76
+ m.reverse_kwh_t2 # 27.97
77
+ m.reverse_kwh_t3 # 0.0
78
+ m.reverse_kwh_t4 # 0.0
79
+ m.volts_l1 # 123.9
80
+ m.volts_l2 # 124.8
81
+ m.volts_l3 # 0.0
82
+ m.amps_l1 # 18.4
83
+ m.amps_l2 # 3.2
84
+ m.amps_l3 # 0.0
85
+ m.watts_l1 # 2276
86
+ m.watts_l2 # 384
87
+ m.watts_l3 # 0
88
+ m.watts_total # 2664
89
+ m.power_factor_1 # 1.0
90
+ m.power_factor_2 # 0.0
91
+ m.power_factor_3 # 0.0
92
+ m.maximum_demand # 226400
93
+ m.maximum_demand_period # 1
94
+ m.ct_ratio # 400
95
+ m.pulse_1_count # 3
96
+ m.pulse_1_ratio # 1000
97
+ m.pulse_2_count # 6
98
+ m.pulse_2_ratio # 3
99
+ m.pulse_3_count # 0
100
+ m.pulse_3_ratio # 1000
101
+ m.reactive_kwh_kvarh # 812.63
102
+ m.total_kwh_l1 # 2165.46
103
+ m.total_kwh_l2 # 2417.42
104
+ m.total_kwh_l3 # 0.0
105
+ m.reverse_kwh_l1 # 0.0
106
+ m.reverse_kwh_l2 # 75.9
107
+ m.reverse_kwh_l3 # 0.0
108
+ m.resettable_total_kwh # 4583.51
109
+ m.resettable_reverse_kwh # 75.9
110
+ m.reactive_power_1 # 24
111
+ m.reactive_power_2 # 60
112
+ m.reactive_power_3 # 0
113
+ m.total_reactive_power # 84
114
+ m.frequency # 60.04
115
+ m.pulse_input_hilo # 0
116
+ m.direction_of_current # 1
117
+ m.outputs_onoff # 1
118
+ m.kwh_data_decimal_places # 2
119
+ m.auto_reset_max_demand # 0
120
+ m.settable_pulse_per_kwh_ratio # 800
90
121
 
91
122
 
92
123
  ```
@@ -41,7 +41,7 @@ module EkmOmnimeter
41
41
 
42
42
  # Collect the power configurations
43
43
  if VALID_POWER_CONFIGURATIONS.index(options[:power_configuration])
44
- power_configuration = options[:power_configuration]
44
+ @power_configuration = options[:power_configuration]
45
45
  else
46
46
  raise EkmOmnimeterError, "Invalid power configuration #{options[:power_configuration]}. Valid values are #{VALID_POWER_CONFIGURATIONS.join(', ')}"
47
47
  end
@@ -160,14 +160,15 @@ module EkmOmnimeter
160
160
 
161
161
  # Returns the correct measurement for voltage, current, and power based on the corresponding power_configuration
162
162
  def calculate_measurement(m1, m2, m3)
163
+ puts "****** #{power_configuration.inspect} #{m1}, #{m2}, #{m3}"
163
164
  if power_configuration == :single_phase_2wire
164
- volts_l1
165
+ m1
165
166
  elsif power_configuration == :single_phase_3wire
166
- (volts_l1 + volts_l2)
167
+ (m1 + m2)
167
168
  elsif power_configuration == :three_phase_3wire
168
- (volts_l1 + :volts_l3)
169
+ (m1 + m3)
169
170
  elsif power_configuration == :three_phase_4wire
170
- (volts_l1 + volts_l2 + volts_l3)
171
+ (m1 + m2 + m3)
171
172
  end
172
173
  end
173
174
 
@@ -346,9 +347,9 @@ module EkmOmnimeter
346
347
 
347
348
  # Calculate totals based on wiring configuration
348
349
  @values[:meter_timestamp] = meter_timestamp
349
- @values[:volts] = calculate_measurement(d[:volts_l1], d[:volts_l2], d[:volts_l3])
350
- @values[:amps] = calculate_measurement(d[:amps_l1], d[:amps_l2], d[:amps_l3])
351
- @values[:watts] = calculate_measurement(d[:watts_l1], d[:watts_l2], d[:watts_l3])
350
+ @values[:volts] = calculate_measurement(volts_l1, volts_l2, volts_l3)
351
+ @values[:amps] = calculate_measurement(amps_l1, amps_l2, amps_l3)
352
+ @values[:watts] = calculate_measurement(watts_l1, watts_l2, watts_l3)
352
353
  @values[:total_forward_kwh] = total_kwh - total_reverse_kwh
353
354
  @values[:net_kwh] = total_forward_kwh - total_reverse_kwh
354
355
 
@@ -437,9 +438,9 @@ module EkmOmnimeter
437
438
 
438
439
  # Calculate totals based on wiring configuration
439
440
  @values[:meter_timestamp] = meter_timestamp
440
- @values[:volts] = calculate_measurement(d[:volts_l1], d[:volts_l2], d[:volts_l3])
441
- @values[:amps] = calculate_measurement(d[:amps_l1], d[:amps_l2], d[:amps_l3])
442
- @values[:watts] = calculate_measurement(d[:watts_l1], d[:watts_l2], d[:watts_l3])
441
+ @values[:volts] = calculate_measurement(volts_l1, volts_l2, volts_l3)
442
+ @values[:amps] = calculate_measurement(amps_l1, amps_l2, amps_l3)
443
+ @values[:watts] = calculate_measurement(watts_l1, watts_l2, watts_l3)
443
444
 
444
445
  # Return the hash as an open struct
445
446
  return d
@@ -7,7 +7,7 @@ module EkmOmnimeter
7
7
  module VERSION #:nodoc:
8
8
  MAJOR = 0
9
9
  MINOR = 2
10
- PATCH = 0
10
+ PATCH = 1
11
11
 
12
12
  STRING = [MAJOR, MINOR, PATCH].join('.')
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ekm-omnimeter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Duggan