Note
Watt-time
is a community model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!
WattTime technology—based on real-time grid data, cutting-edge algorithms, and machine learning—provides first-of-its-kind insight into your local electricity grid’s marginal emissions rate. Read More...
WattTime Model provides a way to calculate emissions for a given time in a specific location.
The model is based on the WattTime API. The model uses the following inputs:
- location: Location of the software system (latitude in decimal degrees, longitude in decimal degrees). "latitude,longitude"
- timestamp: Timestamp of the recorded event (2021-01-01T00:00:00Z) RFC3339
- duration: Duration of the recorded event in seconds (3600)
Limitations:
- Set of inputs are to be within 32 days of each other.
- Emissions are aggregated for every 5 minutes regardless of the granularity of the inputs.
WattTime API requires activation of subscription before usage. Please refer to the WattTime website for more information.
Required Parameters:
# example environment variable config , prefix the environment variables with "ENV" to load them inside the model.
# export WATT_TIME_USERNAME=test1
# export WATT_TIME_PASSWORD=test2
- username: Username for the WattTime API
- ENV_WATT_TIME_USERNAME - specifying this value enables the Impact to load the value from the environment variable
WATT_TIME_USERNAME
- ENV_WATT_TIME_USERNAME - specifying this value enables the Impact to load the value from the environment variable
- password: Password for the WattTime API
- ENV_WATT_TIME_PASSWORD - specifying this value enables the Impact to load the value from the environment variable
WATT_TIME_PASSWORD
- ENV_WATT_TIME_PASSWORD - specifying this value enables the Impact to load the value from the environment variable
Required Parameters:
- timestamp: Timestamp of the recorded event (2021-01-01T00:00:00Z) RFC3339
- location: Location of the software system (latitude in decimal degrees, longitude in decimal degrees). "latitude,longitude"
- duration: Duration of the recorded event in seconds (3600)
// environment variable configuration
// export WATT_TIME_USERNAME=test1
// export WATT_TIME_PASSWORD=test2
// use environment variables to configure the model
const env_model = await new WattTimeGridEmissions().configure('watt-time', {
username: process.env.WATT_TIME_USERNAME,
password: process.env.WATT_TIME_PASSWORD,
});
const inputs = [
{
timestamp: '2021-01-01T00:00:00Z',
location: "43.22,-80.22",
duration: 3600,
},
];
const results = env_model.calculateEmissions(inputs);
# environment variable config , prefix the environment variables with "ENV" to load them inside the model.
# export WATT_TIME_USERNAME=test1
# export WATT_TIME_PASSWORD=test2
config:
username: ENV_WATT_TIME_USERNAME
password: ENV_WATT_TIME_PASSWORD
inputs:
- timestamp: 2021-01-01T00:00:00Z
location: "43.22,-80.21"
duration: 3600
config:
username: username
password: password
inputs:
- timestamp: 2021-01-01T00:00:00Z
location: "43.22,-80.22"
duration: 3600
name: watt-time
description: simple demo invoking watt-time
tags:
initialize:
models:
- name: watt-time
model: WattTimeGridEmissions
path: '@grnsft/if-unofficial-models'
graph:
children:
child:
pipeline:
- watt-time
config:
watt-time:
username: username
password: password
inputs:
- timestamp: 2023-07-06T00:00
duration: 3600
thermal-design-power: 300
- Technically, WattTime model sets (or overwrites any preconfigured value of) the grid-carbon-intensity attribute.
- As such, it should be positioned before the sci-o model, if such a model is used.