aemo 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98c8087e9430d757f5f0326a10ce9a6f9b2eb8fb6b413335499289a02e70022a
4
- data.tar.gz: 1a80168bf15d0046e74c055714a9b49d6b141ee24eeb35a7254d44ef5f6007ab
3
+ metadata.gz: af33790f5a576ac6da8a1f0cc9973ef110b27a18adc57284e6adbbeca3cfcd4d
4
+ data.tar.gz: 2fcb685afe9f2abc772e977aeb46092cefc0468559dc9174675fc4d626488219
5
5
  SHA512:
6
- metadata.gz: d5a42692ef180b3ae84da2cbc61e81d7c2b74b35bddeddf3d26491e8ea5158a352c02d7c74d1f5125c20cd4e1dd6a500e3c374d1407de4045f243d4775b34d96
7
- data.tar.gz: cbcce7c2aa879525fc862549316ecbcf1db04dbd61d21c73fe59a20dc9d1db666a29c23e7eeef9ef5b8521265adc5956a1c428009dc458f4489a3d7dc291e9ea
6
+ metadata.gz: e964f36accd95065c85e0c08f000fa19972236ccb12c8be8771f653ecaea9a25aea3055f5805dcf51cd62ea63f0b9d675eaad93c04f9b3c5e486d08a526ec5a8
7
+ data.tar.gz: 4143e9c15a816cb8725829910655aed83e59bd064f8addb0c8d419782df430933d65a77b314a36cb135aa5028d1030b3831f737084b672b1e56d24535ee62172
data/lib/aemo/msats.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'aemo'
4
3
  require 'digest/sha1'
5
4
  require 'httparty'
6
5
  require 'nokogiri'
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AEMO
4
+ # Namespace for classes and modules that handle AEMO Gem NEM12 interactions
5
+ # @since 0.1.4
6
+ class NEM12
7
+ DATA_STREAM_SUFFIX = {
8
+ # Averaged Data Streams
9
+ 'A' => { stream: 'Average', description: 'Import', units: 'kWh' },
10
+ 'D' => { stream: 'Average', description: 'Export', units: 'kWh' },
11
+ 'J' => { stream: 'Average', description: 'Import', units: 'kVArh' },
12
+ 'P' => { stream: 'Average', description: 'Export', units: 'kVArh' },
13
+ 'S' => { stream: 'Average', description: '', units: 'kVAh' },
14
+ # Master Data Streams
15
+ 'B' => { stream: 'Master', description: 'Import', units: 'kWh' },
16
+ 'E' => { stream: 'Master', description: 'Export', units: 'kWh' },
17
+ 'K' => { stream: 'Master', description: 'Import', units: 'kVArh' },
18
+ 'Q' => { stream: 'Master', description: 'Export', units: 'kVArh' },
19
+ 'T' => { stream: 'Master', description: '', units: 'kVAh' },
20
+ 'G' => { stream: 'Master', description: 'Power Factor', units: 'PF' },
21
+ 'H' => { stream: 'Master', description: 'Q Metering', units: 'Qh' },
22
+ 'M' => { stream: 'Master', description: 'Par Metering', units: 'parh' },
23
+ 'V' => { stream: 'Master', description: 'Volts or V2h or Amps or A2h', units: '' },
24
+ # Check Meter Streams
25
+ 'C' => { stream: 'Check', description: 'Import', units: 'kWh' },
26
+ 'F' => { stream: 'Check', description: 'Export', units: 'kWh' },
27
+ 'L' => { stream: 'Check', description: 'Import', units: 'kVArh' },
28
+ 'R' => { stream: 'Check', description: 'Export', units: 'kVArh' },
29
+ 'U' => { stream: 'Check', description: '', units: 'kVAh' },
30
+ 'Y' => { stream: 'Check', description: 'Q Metering', units: 'Qh' },
31
+ 'W' => { stream: 'Check', description: 'Par Metering Path', units: '' },
32
+ 'Z' => { stream: 'Check', description: 'Volts or V2h or Amps or A2h', units: '' },
33
+ # Net Meter Streams
34
+ # AEMO: NOTE THAT D AND J ARE PREVIOUSLY DEFINED
35
+ # 'D' => { stream: 'Net', description: 'Net', units: 'kWh' },
36
+ # 'J' => { stream: 'Net', description: 'Net', units: 'kVArh' }
37
+ }.freeze
38
+ end
39
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AEMO
4
+ # Namespace for classes and modules that handle AEMO Gem NEM12 interactions
5
+ # @since 0.1.4
6
+ class NEM12
7
+ QUALITY_FLAGS = {
8
+ 'A' => 'Actual Data',
9
+ 'E' => 'Forward Estimated Data',
10
+ 'F' => 'Final Substituted Data',
11
+ 'N' => 'Null Data',
12
+ 'S' => 'Substituted Data',
13
+ 'V' => 'Variable Data'
14
+ }.freeze
15
+
16
+ METHOD_FLAGS = {
17
+ 11 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Check', description: '' },
18
+ 12 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Calculated', description: '' },
19
+ 13 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'SCADA', description: '' },
20
+ 14 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Like Day', description: '' },
21
+ 15 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Average Like Day', description: '' },
22
+ 16 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Agreed', description: '' },
23
+ 17 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Linear', description: '' },
24
+ 18 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Alternate', description: '' },
25
+ 19 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Zero', description: '' },
26
+ 20 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Churn Correction (Like Day)', description: '' },
27
+ 21 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Five-minute No Historical Data', description: '' },
28
+ 51 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Previous Year', description: '' },
29
+ 52 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Previous Read', description: '' },
30
+ 53 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Revision', description: '' },
31
+ 54 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Linear', description: '' },
32
+ 55 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Agreed', description: '' },
33
+ 56 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Prior to First Read - Agreed', description: '' },
34
+ 57 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Customer Class', description: '' },
35
+ 58 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Zero', description: '' },
36
+ 59 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Five-minute No Historical Data', description: '' },
37
+ 61 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Previous Year', description: '' },
38
+ 62 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Previous Read', description: '' },
39
+ 63 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Customer Class', description: '' },
40
+ 64 => { type: %w[SUB], installation_type: 6, short_descriptor: 'Agreed', description: '' },
41
+ 65 => { type: %w[EST], installation_type: 6, short_descriptor: 'ADL', description: '' },
42
+ 66 => { type: %w[SUB], installation_type: 6, short_descriptor: 'Revision', description: '' },
43
+ 67 => { type: %w[SUB], installation_type: 6, short_descriptor: 'Customer Read', description: '' },
44
+ 68 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Zero', description: '' },
45
+ 69 => { type: %w[SUB], installation_type: 6, short_descriptor: 'Linear extrapolation', description: '' },
46
+ 71 => { type: %w[SUB], installation_type: 7, short_descriptor: 'Recalculation', description: '' },
47
+ 72 => { type: %w[SUB], installation_type: 7, short_descriptor: 'Revised Table', description: '' },
48
+ 73 => { type: %w[SUB], installation_type: 7, short_descriptor: 'Revised Algorithm', description: '' },
49
+ 74 => { type: %w[SUB], installation_type: 7, short_descriptor: 'Agreed', description: '' },
50
+ 75 => { type: %w[EST], installation_type: 7, short_descriptor: 'Existing Table', description: '' }
51
+ }.freeze
52
+ end
53
+ end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AEMO
4
+ # Namespace for classes and modules that handle AEMO Gem NEM12 interactions
5
+ # @since 0.1.4
6
+ class NEM12
7
+ REASON_CODES = {
8
+ 0 => 'Free Text Description',
9
+ 1 => 'Meter/Equipment Changed',
10
+ 2 => 'Extreme Weather/Wet',
11
+ 3 => 'Quarantine',
12
+ 4 => 'Savage Dog',
13
+ 5 => 'Meter/Equipment Changed',
14
+ 6 => 'Extreme Weather/Wet',
15
+ 7 => 'Unable To Locate Meter',
16
+ 8 => 'Vacant Premise',
17
+ 9 => 'Meter/Equipment Changed',
18
+ 10 => 'Lock Damaged/Seized',
19
+ 11 => 'In Wrong Walk',
20
+ 12 => 'Locked Premises',
21
+ 13 => 'Locked Gate',
22
+ 14 => 'Locked Meter Box',
23
+ 15 => 'Access - Overgrown',
24
+ 16 => 'Noxious Weeds',
25
+ 17 => 'Unsafe Equipment/Location',
26
+ 18 => 'Read Below Previous',
27
+ 19 => 'Consumer Wanted',
28
+ 20 => 'Damaged Equipment/Panel',
29
+ 21 => 'Switched Off',
30
+ 22 => 'Meter/Equipment Seals Missing',
31
+ 23 => 'Meter/Equipment Seals Missing',
32
+ 24 => 'Meter/Equipment Seals Missing',
33
+ 25 => 'Meter/Equipment Seals Missing',
34
+ 26 => 'Meter/Equipment Seals Missing',
35
+ 27 => 'Meter/Equipment Seals Missing',
36
+ 28 => 'Damaged Equipment/Panel',
37
+ 29 => 'Relay Faulty/Damaged',
38
+ 30 => 'Meter Stop Switch On',
39
+ 31 => 'Meter/Equipment Seals Missing',
40
+ 32 => 'Damaged Equipment/Panel',
41
+ 33 => 'Relay Faulty/Damaged',
42
+ 34 => 'Meter Not In Handheld',
43
+ 35 => 'Timeswitch Faulty/Reset Required',
44
+ 36 => 'Meter High/Ladder Required',
45
+ 37 => 'Meter High/Ladder Required',
46
+ 38 => 'Unsafe Equipment/Location',
47
+ 39 => 'Reverse Energy Observed',
48
+ 40 => 'Timeswitch Faulty/Reset Required',
49
+ 41 => 'Faulty Equipment Display/Dials',
50
+ 42 => 'Faulty Equipment Display/Dials',
51
+ 43 => 'Power Outage',
52
+ 44 => 'Unsafe Equipment/Location',
53
+ 45 => 'Readings Failed To Validate',
54
+ 46 => 'Extreme Weather/Hot',
55
+ 47 => 'Refused Access',
56
+ 48 => 'Timeswitch Faulty/Reset Required',
57
+ 49 => 'Wet Paint',
58
+ 50 => 'Wrong Tariff',
59
+ 51 => 'Installation Demolished',
60
+ 52 => 'Access - Blocked',
61
+ 53 => 'Bees/Wasp In Meter Box',
62
+ 54 => 'Meter Box Damaged/Faulty',
63
+ 55 => 'Faulty Equipment Display/Dials',
64
+ 56 => 'Meter Box Damaged/Faulty',
65
+ 57 => 'Timeswitch Faulty/Reset Required',
66
+ 58 => 'Meter Ok - Supply Failure',
67
+ 59 => 'Faulty Equipment Display/Dials',
68
+ 60 => 'Illegal Connection/Equipment Tampered',
69
+ 61 => 'Meter Box Damaged/Faulty',
70
+ 62 => 'Damaged Equipment/Panel',
71
+ 63 => 'Illegal Connection/Equipment Tampered',
72
+ 64 => 'Key Required',
73
+ 65 => 'Wrong Key Provided',
74
+ 66 => 'Lock Damaged/Seized',
75
+ 67 => 'Extreme Weather/Wet',
76
+ 68 => 'Zero Consumption',
77
+ 69 => 'Reading Exceeds Estimate',
78
+ 70 => 'Probe Reports Tampering',
79
+ 71 => 'Probe Read Error',
80
+ 72 => 'Meter/Equipment Changed',
81
+ 73 => 'Low Consumption',
82
+ 74 => 'High Consumption',
83
+ 75 => 'Customer Read',
84
+ 76 => 'Communications Fault',
85
+ 77 => 'Estimation Forecast',
86
+ 78 => 'Null Data',
87
+ 79 => 'Power Outage Alarm',
88
+ 80 => 'Short Interval Alarm',
89
+ 81 => 'Long Interval Alarm',
90
+ 82 => 'CRC Error',
91
+ 83 => 'RAM Checksum Error',
92
+ 84 => 'ROM Checksum Error',
93
+ 85 => 'Data Missing Alarm',
94
+ 86 => 'Clock Error Alarm',
95
+ 87 => 'Reset Occurred',
96
+ 88 => 'Watchdog Timeout Alarm',
97
+ 89 => 'Time Reset Occurred',
98
+ 90 => 'Test Mode',
99
+ 91 => 'Load Control',
100
+ 92 => 'Added Interval (Data Correction)',
101
+ 93 => 'Replaced Interval (Data Correction)',
102
+ 94 => 'Estimated Interval (Data Correction)',
103
+ 95 => 'Pulse Overflow Alarm',
104
+ 96 => 'Data Out Of Limits',
105
+ 97 => 'Excluded Data',
106
+ 98 => 'Parity Error',
107
+ 99 => 'Energy Type (Register Changed)'
108
+ }.freeze
109
+ end
110
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AEMO
4
+ # Namespace for classes and modules that handle AEMO Gem NEM12 interactions
5
+ # @since 0.1.4
6
+ class NEM12
7
+ # As per AEMO NEM12 Specification
8
+ # http://www.aemo.com.au/Consultations/National-Electricity-Market/Open/~/media/
9
+ # Files/Other/consultations/nem/Meter% 20Data% 20File% 20Format% 20Specification% 20
10
+ # NEM12_NEM13/MDFF_Specification_NEM12_NEM13_Final_v102_clean.ashx
11
+ RECORD_INDICATORS = {
12
+ 100 => 'Header',
13
+ 200 => 'NMI Data Details',
14
+ 300 => 'Interval Data',
15
+ 400 => 'Interval Event',
16
+ 500 => 'B2B Details',
17
+ 900 => 'End'
18
+ }.freeze
19
+ end
20
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AEMO
4
+ # Namespace for classes and modules that handle AEMO Gem NEM12 interactions
5
+ # @since 0.1.4
6
+ class NEM12
7
+ TRANSACTION_CODE_FLAGS = {
8
+ 'A' => 'Alteration',
9
+ 'C' => 'Meter Reconfiguration',
10
+ 'G' => 'Re-energisation',
11
+ 'D' => 'De-energisation',
12
+ 'E' => 'Forward Estimate',
13
+ 'N' => 'Normal Read',
14
+ 'O' => 'Other',
15
+ 'S' => 'Special Read',
16
+ 'R' => 'Removal of Meter'
17
+ }.freeze
18
+ end
19
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AEMO
4
+ # Namespace for classes and modules that handle AEMO Gem NEM12 interactions
5
+ # @since 0.1.4
6
+ class NEM12
7
+ UOM = {
8
+ 'MWh' => { name: 'Megawatt Hour', multiplier: 1e6 },
9
+ 'kWh' => { name: 'Kilowatt Hour', multiplier: 1e3 },
10
+ 'Wh' => { name: 'Watt Hour', multiplier: 1 },
11
+ 'MW' => { name: 'Megawatt', multiplier: 1e6 },
12
+ 'kW' => { name: 'Kilowatt', multiplier: 1e3 },
13
+ 'W' => { name: 'Watt', multiplier: 1 },
14
+ 'MVArh' => { name: 'Megavolt Ampere Reactive Hour', multiplier: 1e6 },
15
+ 'kVArh' => { name: 'Kilovolt Ampere Reactive Hour', multiplier: 1e3 },
16
+ 'VArh' => { name: 'Volt Ampere Reactive Hour', multiplier: 1 },
17
+ 'MVAr' => { name: 'Megavolt Ampere Reactive', multiplier: 1e6 },
18
+ 'kVAr' => { name: 'Kilovolt Ampere Reactive', multiplier: 1e3 },
19
+ 'VAr' => { name: 'Volt Ampere Reactive', multiplier: 1 },
20
+ 'MVAh' => { name: 'Megavolt Ampere Hour', multiplier: 1e6 },
21
+ 'kVAh' => { name: 'Kilovolt Ampere Hour', multiplier: 1e3 },
22
+ 'VAh' => { name: 'Volt Ampere Hour', multiplier: 1 },
23
+ 'MVA' => { name: 'Megavolt Ampere', multiplier: 1e6 },
24
+ 'kVA' => { name: 'Kilovolt Ampere', multiplier: 1e3 },
25
+ 'VA' => { name: 'Volt Ampere', multiplier: 1 },
26
+ 'kV' => { name: 'Kilovolt', multiplier: 1e3 },
27
+ 'V' => { name: 'Volt', multiplier: 1 },
28
+ 'kA' => { name: 'Kiloampere', multiplier: 1e3 },
29
+ 'A' => { name: 'Ampere', multiplier: 1 },
30
+ 'pf' => { name: 'Power Factor', multiplier: 1 }
31
+ }.freeze
32
+
33
+ UOM_NON_SPEC_MAPPING = {
34
+ 'MWH' => 'MWh',
35
+ 'KWH' => 'kWh',
36
+ 'WH' => 'Wh',
37
+ 'MW' => 'MW',
38
+ 'KW' => 'kW',
39
+ 'W' => 'W',
40
+ 'MVARH' => 'MVArh',
41
+ 'KVARH' => 'kVArh',
42
+ 'VARH' => 'VArh',
43
+ 'MVAR' => 'MVAr',
44
+ 'KVAR' => 'kVAr',
45
+ 'VAR' => 'VAr',
46
+ 'MVAH' => 'MVAh',
47
+ 'KVAH' => 'kVAh',
48
+ 'VAH' => 'VAh',
49
+ 'MVA' => 'MVA',
50
+ 'KVA' => 'kVA',
51
+ 'VA' => 'VA',
52
+ 'KV' => 'kV',
53
+ 'V' => 'V',
54
+ 'KA' => 'kA',
55
+ 'A' => 'A',
56
+ 'PF' => 'pf'
57
+ }.freeze
58
+ end
59
+ end
data/lib/aemo/nem12.rb CHANGED
@@ -3,264 +3,17 @@
3
3
  require 'csv'
4
4
  require 'time'
5
5
 
6
+ require 'aemo/nem12/data_stream_suffix'
7
+ require 'aemo/nem12/quality_method'
8
+ require 'aemo/nem12/reason_codes'
9
+ require 'aemo/nem12/record_indicators'
10
+ require 'aemo/nem12/transaction_code_flags'
11
+ require 'aemo/nem12/unit_of_measurement'
12
+
6
13
  module AEMO
7
14
  # Namespace for classes and modules that handle AEMO Gem NEM12 interactions
8
15
  # @since 0.1.4
9
16
  class NEM12
10
- # As per AEMO NEM12 Specification
11
- # http://www.aemo.com.au/Consultations/National-Electricity-Market/Open/~/media/
12
- # Files/Other/consultations/nem/Meter% 20Data% 20File% 20Format% 20Specification% 20
13
- # NEM12_NEM13/MDFF_Specification_NEM12_NEM13_Final_v102_clean.ashx
14
- RECORD_INDICATORS = {
15
- 100 => 'Header',
16
- 200 => 'NMI Data Details',
17
- 300 => 'Interval Data',
18
- 400 => 'Interval Event',
19
- 500 => 'B2B Details',
20
- 900 => 'End'
21
- }.freeze
22
-
23
- TRANSACTION_CODE_FLAGS = {
24
- 'A' => 'Alteration',
25
- 'C' => 'Meter Reconfiguration',
26
- 'G' => 'Re-energisation',
27
- 'D' => 'De-energisation',
28
- 'E' => 'Forward Estimate',
29
- 'N' => 'Normal Read',
30
- 'O' => 'Other',
31
- 'S' => 'Special Read',
32
- 'R' => 'Removal of Meter'
33
- }.freeze
34
-
35
- UOM = {
36
- 'MWh' => { name: 'Megawatt Hour', multiplier: 1e6 },
37
- 'kWh' => { name: 'Kilowatt Hour', multiplier: 1e3 },
38
- 'Wh' => { name: 'Watt Hour', multiplier: 1 },
39
- 'MW' => { name: 'Megawatt', multiplier: 1e6 },
40
- 'kW' => { name: 'Kilowatt', multiplier: 1e3 },
41
- 'W' => { name: 'Watt', multiplier: 1 },
42
- 'MVArh' => { name: 'Megavolt Ampere Reactive Hour', multiplier: 1e6 },
43
- 'kVArh' => { name: 'Kilovolt Ampere Reactive Hour', multiplier: 1e3 },
44
- 'VArh' => { name: 'Volt Ampere Reactive Hour', multiplier: 1 },
45
- 'MVAr' => { name: 'Megavolt Ampere Reactive', multiplier: 1e6 },
46
- 'kVAr' => { name: 'Kilovolt Ampere Reactive', multiplier: 1e3 },
47
- 'VAr' => { name: 'Volt Ampere Reactive', multiplier: 1 },
48
- 'MVAh' => { name: 'Megavolt Ampere Hour', multiplier: 1e6 },
49
- 'kVAh' => { name: 'Kilovolt Ampere Hour', multiplier: 1e3 },
50
- 'VAh' => { name: 'Volt Ampere Hour', multiplier: 1 },
51
- 'MVA' => { name: 'Megavolt Ampere', multiplier: 1e6 },
52
- 'kVA' => { name: 'Kilovolt Ampere', multiplier: 1e3 },
53
- 'VA' => { name: 'Volt Ampere', multiplier: 1 },
54
- 'kV' => { name: 'Kilovolt', multiplier: 1e3 },
55
- 'V' => { name: 'Volt', multiplier: 1 },
56
- 'kA' => { name: 'Kiloampere', multiplier: 1e3 },
57
- 'A' => { name: 'Ampere', multiplier: 1 },
58
- 'pf' => { name: 'Power Factor', multiplier: 1 }
59
- }.freeze
60
-
61
- UOM_NON_SPEC_MAPPING = {
62
- 'MWH' => 'MWh',
63
- 'KWH' => 'kWh',
64
- 'WH' => 'Wh',
65
- 'MW' => 'MW',
66
- 'KW' => 'kW',
67
- 'W' => 'W',
68
- 'MVARH' => 'MVArh',
69
- 'KVARH' => 'kVArh',
70
- 'VARH' => 'VArh',
71
- 'MVAR' => 'MVAr',
72
- 'KVAR' => 'kVAr',
73
- 'VAR' => 'VAr',
74
- 'MVAH' => 'MVAh',
75
- 'KVAH' => 'kVAh',
76
- 'VAH' => 'VAh',
77
- 'MVA' => 'MVA',
78
- 'KVA' => 'kVA',
79
- 'VA' => 'VA',
80
- 'KV' => 'kV',
81
- 'V' => 'V',
82
- 'KA' => 'kA',
83
- 'A' => 'A',
84
- 'PF' => 'pf'
85
- }.freeze
86
-
87
- QUALITY_FLAGS = {
88
- 'A' => 'Actual Data',
89
- 'E' => 'Forward Estimated Data',
90
- 'F' => 'Final Substituted Data',
91
- 'N' => 'Null Data',
92
- 'S' => 'Substituted Data',
93
- 'V' => 'Variable Data'
94
- }.freeze
95
-
96
- METHOD_FLAGS = {
97
- 11 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Check', description: '' },
98
- 12 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Calculated', description: '' },
99
- 13 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'SCADA', description: '' },
100
- 14 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Like Day', description: '' },
101
- 15 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Average Like Day', description: '' },
102
- 16 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Agreed', description: '' },
103
- 17 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Linear', description: '' },
104
- 18 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Alternate', description: '' },
105
- 19 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Zero', description: '' },
106
- 51 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Previous Year', description: '' },
107
- 52 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Previous Read', description: '' },
108
- 53 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Revision', description: '' },
109
- 54 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Linear', description: '' },
110
- 55 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Agreed', description: '' },
111
- 56 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Prior to First Read - Agreed', description: '' },
112
- 57 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Customer Class', description: '' },
113
- 58 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Zero', description: '' },
114
- 61 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Previous Year', description: '' },
115
- 62 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Previous Read', description: '' },
116
- 63 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Customer Class', description: '' },
117
- 64 => { type: %w[SUB], installation_type: 6, short_descriptor: 'Agreed', description: '' },
118
- 65 => { type: %w[EST], installation_type: 6, short_descriptor: 'ADL', description: '' },
119
- 66 => { type: %w[SUB], installation_type: 6, short_descriptor: 'Revision', description: '' },
120
- 67 => { type: %w[SUB], installation_type: 6, short_descriptor: 'Customer Read', description: '' },
121
- 68 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Zero', description: '' },
122
- 71 => { type: %w[SUB], installation_type: 7, short_descriptor: 'Recalculation', description: '' },
123
- 72 => { type: %w[SUB], installation_type: 7, short_descriptor: 'Revised Table', description: '' },
124
- 73 => { type: %w[SUB], installation_type: 7, short_descriptor: 'Revised Algorithm', description: '' },
125
- 74 => { type: %w[SUB], installation_type: 7, short_descriptor: 'Agreed', description: '' },
126
- 75 => { type: %w[EST], installation_type: 7, short_descriptor: 'Existing Table', description: '' }
127
- }.freeze
128
-
129
- REASON_CODES = {
130
- 0 => 'Free Text Description',
131
- 1 => 'Meter/Equipment Changed',
132
- 2 => 'Extreme Weather/Wet',
133
- 3 => 'Quarantine',
134
- 4 => 'Savage Dog',
135
- 5 => 'Meter/Equipment Changed',
136
- 6 => 'Extreme Weather/Wet',
137
- 7 => 'Unable To Locate Meter',
138
- 8 => 'Vacant Premise',
139
- 9 => 'Meter/Equipment Changed',
140
- 10 => 'Lock Damaged/Seized',
141
- 11 => 'In Wrong Walk',
142
- 12 => 'Locked Premises',
143
- 13 => 'Locked Gate',
144
- 14 => 'Locked Meter Box',
145
- 15 => 'Access - Overgrown',
146
- 16 => 'Noxious Weeds',
147
- 17 => 'Unsafe Equipment/Location',
148
- 18 => 'Read Below Previous',
149
- 19 => 'Consumer Wanted',
150
- 20 => 'Damaged Equipment/Panel',
151
- 21 => 'Switched Off',
152
- 22 => 'Meter/Equipment Seals Missing',
153
- 23 => 'Meter/Equipment Seals Missing',
154
- 24 => 'Meter/Equipment Seals Missing',
155
- 25 => 'Meter/Equipment Seals Missing',
156
- 26 => 'Meter/Equipment Seals Missing',
157
- 27 => 'Meter/Equipment Seals Missing',
158
- 28 => 'Damaged Equipment/Panel',
159
- 29 => 'Relay Faulty/Damaged',
160
- 30 => 'Meter Stop Switch On',
161
- 31 => 'Meter/Equipment Seals Missing',
162
- 32 => 'Damaged Equipment/Panel',
163
- 33 => 'Relay Faulty/Damaged',
164
- 34 => 'Meter Not In Handheld',
165
- 35 => 'Timeswitch Faulty/Reset Required',
166
- 36 => 'Meter High/Ladder Required',
167
- 37 => 'Meter High/Ladder Required',
168
- 38 => 'Unsafe Equipment/Location',
169
- 39 => 'Reverse Energy Observed',
170
- 40 => 'Timeswitch Faulty/Reset Required',
171
- 41 => 'Faulty Equipment Display/Dials',
172
- 42 => 'Faulty Equipment Display/Dials',
173
- 43 => 'Power Outage',
174
- 44 => 'Unsafe Equipment/Location',
175
- 45 => 'Readings Failed To Validate',
176
- 46 => 'Extreme Weather/Hot',
177
- 47 => 'Refused Access',
178
- 48 => 'Timeswitch Faulty/Reset Required',
179
- 49 => 'Wet Paint',
180
- 50 => 'Wrong Tariff',
181
- 51 => 'Installation Demolished',
182
- 52 => 'Access - Blocked',
183
- 53 => 'Bees/Wasp In Meter Box',
184
- 54 => 'Meter Box Damaged/Faulty',
185
- 55 => 'Faulty Equipment Display/Dials',
186
- 56 => 'Meter Box Damaged/Faulty',
187
- 57 => 'Timeswitch Faulty/Reset Required',
188
- 58 => 'Meter Ok - Supply Failure',
189
- 59 => 'Faulty Equipment Display/Dials',
190
- 60 => 'Illegal Connection/Equipment Tampered',
191
- 61 => 'Meter Box Damaged/Faulty',
192
- 62 => 'Damaged Equipment/Panel',
193
- 63 => 'Illegal Connection/Equipment Tampered',
194
- 64 => 'Key Required',
195
- 65 => 'Wrong Key Provided',
196
- 66 => 'Lock Damaged/Seized',
197
- 67 => 'Extreme Weather/Wet',
198
- 68 => 'Zero Consumption',
199
- 69 => 'Reading Exceeds Estimate',
200
- 70 => 'Probe Reports Tampering',
201
- 71 => 'Probe Read Error',
202
- 72 => 'Meter/Equipment Changed',
203
- 73 => 'Low Consumption',
204
- 74 => 'High Consumption',
205
- 75 => 'Customer Read',
206
- 76 => 'Communications Fault',
207
- 77 => 'Estimation Forecast',
208
- 78 => 'Null Data',
209
- 79 => 'Power Outage Alarm',
210
- 80 => 'Short Interval Alarm',
211
- 81 => 'Long Interval Alarm',
212
- 82 => 'CRC Error',
213
- 83 => 'RAM Checksum Error',
214
- 84 => 'ROM Checksum Error',
215
- 85 => 'Data Missing Alarm',
216
- 86 => 'Clock Error Alarm',
217
- 87 => 'Reset Occurred',
218
- 88 => 'Watchdog Timeout Alarm',
219
- 89 => 'Time Reset Occurred',
220
- 90 => 'Test Mode',
221
- 91 => 'Load Control',
222
- 92 => 'Added Interval (Data Correction)',
223
- 93 => 'Replaced Interval (Data Correction)',
224
- 94 => 'Estimated Interval (Data Correction)',
225
- 95 => 'Pulse Overflow Alarm',
226
- 96 => 'Data Out Of Limits',
227
- 97 => 'Excluded Data',
228
- 98 => 'Parity Error',
229
- 99 => 'Energy Type (Register Changed)'
230
- }.freeze
231
-
232
- DATA_STREAM_SUFFIX = {
233
- # Averaged Data Streams
234
- 'A' => { stream: 'Average', description: 'Import', units: 'kWh' },
235
- 'D' => { stream: 'Average', description: 'Export', units: 'kWh' },
236
- 'J' => { stream: 'Average', description: 'Import', units: 'kVArh' },
237
- 'P' => { stream: 'Average', description: 'Export', units: 'kVArh' },
238
- 'S' => { stream: 'Average', description: '', units: 'kVAh' },
239
- # Master Data Streams
240
- 'B' => { stream: 'Master', description: 'Import', units: 'kWh' },
241
- 'E' => { stream: 'Master', description: 'Export', units: 'kWh' },
242
- 'K' => { stream: 'Master', description: 'Import', units: 'kVArh' },
243
- 'Q' => { stream: 'Master', description: 'Export', units: 'kVArh' },
244
- 'T' => { stream: 'Master', description: '', units: 'kVAh' },
245
- 'G' => { stream: 'Master', description: 'Power Factor', units: 'PF' },
246
- 'H' => { stream: 'Master', description: 'Q Metering', units: 'Qh' },
247
- 'M' => { stream: 'Master', description: 'Par Metering', units: 'parh' },
248
- 'V' => { stream: 'Master', description: 'Volts or V2h or Amps or A2h', units: '' },
249
- # Check Meter Streams
250
- 'C' => { stream: 'Check', description: 'Import', units: 'kWh' },
251
- 'F' => { stream: 'Check', description: 'Export', units: 'kWh' },
252
- 'L' => { stream: 'Check', description: 'Import', units: 'kVArh' },
253
- 'R' => { stream: 'Check', description: 'Export', units: 'kVArh' },
254
- 'U' => { stream: 'Check', description: '', units: 'kVAh' },
255
- 'Y' => { stream: 'Check', description: 'Q Metering', units: 'Qh' },
256
- 'W' => { stream: 'Check', description: 'Par Metering Path', units: '' },
257
- 'Z' => { stream: 'Check', description: 'Volts or V2h or Amps or A2h', units: '' },
258
- # Net Meter Streams
259
- # AEMO: NOTE THAT D AND J ARE PREVIOUSLY DEFINED
260
- # 'D' => { stream: 'Net', description: 'Net', units: 'kWh' },
261
- # 'J' => { stream: 'Net', description: 'Net', units: 'kVArh' }
262
- }.freeze
263
-
264
17
  @file_contents = nil
265
18
  @header = nil
266
19
  @nmi_data_details = []
data/lib/aemo/nmi.rb CHANGED
@@ -5,6 +5,8 @@ require 'json'
5
5
  require 'time'
6
6
  require 'ostruct'
7
7
 
8
+ require 'aemo/nmi/allocation.rb'
9
+
8
10
  module AEMO
9
11
  # [AEMO::NMI]
10
12
  #
data/lib/aemo/version.rb CHANGED
@@ -24,7 +24,7 @@
24
24
  # @author Joel Courtney <euphemize@gmail.com>
25
25
  module AEMO
26
26
  # aemo version
27
- VERSION = '0.4.1'
27
+ VERSION = '0.5.0'
28
28
 
29
29
  # aemo version split amongst different revisions
30
30
  MAJOR_VERSION, MINOR_VERSION, REVISION = VERSION.split('.').map(&:to_i)
data/lib/aemo.rb CHANGED
@@ -11,7 +11,6 @@ require 'aemo/market/node.rb'
11
11
  require 'aemo/meter.rb'
12
12
  require 'aemo/nem12.rb'
13
13
  require 'aemo/nmi.rb'
14
- require 'aemo/nmi/allocation.rb'
15
14
  require 'aemo/msats.rb'
16
15
  require 'aemo/register.rb'
17
16
  require 'aemo/version.rb'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aemo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Courtney
@@ -447,6 +447,12 @@ files:
447
447
  - lib/aemo/meter.rb
448
448
  - lib/aemo/msats.rb
449
449
  - lib/aemo/nem12.rb
450
+ - lib/aemo/nem12/data_stream_suffix.rb
451
+ - lib/aemo/nem12/quality_method.rb
452
+ - lib/aemo/nem12/reason_codes.rb
453
+ - lib/aemo/nem12/record_indicators.rb
454
+ - lib/aemo/nem12/transaction_code_flags.rb
455
+ - lib/aemo/nem12/unit_of_measurement.rb
450
456
  - lib/aemo/nem13.rb
451
457
  - lib/aemo/nmi.rb
452
458
  - lib/aemo/nmi/allocation.rb