aemo 0.5.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aemo/dispatchable.rb +2 -2
- data/lib/aemo/exceptions/invalid_nmi_allocation_type.rb +1 -1
- data/lib/aemo/exceptions/time_error.rb +20 -0
- data/lib/aemo/market/interval.rb +4 -4
- data/lib/aemo/market/node.rb +9 -3
- data/lib/aemo/market.rb +2 -4
- data/lib/aemo/msats.rb +70 -54
- data/lib/aemo/nem12/data_stream_suffix.rb +1 -1
- data/lib/aemo/nem12/quality_method.rb +25 -13
- data/lib/aemo/nem12/unit_of_measurement.rb +42 -42
- data/lib/aemo/nem12.rb +300 -94
- data/lib/aemo/nem13.rb +1 -2
- data/lib/aemo/nmi/allocation.rb +6 -7
- data/lib/aemo/nmi.rb +48 -38
- data/lib/aemo/region.rb +4 -3
- data/lib/aemo/register.rb +7 -7
- data/lib/aemo/struct.rb +3 -0
- data/lib/aemo/time.rb +112 -0
- data/lib/aemo/version.rb +1 -2
- data/lib/aemo.rb +13 -11
- data/lib/data/xml_to_json.rb +2 -4
- data/spec/aemo_spec.rb +0 -7
- data/spec/lib/aemo/market/interval_spec.rb +30 -12
- data/spec/lib/aemo/market/node_spec.rb +11 -9
- data/spec/lib/aemo/market_spec.rb +5 -4
- data/spec/lib/aemo/meter_spec.rb +2 -2
- data/spec/lib/aemo/msats_spec.rb +68 -56
- data/spec/lib/aemo/nem12_spec.rb +154 -43
- data/spec/lib/aemo/nmi/allocation_spec.rb +23 -18
- data/spec/lib/aemo/nmi_spec.rb +98 -72
- data/spec/lib/aemo/region_spec.rb +23 -18
- data/spec/spec_helper.rb +13 -13
- metadata +13 -435
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c98c66a9a65db23ec5047fa00dac677f2be0b8cbf2e27c5083ba634e8170679
|
4
|
+
data.tar.gz: 1154e5b6130877c86f435de41697df4fb218347f4f4a9465c1cbafc01d842f9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fed9e8f1b86d40b062c06a128b5963162113ca7bd007a4419518c17958500e1931e8ec32ff6062b4199ebc636b2ba852d1a552a42d8c262070ee96813cc94ae
|
7
|
+
data.tar.gz: 167bd4c19f55a87b84661e54702bd2c0fd6b37c0c485bf9dee84bc8726a88194dd0da1e3c36d1b828e4b33d3b6199f0ac0c4cb2c2f944e2f0931716fc1b29f29
|
data/lib/aemo/dispatchable.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module AEMO
|
4
4
|
class Region
|
5
5
|
DISPATCH_TYPE = ['Generator', 'Load Norm Off', 'Network Service Provider'].freeze
|
6
|
-
CATEGORY = [
|
7
|
-
CLASSIFICATION = [
|
6
|
+
CATEGORY = %w[Market Non-Market].freeze
|
7
|
+
CLASSIFICATION = %w[Scheduled Semi-Scheduled Non-Scheduled].freeze
|
8
8
|
end
|
9
9
|
end
|
@@ -8,7 +8,7 @@ module AEMO
|
|
8
8
|
# @since 0.3.0
|
9
9
|
class InvalidNMIAllocationType < ArgumentError
|
10
10
|
DEFAULT_MESSAGE = 'Not a valid allocation type, try one of ' \
|
11
|
-
"#{AEMO::NMI::Allocation::SUPPORTED_TYPES.join(' |')}"
|
11
|
+
"#{AEMO::NMI::Allocation::SUPPORTED_TYPES.join(' |')}".freeze
|
12
12
|
|
13
13
|
# Initialize an InvalidNMIAllocationType
|
14
14
|
#
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AEMO
|
4
|
+
# AEMO::TimeError
|
5
|
+
#
|
6
|
+
# @author Joel Courtney
|
7
|
+
# @abstract An exception for time errors.
|
8
|
+
# @since 0.6.0
|
9
|
+
class TimeError < ArgumentError
|
10
|
+
DEFAULT_MESSAGE = 'Not a valid time'
|
11
|
+
|
12
|
+
# Initialize an TimeError
|
13
|
+
#
|
14
|
+
# @param [String] msg the error message
|
15
|
+
# @return [AEMO::TimeError]
|
16
|
+
def initialize(msg: DEFAULT_MESSAGE)
|
17
|
+
super
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/aemo/market/interval.rb
CHANGED
@@ -22,7 +22,7 @@ module AEMO
|
|
22
22
|
# @param [Hash] options Hash of optional data values
|
23
23
|
# @return [AEMO::Market::Interval]
|
24
24
|
def initialize(datetime, options = {})
|
25
|
-
@datetime = Time.parse("#{datetime} +1000")
|
25
|
+
@datetime = ::Time.parse("#{datetime} +1000")
|
26
26
|
@region = options['REGION']
|
27
27
|
@total_demand = options['TOTALDEMAND']
|
28
28
|
@rrp = options['RRP']
|
@@ -35,7 +35,7 @@ module AEMO
|
|
35
35
|
# All AEMO Data aggregates to the trailing edge of the period (this makes it difficult to do daily aggregations :( )
|
36
36
|
# @param [Boolean] trailing_edge selection of either the trailing edge of the period or the rising edge of the period for the date time
|
37
37
|
# @return [Time] a time object of the trailing edge of the interval
|
38
|
-
def datetime(trailing_edge
|
38
|
+
def datetime(trailing_edge: true)
|
39
39
|
t = @datetime
|
40
40
|
# If the datetime requested is the trailing edge, offset as per interval requirement
|
41
41
|
unless trailing_edge
|
@@ -51,7 +51,7 @@ module AEMO
|
|
51
51
|
|
52
52
|
# @return [Time] the time of the
|
53
53
|
def interval_length
|
54
|
-
Time.at(300)
|
54
|
+
::Time.at(300)
|
55
55
|
end
|
56
56
|
|
57
57
|
# @return [Symbol] :dispatch or :trading
|
@@ -72,7 +72,7 @@ module AEMO
|
|
72
72
|
# @return [Float] the value of the interval in Australian Dollars
|
73
73
|
def value
|
74
74
|
@value ||= Float::NAN
|
75
|
-
@value = (@total_demand * @rrp).round(2) if @total_demand.
|
75
|
+
@value = (@total_demand * @rrp).round(2) if @total_demand.instance_of?(Float) && @rrp.instance_of?(Float)
|
76
76
|
@value
|
77
77
|
end
|
78
78
|
end
|
data/lib/aemo/market/node.rb
CHANGED
@@ -13,7 +13,11 @@ module AEMO
|
|
13
13
|
attr_accessor :identifier
|
14
14
|
|
15
15
|
def initialize(identifier)
|
16
|
-
|
16
|
+
unless IDENTIFIERS.include?(identifier.upcase)
|
17
|
+
raise ArgumentError,
|
18
|
+
"Node Identifier '#{identifier}' is not valid."
|
19
|
+
end
|
20
|
+
|
17
21
|
@identifier = identifier
|
18
22
|
@current_trading = []
|
19
23
|
@current_dispatch = []
|
@@ -23,7 +27,7 @@ module AEMO
|
|
23
27
|
#
|
24
28
|
# @return [Array<AEMO::Market::Interval>]
|
25
29
|
def current_dispatch
|
26
|
-
@current_dispatch = AEMO::Market.current_dispatch(@identifier) if @current_dispatch.empty? || @current_dispatch.last.datetime != (Time.now - Time.now.to_i % 300)
|
30
|
+
@current_dispatch = AEMO::Market.current_dispatch(@identifier) if @current_dispatch.empty? || @current_dispatch.last.datetime != (::Time.now - (::Time.now.to_i % 300))
|
27
31
|
@current_dispatch
|
28
32
|
end
|
29
33
|
|
@@ -31,7 +35,9 @@ module AEMO
|
|
31
35
|
#
|
32
36
|
# @return [Array<AEMO::Market::Interval>]
|
33
37
|
def current_trading
|
34
|
-
if @current_trading.empty? || @current_trading.select
|
38
|
+
if @current_trading.empty? || @current_trading.select do |i|
|
39
|
+
i.period_type == 'TRADE'
|
40
|
+
end.last.datetime != (::Time.now - (::Time.now.to_i % 300))
|
35
41
|
@current_trading = AEMO::Market.current_trading(@identifier)
|
36
42
|
end
|
37
43
|
@current_trading
|
data/lib/aemo/market.rb
CHANGED
@@ -20,8 +20,7 @@ module AEMO
|
|
20
20
|
region = AEMO::Region.new(region) if region.is_a?(String)
|
21
21
|
|
22
22
|
response = get "/mms.GRAPHS/GRAPHS/GRAPH_5#{region}1.csv"
|
23
|
-
|
24
|
-
values
|
23
|
+
parse_response(response)
|
25
24
|
end
|
26
25
|
|
27
26
|
# Description of method
|
@@ -32,8 +31,7 @@ module AEMO
|
|
32
31
|
region = AEMO::Region.new(region) if region.is_a?(String)
|
33
32
|
|
34
33
|
response = get "/mms.GRAPHS/GRAPHS/GRAPH_30#{region}1.csv"
|
35
|
-
|
36
|
-
values
|
34
|
+
parse_response(response)
|
37
35
|
end
|
38
36
|
|
39
37
|
# Return an array of historic trading values based on a start and finish
|
data/lib/aemo/msats.rb
CHANGED
@@ -13,9 +13,9 @@ module AEMO
|
|
13
13
|
class MSATS
|
14
14
|
# Globally set request headers
|
15
15
|
HEADERS = {
|
16
|
-
'User-Agent'
|
17
|
-
'Accept'
|
18
|
-
'Content-Type'
|
16
|
+
'User-Agent' => 'Ruby.AEMO.MSATS.Api',
|
17
|
+
'Accept' => 'text/xml',
|
18
|
+
'Content-Type' => 'text/xml'
|
19
19
|
}.freeze
|
20
20
|
|
21
21
|
# We like to party
|
@@ -31,8 +31,7 @@ module AEMO
|
|
31
31
|
|
32
32
|
# Class Methods
|
33
33
|
class << self
|
34
|
-
attr_accessor :auth
|
35
|
-
attr_accessor :participant_id
|
34
|
+
attr_accessor :auth, :participant_id
|
36
35
|
|
37
36
|
# Single NMI Master (C4) Report
|
38
37
|
# /C4/PARTICIPANT_IDENTIFIER?transactionId=XXX&nmi=XXX&checksum=X&type=XXX&reason=XXX
|
@@ -52,22 +51,23 @@ module AEMO
|
|
52
51
|
options[:inittransId] ||= nil
|
53
52
|
|
54
53
|
query = {
|
55
|
-
transactionId:
|
56
|
-
#
|
57
|
-
NMI:
|
58
|
-
fromDate:
|
59
|
-
toDate:
|
60
|
-
asatDate:
|
61
|
-
participantId:
|
62
|
-
roleId:
|
63
|
-
inittransId:
|
54
|
+
transactionId: transaction_id,
|
55
|
+
# NOTE: AEMO has case sensitivity but no consistency across requests.
|
56
|
+
NMI: nmi.nmi,
|
57
|
+
fromDate: from_date,
|
58
|
+
toDate: to_date,
|
59
|
+
asatDate: as_at_date,
|
60
|
+
participantId: @participant_id,
|
61
|
+
roleId: options[:role_id],
|
62
|
+
inittransId: options[:init_trans_id]
|
64
63
|
}
|
65
64
|
|
66
|
-
response = get("/C4/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query
|
67
|
-
|
68
|
-
|
69
|
-
else
|
65
|
+
response = get("/C4/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
|
66
|
+
verify: (options[:verify_ssl] != false))
|
67
|
+
if response.response.code == '200'
|
70
68
|
response.parsed_response['aseXML']['Transactions']['Transaction']['ReportResponse']['ReportResults']
|
69
|
+
else
|
70
|
+
response
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -77,13 +77,14 @@ module AEMO
|
|
77
77
|
# @return [Hash] The report results from the MSATS Limits web service query
|
78
78
|
def msats_limits(options = {})
|
79
79
|
query = {
|
80
|
-
transactionId:
|
80
|
+
transactionId: transaction_id
|
81
81
|
}
|
82
|
-
response = get("/MSATSLimits/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query
|
83
|
-
|
84
|
-
|
85
|
-
else
|
82
|
+
response = get("/MSATSLimits/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
|
83
|
+
verify: (options[:verify_ssl] != false))
|
84
|
+
if response.response.code == '200'
|
86
85
|
response.parsed_response['aseXML']['Transactions']['Transaction']['ReportResponse']['ReportResults']
|
86
|
+
else
|
87
|
+
response
|
87
88
|
end
|
88
89
|
end
|
89
90
|
|
@@ -93,21 +94,30 @@ module AEMO
|
|
93
94
|
# @param [Integer] delivery_point_identifier Delivery Point Identifier
|
94
95
|
# @return [Hash] The response
|
95
96
|
def nmi_discovery_by_delivery_point_identifier(jurisdiction_code, delivery_point_identifier, options = {})
|
96
|
-
raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC
|
97
|
-
|
98
|
-
|
97
|
+
raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC
|
98
|
+
TAS].include?(jurisdiction_code)
|
99
|
+
|
100
|
+
unless delivery_point_identifier.respond_to?('to_i')
|
101
|
+
raise ArgumentError,
|
102
|
+
'delivery_point_identifier is not valid'
|
103
|
+
end
|
104
|
+
if delivery_point_identifier.to_i < 10_000_000 || delivery_point_identifier.to_i > 99_999_999
|
105
|
+
raise ArgumentError,
|
106
|
+
'delivery_point_identifier is not valid'
|
107
|
+
end
|
99
108
|
|
100
109
|
query = {
|
101
|
-
transactionId:
|
110
|
+
transactionId: transaction_id,
|
102
111
|
jurisdictionCode: jurisdiction_code,
|
103
112
|
deliveryPointIdentifier: delivery_point_identifier.to_i
|
104
113
|
}
|
105
114
|
|
106
|
-
response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query
|
107
|
-
|
108
|
-
|
109
|
-
else
|
115
|
+
response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
|
116
|
+
verify: (options[:verify_ssl] != false))
|
117
|
+
if response.response.code == '200'
|
110
118
|
response.parsed_response['aseXML']['Transactions']['Transaction']['NMIDiscoveryResponse']['NMIStandingData']
|
119
|
+
else
|
120
|
+
response
|
111
121
|
end
|
112
122
|
end
|
113
123
|
|
@@ -117,19 +127,21 @@ module AEMO
|
|
117
127
|
# @param [Integer] meter_serial_number The meter's serial number
|
118
128
|
# @return [Hash] The response
|
119
129
|
def nmi_discovery_by_meter_serial_number(jurisdiction_code, meter_serial_number, options = {})
|
120
|
-
raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC
|
130
|
+
raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC
|
131
|
+
TAS].include?(jurisdiction_code)
|
121
132
|
|
122
133
|
query = {
|
123
|
-
transactionId:
|
134
|
+
transactionId: transaction_id,
|
124
135
|
jurisdictionCode: jurisdiction_code,
|
125
136
|
meterSerialNumber: meter_serial_number.to_i
|
126
137
|
}
|
127
138
|
|
128
|
-
response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query
|
129
|
-
|
130
|
-
|
131
|
-
else
|
139
|
+
response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
|
140
|
+
verify: (options[:verify_ssl] != false))
|
141
|
+
if response.response.code == '200'
|
132
142
|
response.parsed_response['aseXML']['Transactions']['Transaction']['NMIDiscoveryResponse']['NMIStandingData']
|
143
|
+
else
|
144
|
+
response
|
133
145
|
end
|
134
146
|
end
|
135
147
|
|
@@ -139,7 +151,8 @@ module AEMO
|
|
139
151
|
# @param [Integer] meter_serial_number The meter's serial number
|
140
152
|
# @return [Hash] The response
|
141
153
|
def nmi_discovery_by_address(jurisdiction_code, options = {})
|
142
|
-
raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC
|
154
|
+
raise ArgumentError, 'jurisdiction_code is not valid' unless %w[ACT NEM NSW QLD SA VIC
|
155
|
+
TAS].include?(jurisdiction_code)
|
143
156
|
|
144
157
|
options[:building_or_property_name] ||= nil
|
145
158
|
options[:location_descriptor] ||= nil
|
@@ -158,7 +171,7 @@ module AEMO
|
|
158
171
|
options[:state_or_territory] ||= jurisdiction_code
|
159
172
|
|
160
173
|
query = {
|
161
|
-
transactionId:
|
174
|
+
transactionId: transaction_id,
|
162
175
|
jurisdictionCode: jurisdiction_code,
|
163
176
|
buildingOrPropertyName: options[:building_or_property_name],
|
164
177
|
locationDescriptor: options[:location_descriptor],
|
@@ -177,12 +190,13 @@ module AEMO
|
|
177
190
|
stateOrTerritory: options[:state_or_territory]
|
178
191
|
}
|
179
192
|
|
180
|
-
response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query
|
181
|
-
|
182
|
-
|
183
|
-
else
|
193
|
+
response = get("/NMIDiscovery/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
|
194
|
+
verify: (options[:verify_ssl] != false))
|
195
|
+
if response.response.code == '200'
|
184
196
|
myresponse = response.parsed_response['aseXML']['Transactions']['Transaction']['NMIDiscoveryResponse']['NMIStandingData']
|
185
197
|
myresponse.is_a?(Hash) ? [myresponse] : myresponse
|
198
|
+
else
|
199
|
+
response
|
186
200
|
end
|
187
201
|
end
|
188
202
|
|
@@ -204,11 +218,12 @@ module AEMO
|
|
204
218
|
reason: options[:reason]
|
205
219
|
}
|
206
220
|
|
207
|
-
response = get("/NMIDetail/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query
|
208
|
-
|
209
|
-
|
210
|
-
else
|
221
|
+
response = get("/NMIDetail/#{@participant_id}", basic_auth: @auth, headers: HEADERS, query:,
|
222
|
+
verify: (options[:verify_ssl] != false))
|
223
|
+
if response.response.code == '200'
|
211
224
|
response.parsed_response['aseXML']['Transactions']['Transaction']['NMIStandingDataResponse']['NMIStandingData']
|
225
|
+
else
|
226
|
+
response
|
212
227
|
end
|
213
228
|
end
|
214
229
|
|
@@ -218,13 +233,14 @@ module AEMO
|
|
218
233
|
# @return [Hash] The report results from the Participant System Status web service query
|
219
234
|
def system_status(options = {})
|
220
235
|
query = {
|
221
|
-
transactionId:
|
236
|
+
transactionId: transaction_id
|
222
237
|
}
|
223
|
-
response = get("/ParticipantSystemStatus/#{@participant_id}", basic_auth: @auth, headers: HEADERS,
|
224
|
-
|
225
|
-
|
226
|
-
else
|
238
|
+
response = get("/ParticipantSystemStatus/#{@participant_id}", basic_auth: @auth, headers: HEADERS,
|
239
|
+
query:, verify: (options[:verify_ssl] != false))
|
240
|
+
if response.response.code == '200'
|
227
241
|
response.parsed_response['aseXML']['Transactions']['Transaction']['ReportResponse']['ReportResults']
|
242
|
+
else
|
243
|
+
response
|
228
244
|
end
|
229
245
|
end
|
230
246
|
|
@@ -235,7 +251,7 @@ module AEMO
|
|
235
251
|
# @return [Hash] authentication credentials
|
236
252
|
def authorize(participant_id, username, password)
|
237
253
|
@participant_id = participant_id
|
238
|
-
@auth = { username
|
254
|
+
@auth = { username:, password: }
|
239
255
|
end
|
240
256
|
|
241
257
|
# Check if credentials are available to use
|
@@ -249,7 +265,7 @@ module AEMO
|
|
249
265
|
#
|
250
266
|
# @return [String] the transaction id
|
251
267
|
def transaction_id
|
252
|
-
Digest::SHA1.hexdigest(Time.now.to_s)[0..35]
|
268
|
+
Digest::SHA1.hexdigest(::Time.now.to_s)[0..35]
|
253
269
|
end
|
254
270
|
end
|
255
271
|
|
@@ -29,7 +29,7 @@ module AEMO
|
|
29
29
|
'U' => { stream: 'Check', description: '', units: 'kVAh' },
|
30
30
|
'Y' => { stream: 'Check', description: 'Q Metering', units: 'Qh' },
|
31
31
|
'W' => { stream: 'Check', description: 'Par Metering Path', units: '' },
|
32
|
-
'Z' => { stream: 'Check', description: 'Volts or V2h or Amps or A2h', units: '' }
|
32
|
+
'Z' => { stream: 'Check', description: 'Volts or V2h or Amps or A2h', units: '' }
|
33
33
|
# Net Meter Streams
|
34
34
|
# AEMO: NOTE THAT D AND J ARE PREVIOUSLY DEFINED
|
35
35
|
# 'D' => { stream: 'Net', description: 'Net', units: 'kWh' },
|
@@ -5,35 +5,47 @@ module AEMO
|
|
5
5
|
# @since 0.1.4
|
6
6
|
class NEM12
|
7
7
|
QUALITY_FLAGS = {
|
8
|
-
'A'
|
9
|
-
'E'
|
10
|
-
'F'
|
11
|
-
'N'
|
12
|
-
'S'
|
13
|
-
'V'
|
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
14
|
}.freeze
|
15
15
|
|
16
16
|
METHOD_FLAGS = {
|
17
17
|
11 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Check', description: '' },
|
18
18
|
12 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Calculated', description: '' },
|
19
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: '' },
|
20
|
+
14 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Retrospective Like Day', description: 'Updated v7.8' },
|
21
|
+
15 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Retrospective Average Like Day', description: 'Updated v7.8' },
|
22
|
+
16 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Agreed', description: '[OBSOLETE] v7.8' },
|
23
23
|
17 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Linear', description: '' },
|
24
24
|
18 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Alternate', description: '' },
|
25
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: '
|
27
|
-
|
26
|
+
20 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Prospective Like Day',
|
27
|
+
description: 'Updated v7.8' },
|
28
|
+
21 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Five-minute No Historical Data',
|
29
|
+
description: 'Added v7.8' },
|
30
|
+
22 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Prospective Ave Like Day',
|
31
|
+
description: 'Added v7.8' },
|
32
|
+
23 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Previous Year',
|
33
|
+
description: 'Added v7.8' },
|
34
|
+
24 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'Data Scaling',
|
35
|
+
description: 'Added v7.8' },
|
36
|
+
25 => { type: %w[SUB], installation_type: [1, 2, 3, 4], short_descriptor: 'ADL',
|
37
|
+
description: 'Added v7.8' },
|
28
38
|
51 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Previous Year', description: '' },
|
29
39
|
52 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Previous Read', description: '' },
|
30
40
|
53 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Revision', description: '' },
|
31
41
|
54 => { type: %w[SUB], installation_type: 5, short_descriptor: 'Linear', description: '' },
|
32
42
|
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',
|
43
|
+
56 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Prior to First Read - Agreed',
|
44
|
+
description: '' },
|
34
45
|
57 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Customer Class', description: '' },
|
35
46
|
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',
|
47
|
+
59 => { type: %w[EST SUB], installation_type: 5, short_descriptor: 'Five-minute No Historical Data',
|
48
|
+
description: '' },
|
37
49
|
61 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Previous Year', description: '' },
|
38
50
|
62 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Previous Read', description: '' },
|
39
51
|
63 => { type: %w[EST SUB], installation_type: 6, short_descriptor: 'Customer Class', description: '' },
|
@@ -5,55 +5,55 @@ module AEMO
|
|
5
5
|
# @since 0.1.4
|
6
6
|
class NEM12
|
7
7
|
UOM = {
|
8
|
-
'MWh'
|
9
|
-
'kWh'
|
10
|
-
'Wh'
|
11
|
-
'MW'
|
12
|
-
'kW'
|
13
|
-
'W'
|
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
14
|
'MVArh' => { name: 'Megavolt Ampere Reactive Hour', multiplier: 1e6 },
|
15
15
|
'kVArh' => { name: 'Kilovolt Ampere Reactive Hour', multiplier: 1e3 },
|
16
|
-
'VArh'
|
17
|
-
'MVAr'
|
18
|
-
'kVAr'
|
19
|
-
'VAr'
|
20
|
-
'MVAh'
|
21
|
-
'kVAh'
|
22
|
-
'VAh'
|
23
|
-
'MVA'
|
24
|
-
'kVA'
|
25
|
-
'VA'
|
26
|
-
'kV'
|
27
|
-
'V'
|
28
|
-
'kA'
|
29
|
-
'A'
|
30
|
-
'pf'
|
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
31
|
}.freeze
|
32
32
|
|
33
33
|
UOM_NON_SPEC_MAPPING = {
|
34
|
-
'MWH'
|
35
|
-
'KWH'
|
36
|
-
'WH'
|
37
|
-
'MW'
|
38
|
-
'KW'
|
39
|
-
'W'
|
34
|
+
'MWH' => 'MWh',
|
35
|
+
'KWH' => 'kWh',
|
36
|
+
'WH' => 'Wh',
|
37
|
+
'MW' => 'MW',
|
38
|
+
'KW' => 'kW',
|
39
|
+
'W' => 'W',
|
40
40
|
'MVARH' => 'MVArh',
|
41
41
|
'KVARH' => 'kVArh',
|
42
|
-
'VARH'
|
43
|
-
'MVAR'
|
44
|
-
'KVAR'
|
45
|
-
'VAR'
|
46
|
-
'MVAH'
|
47
|
-
'KVAH'
|
48
|
-
'VAH'
|
49
|
-
'MVA'
|
50
|
-
'KVA'
|
51
|
-
'VA'
|
52
|
-
'KV'
|
53
|
-
'V'
|
54
|
-
'KA'
|
55
|
-
'A'
|
56
|
-
'PF'
|
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
57
|
}.freeze
|
58
58
|
end
|
59
59
|
end
|