Module: Genability::Client::TimeOfUse

Included in:
Genability::Client
Defined in:
lib/genability/client/time_of_use.rb

Overview

Many tariffs have pricing that depends on the time of day the energy is being used. We call these times the Time of Use for a tariff. The most common examples are On Peak and Off Peak. Some examples here may help:

  1. Within a single Time of Use, e.g. On Peak, the price for a tariff will always be the same.
  2. Within a single Time of Use, e.g. On Peak, you may have multiple Periods. A Period is a range of days and times that this TOU applies to.

Instance Method Summary collapse

Instance Method Details

#time_of_use_intervals(load_serving_entity_id, time_of_use_group_id, options = {}) ⇒ Array Also known as: tou_intervals, intervals, toui

Returns all the Intervals for a Time of Use Group for an optionally specified from and to date and time range. Defaults to current time if fromDateTime is not specified and to a one week look ahead window if toDateTime is not specified.

Examples:

Return the intervals for the time of use group for Georgia Power Co

Genability.time_of_use_intervals(2756, 1)

Parameters:

  • load_serving_entity_id (Integer)

    Unique Genability ID (primary key) for a Load Serving Entity.

  • time_of_use_group_id (Integer)

    Genability ID (primary key) for this Time of Use Group. This is unique within the LSE, not across LSE's so you will always need to specify the LSE ID when requested a TOU Group.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :from (DateTime)

    ISO 8601 format for the starting date and time of the requested Intervals. Defaults to current day and time if not specified. (Optional)

  • :to (DateTime)

    ISO 8601 format for the ending date and time of the requested Intervals. Defaults to one week after the fromDateTime. (Optional)

Returns:

  • (Array)

    Returns all the Intervals for a Time of Use Group.

See Also:

Rate Limited:

  • true

Supported formats:

  • :json

Requires Authentication:

  • true



47
48
49
# File 'lib/genability/client/time_of_use.rb', line 47

def time_of_use_intervals(load_serving_entity_id, time_of_use_group_id, options = {})
  get("public/timeofuses/#{load_serving_entity_id}/#{time_of_use_group_id}/intervals", interval_params(options)).results
end

#time_of_uses(load_serving_entity_id, time_of_use_group_id) ⇒ Hashie::Mash Also known as: tou

Returns a particular time of use group using its time of use group ID and the load serving entity ID.

Examples:

Return the time of use group for Georgia Power Co

Genability.time_of_uses(2756, 1)

Parameters:

  • load_serving_entity_id (Integer)

    Unique Genability ID (primary key) for a Load Serving Entity.

  • time_of_use_group_id (Integer)

    Genability ID (primary key) for this Time of Use Group. This is unique within the LSE, not across LSE's so you will always need to specify the LSE ID when requested a TOU Group.

Returns:

  • (Hashie::Mash)

    Return the time of uses for a load serving entity.

See Also:

Rate Limited:

  • true

Supported formats:

  • :json

Requires Authentication:

  • true



25
26
27
# File 'lib/genability/client/time_of_use.rb', line 25

def time_of_uses(load_serving_entity_id, time_of_use_group_id)
  get("public/timeofuses/#{load_serving_entity_id}/#{time_of_use_group_id}").results.first
end