AEMO Gem

Makes working with AEMO data more pleasant.

Gem Version Build Status Dependency Status Code Climate Coverage Status

Installation

Manually from RubyGems.org

% gem install aemo

Or if you are using Bundler

# Gemfile
gem 'aemo'

Using AEMO Gem

Market Information

Access to AEMO Market Information from www.nemweb.com.au/mms.GRAPHS/GRAPHS/GRAPH_5#NSW1.csv or www.nemweb.com.au/mms.GRAPHS/GRAPHS/GRAPH_30#NSW1.csv

Regions

AEMO::Market::REGIONS

Current Dispatch

AEMO::Market.current_dispatch('NSW')

Current Trading

AEMO::Market.current_trading('NSW')

Market::Interval

Initialize

AEMO::Market::Interval(datetime, { 'REGION' => 'NSW', 'TOTALDEMAND' => 123.456, 'RRP' => 78.96, 'PERIODTYPE' => 'TRADING'})

datetime

interval.datetime

Interval Length

interval.interval_length

Interval Type

interval.interval_type

Is Dispatch?

interval.is_dispatch?

Is Trading?

interval.is_trading?

Value

The value of the interval in Australian Dollars

interval.value

Region

AEMO Regions.

REGIONS

Hash of abbreviations to fullnames of AEMO regions.

AEMO::Region::REGIONS

initialize

AEMO::Region.new('NSW')

abbr

region.abbr

to_s

region.to_s

fullname

region.fullname

current_dispatch

region.current_dispatch

current_trading

region.current_trading

All

AEMO::Region.all

NEM12 Files

TODO: Update this to provide more information on these class constants.

RECORD_INDICATORS TRANSACTION_CODE_FLAGS UOM UOM_NON_SPEC_MAPPING QUALITY_FLAGS METHOD_FLAGS REASON_CODES DATA_STREAM_SUFFIX

Initialize

AEMO::NEM12.new(nmi)

Flag to String

nem12.flag_to_s

To Array

nem12.to_a

To CSV

nem12.to_csv

Parse NEM12 File

AEMO::NEM12.parse_nem12_file(path_to_file)

Parse NEM12 String

AEMO::NEM12.parse_nem12(string)

NEM13 Files

NMI

General support for a National Meter Identifier.

Regions

AEMO::NMI::REGIONS

NMI Allocations

NMIs have been allocated to DNSPs by AEMO. Provides an easy lookup of the network for a given NMI.

AEMO::NMI::NMI_ALLOCATIONS

Distribution Loss Factors

Distribution Loss Factor Codes as a hash of the code to the various sets of data from AEMO.

AEMO::NMI::DLF_CODES

Transmission Node Identifiers & Marginal Loss Factors

Transmission Node Identifiers as a hash of the TNI to the various sets of data from AEMO including relevant Marginal Loss Factors.

AEMO::NMI::TNI_CODES

Create

nmi = AEMO::NMI.new("4001234567")

Valid NMI?

nmi.valid_nmi?

Valid Checksum?

nmi.valid_checksum?(checksum_value)

Network

Returns the network information based on NMI allocation.

nmi.network

Checksum

Returns the checksum for a NMI

nmi.checksum

Raw MSATS NMI Detail Data

Returns MSATS NMI Detail data as opposed to mapping it into

nmi.raw_msats_nmi_detail(options)

Update from MSATS

Requires MSATS authorization to work. Sets attributes from MSATS NMI Detail request data.

nmi = AEMO::NMI.new("4001234567")
nmi.update_from_msats!

Friendly Address

Helper method for friendly address for a NMI from AEMO's structured address.

nmi.friendly_address

Meters by Status

Returns the meters for a provided status ("C(urrent)" or "R(etired)").

nmi.meters_by_status(status)

Data Streams by Status

Returns the data streams for a provided status ("A(ctive)" or "I(nactive)").

nmi.data_streams_by_status(status)

Current Daily Load

Provides current daily load for the NMI instead of at a data stream level.

nmi.current_daily_load

Transmission Node Identifier Margin Loss Factor Value

Returns the TNI MLF value for a given datetime.

nmi.tni_value(datetime)

Distribution Loss Factor Code Value

Returns the DLF value for a given datetime.

nmi.dlfc_value(datetime)

MSATS

MSATS is the Market Settlements And Trading System. This gem currently only provides support for AEMO's MSATS Web Services and does not provide capabilities around the B2B Inbox or other services not exposed via the AEMO Web Service.

Further information available at AEMO's website

Authentication

Authentication requires an MSATS username and password configured for your participant id.

AEMO::MSATS(PARTICIPANT_ID, USERNAME, PASSWORD)

C4 Query

AEMO::MSATS.c4(nmi, from_date,to_date,as_at_date, options = {})

MSATS Limits Query

AEMO::MSATS.msats_limits

NMI Discovery By Delivery Point Identifier Query

AEMO::MSATS.nmi_discovery_by_delivery_point_identifier(jurisdiction_code,delivery_point_identifier)

NMI Discovery By Meter Serial Number Identifier Query

AEMO::MSATS.nmi_discovery_by_meter_serial_number(jurisdiction_code,meter_serial_number)

NMI Discovery By Address Query

AEMO::MSATS.nmi_discovery_by_address(jurisdiction_code,options = {})

Options

  • :building_or_property_name
  • :location_descriptor
  • :lot_number
  • :flat_or_unit_number
  • :flat_or_unit_type
  • :floor_or_level_number
  • :floor_or_level_type
  • :house_number
  • :house_number_suffix
  • :street_name
  • :street_suffix
  • :street_type
  • :suburb_or_place_or_locality
  • :postcode
  • :state_or_territory

MSATS System Status Query

AEMO::MSATS.system_status

NMI Detail Query

AEMO::MSATS.nmi_detail(nmi, options = {})

Options

  • :type
  • :reason