My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
CommandSpecification  
Specifies the WattDepot CLI commands, Version 2.0
Featured
Updated Dec 1, 2009 by philipmj...@gmail.com

Table of Contents

1.0 Invocation

Example:

java -jar wattdepot-cli.jar  {WattDepotURL}

Brings up the CLI, which will interact with the server at the specified URL.

Error conditions:

  • If the URL does not specify a functional WattDepot server.

If successful, the CLI displays the ">" prompt.

2.0 Commands

The CLI accepts the following commands.

2.1 help

Prints a help message specifying all legal commands.

Example:

> help 
help
  This message
quit
  Exits the system
sources
  Prints a table summarizing the public sources in the system, one per line.
summary {source}
  Prints information about a single source.
sensordata {source} timestamp {timestamp}
  Prints information about a single sensor data instance.
dailysensordata {source} day {day}
  Prints a table listing all of the sensor data instances for the specified day.
power {source} timestamp {timestamp}
  Prints the power generated by the source at the given timestamp.
powerstats {source} day {day} sampling-interval {minutes} statistic {max|min|average}
  Returns the maximum, minimum, or average power generated by the source for the day.
total [carbon|energy] {source} day {day} sampling-interval {minutes}
  Returns the total amount of carbon (or energy) emitted by this source for the given day.
chart power [generated|consumed] {source} {startday} {endday} sampling-interval {minutes} file {file}
  Writes out an html file that will display a chart illustrating the power for the source over the interval.
fueltypes {source}
  Returns a table of fuels associated with this source.
totalpower {source} {timestamp} fuelType {fuelType}
  Returns the total power generated by the given fuel type. 
carboncontent {source} {timestamp} sampling-interval {interval}
  Returns the total carbon that would be emitted by that source over an hour at the rate occurring as of the timestamp. 

2.2 quit

Exits the system.

Example:

> quit

2.3 sources

Prints a table summarizing the public sources in the system, one per line.

Example:

> sources
Name             Parent          Description
SIM_OAHU_GRID                    Virtual resource for all Oahu power plants
SIM_KAHE         SIM_OAHU_GRID   Virtual resource for all Kahe power plants
SIM_KAHE_1       SIM_KAHE        The Kahe-1 baseload plant.

Error conditions:

  • If there is a network error.

2.4 summary {source}

Prints information about a single source.

Example:

> summary SIM_KAHE
SubSources: SIM_KAHE_1, SIM_KAHE_2, SIM_KAHE_3, SIM_KAHE_4, SIM_KAHE_5, SIM_KAHE_6
Description: The Kahe baseload plants.
Owner: johnson@hawaii.edu
Location: Kahe Point, Oahu
Coordinates: 21.30078,-157.819129,41
Properties: (fuelType : LSFO), (plantType : baseload), (carbonIntensity : 1744)
Earliest data:  2009-07-28T09:34:11.000-10:00
Latest data: 2009-09-30T12:12:12.000-10:00
Total data points:  12398

Error conditions:

  • If the source name does not name a defined source.
  • If there is a network error.

2.5 sensordata {source} timestamp {timestamp}

Prints information about a single sensor data instance.

Example:

> sensordata SIM_KAHE_1 timestamp 2009-09-30T12:12:12.000-10:00
Tool: HECO-Downloader
Source: SIM_KAHE_1
Properties: (powerGenerated : 125473)

Error conditions:

  • If the source name does not name a defined (non-virtual) source.
  • If the timestamp does not identify a sensor data instance.
  • If there is a network error.

2.6 dailysensordata {source} day {day}

Prints a table listing all of the sensor data instances for the specified day.

Example:

> dailysensordata SIM_KAHE_1 day 2009-09-30
2009-09-30T00:00:00.000-10:00  Tool: HECO-Downloader  Properties: (powerGenerated : 125473)
2009-09-30T06:00:00.000-10:00  Tool: HECO-Downloader  Properties: (powerGenerated : 145788)
2009-09-30T12:00:00.000-10:00  Tool: HECO-Downloader  Properties: (powerGenerated : 213425)
2009-09-30T18:00:00.000-10:00  Tool: HECO-Downloader  Properties: (powerGenerated : 129479)

Error conditions:

  • If the source name does not name a defined (non-virtual) source.
  • If there is a network error.

2.7 power [generated|consumed] {source} timestamp {timestamp}

Prints the power generated (or consumed) by the source at the given timestamp. The power value is interpolated if there is no corresponding sensor data instance.

Example:

> power generated SIM_OAHU_GRID timestamp 2009-09-30T10:10:10.000-10:00
234574987

Error conditions:

  • If the source name does not name a defined (virtual or non-virtual) source.
  • If the timestamp is not syntactically correct or specifies a date in the future.
  • If there is a network error.
  • If the system cannot perform interpolation due to lack of data.

2.8 powerstats [generated|consumed] {source} day {day} sampling-interval {minutes} statistic {max|min|average}

Returns the maximum, minimum, or average power generated (or consumed) by the source for the day. The statistic is obtained by sampling the source at the specified minute intervals for the course of the day.

Example:

> powerstats generated SIM_KAHE day 2009-09-30 interval 60 statistic max
342145

Error conditions:

  • If the source name does not name a defined (virtual or non-virtual) source.
  • If the day is not syntactically correct or specifies a date in the future.
  • If there is a network error.
  • If the system cannot perform interpolation due to lack of data.

2.9 total [carbon|energy] generated {source} day {day} sampling-interval {minutes}

Returns the total amount of carbon (or energy) generated (or consumed) by this source for the given day. The sampling interval indicates how to generate the curve of carbon (or energy) data points.

Example:

> total carbon generated SIM_OAHU_GRID day 2009-09-12 sampling-interval 60
321567

Error conditions:

  • If the source name does not name a defined (virtual or non-virtual) source.
  • If the day is not syntactically correct or specifies a date in the future.
  • If there is a network error.
  • If the system cannot perform interpolation due to lack of data.

2.10 chart power [generated|consumed] {source} {startday} {endday} sampling-interval {minutes} file {file}

Writes out an html file that when displayed in a browser will show a chart representation of the power generated (or consumed) by this source from startday to endday, where data points are generated at a sampling interval of minutes.

Example:

> chart power generated SIM_OAHU_GRID 2009-09-01 2009-09-30 sampling-interval 60 file kahe-september-energy.html 
Wrote:  /Users/johnson/wattdepot/data/kahe-september-power.html

Error conditions:

  • If the source name does not name a defined (virtual or non-virtual) source.
  • If the start or end day is not syntactically correct or specifies a date in the future.
  • If there is a network error.
  • If the system cannot perform interpolation due to lack of data.
  • If the file cannot be written.

2.11 fueltypes {source}

Generates a table where the first column contains fuel types and the second column is a comma-delimited list of (non-virtual) sources generating power using that fuel type.

Note that only non-virtual sources have the "fuelType" property. Note that if the user passes a virtual source, you will need to recursively walk the tree in order to discover all non-virtual sources associated with the input source.

Example:

> fueltypes SIM_IPP
LSFO : SIM_KALELOA
waste : SIM_HPOWER
coal : SIM_AES 

Error conditions:

  • If the source name does not name a defined (virtual or non-virtual) source.
  • If there is a network error.

2.12 totalpower {source} {timestamp} fuelType {fuelType}

Generates the total power generated by all non-virtual sources associated with this source that use the specified fuel type.

Example:

> totalpower SIM_IPP 2009-10-26T18:15:00.000-10:00 fueltype waste
46,000,000

Error conditions:

  • If the source name does not name a defined (virtual or non-virtual) source.
  • If there is no non-virtual source with the specified fuel type.
  • If the timestamp cannot be parsed or is invalid.
  • If there is a network error.

2.13 carboncontent {source} {timestamp} sampling-interval {interval}

Computes the carbon content of the source. Given:

  • the total carbon generated for the hour starting at the specified timestamp, assuming a constant rate of emission;
  • the total energy generated for the hour starting at the specified timestamp, assuming a constant rate of generation;

the carbon content is (total carbon generated / total energy generated).

Display the result in lbs carbon/MWh (note, most WattDepot API calls return Wh)

Example:

> carboncontent SIM_IPP 2009-11-15T12:00:00.000-10:00 sampling-interval 10
1874.4 lbs CO2/MWh

Error conditions:

  • If the source name does not name a defined (virtual or non-virtual) source.
  • If the timestamp cannot be parsed or is invalid.
  • If there is a network error.


Sign in to add a comment
Powered by Google Project Hosting