rebase.energy
Standard objects

Assets

Turbines, panels, and batteries with a capacity, usually parts of a site.

An asset is one piece of generating or storage equipment, or a group of identical units treated as one, with a type and a capacity. Assets normally belong to a site as parts; the site's stats.total_capacity_kw is the sum of its assets.

Fields

FieldTypeNotes
namestringRequired. Unique within the parent site. Envelope field.
parent_iduuidOptional on create. The site this asset is a part of. Envelope field.
values.typewind_turbine, solar_panel, batteryRequired.
values.capacity_kwnumberRequired. Feeds the site's rollup.
values.descriptionstringOptional.
values.latitude, values.longitudenumberOptional. An asset without coordinates inherits its site's.

Responses add the envelope: id, object: "assets", timestamps, parent_id and parent_name when the asset is part of a site.

Create

The usual way to create assets is inline when creating a site. To add one to an existing site, create it on its own endpoint with parent_id:

r = requests.post(f"{BASE}/objects/assets", headers=HEADERS, json={
    "name": "Battery 1",
    "parent_id": site["id"],
    "values": {"type": "battery", "capacity_kw": 500},
})
r.raise_for_status()
asset = r.json()
print(asset["parent_name"])

Omit parent_id to create an asset as a workspace root, not attached to any site. Such an asset can still carry timeseries and be referenced from custom records, but it does not count towards any site's capacity.

List

GET /objects/assets lists every asset in the workspace, attached or not, with parent_id and parent_name on each. For the assets of one site, use the site's link route, GET /objects/sites/{site_id}/assets, or read the site record's values.assets.

GET /objects/assets/stats gives the workspace total: total, sums.capacity_kw, and type_counts broken down by values.type.

Update and delete

PATCH /objects/assets/{record_id} changes name and, under values, type, capacity_kw, description, and coordinates. An asset cannot be moved to another site through PATCH yet; it stays in the site it was created in.

requests.patch(f"{BASE}/objects/assets/{asset['id']}", headers=HEADERS,
               json={"values": {"capacity_kw": 600}}).raise_for_status()

DELETE /objects/assets/{record_id} removes the asset and its timeseries, and the parent site's stats.total_capacity_kw drops accordingly. Deleting the parent site deletes all of its assets.

On this page