Skip to main content

Resources

Now that we have a site, we can add flexible resources to it. This step is crucial for providing flexibility and enables our platform to accurately gauge activation rates, resulting in more activations for your resources. 🚀

Types​

There's a long list of resources (devices, assets) that can be flexible, the most common ones are listed below.

The Powernaut platform is indifferent to the type of resource, meaning all types can be registered. However, the type of asset is a required data point to adequately activate flexibility.

  • Batteries
  • Electric Vehicles (EV)
  • Charging stations for EVs
  • Heat pumps
  • Solar panels
  • Electrical boilers
  • Windmill

Managing​

Creating​

To create a new flexible resource, you need at least its site, type and power constraints.

import requests
import json

url = "https://api.powernaut.io/v1/connect/resources"

payload = json.dumps({
"connection_point_id": "<uuid>",
"type": "electric_vehicle_charging_point",
"power": {
"active": {
"minimum": "0",
"maximum": "7.4"
}
}
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer <token>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
Numbers

You'll notice that throughout the API, numbers are communicated with a string datatype, instead of the usual number. This is on purpose, and is done to avoid floating point errors. Number types will be rejected by the API.

Update​

You can also update a resource, e.g. update its name.

import requests
import json

url = "https://api.powernaut.io/v1/connect/resources/<uuid>"

payload = json.dumps({
"name": "Home Battery"
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer <token>'
}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.text)

Delete​

Deleting a resource is done similarly to sites:

import requests

url = "https://api.powernaut.io/v1/connect/resources/<uuid>"

payload = {}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <token>'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)

Listing​

You can fetch a resource by its ID, or list all of them.

Listing all resources​

import requests

url = "https://api.powernaut.io/v1/connect/resources"

payload = {}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <token>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Listing a site's resources​

import requests

url = "https://api.powernaut.io/v1/connect/resources?site_id=<uuid>&connection_point_id=<uuid>"

payload = {}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <token>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)