gridX Entity Model Overview

Here’s a quick reference for how the core entities in the gridX API relate to each other.

Account

An organizational unit that manages access to systems and users. Every account has a kind:

  • b2b - a regular account, can have multiple users
  • end-user- a customer account, limited to a single user

Accounts form a tree via parentID. Users (and API tokens) are limited to the respective accounts and their children in this tree structure, enabling effective access management.

Note on “Customer”: /customers is not a separate resource, it’s just a filtered view of Account where kind=end-user. If you’re hitting /customers/{customerID}, you’re reading/writing an Account.

User

A login identity, distinct from Account. Each User belongs to exactly one Account via accountID. Not to be confused with an Account’s kind - a b2b account can have many Users, an end-user account has just one.

System

The logical representation of a site, encompassing its Assets and any associated Gateways. A System is owned by a b2b Account and used by one end-user Account (the customer). A System contains zero or one Local Gateway.

Gateway

Provides the connection to an Asset. Gateways come in two types:

  • Local Gateway (gridBox): A physical device that connects to local assets. A System can have a maximum of one Local Gateway.
  • Cloud Gateway: A connection point used to access cloud-connected assets. A distinct Cloud Gateway is associated with each individual cloud Asset.

Asset

(formerly “Appliance” - you may still see this term in older docs)
A monitorable/controllable device: inverters, meters, heat pumps, EV charging stations, etc. Each Asset connects to the System via a Gateway - either through the System’s single Local Gateway (gridBox) or through its own dedicated Cloud Gateway. Because this connection method is set per-Asset, a single System can be “hybrid,” running both local and cloud-connected Assets simultaneously. Assets can be nested (e.g. a hybrid inverter as parent of separate PV and battery components).


Entity relationships:

erDiagram
    ACCOUNT ||--o{ ACCOUNT  : "parent of"
    ACCOUNT ||--o{ SYSTEM   : "owns (b2b)"
    ACCOUNT ||--o| SYSTEM   : "is customer of (end-user)"
    ACCOUNT ||--o{ USER     : "has"
    SYSTEM  ||--o| GATEWAY  : "has (0 or 1 - cloud-only systems have none)"
    SYSTEM  ||--o{ ASSET    : "contains"
    ASSET   ||--o{ ASSET    : "parent of (top-level assets have none)"

    ACCOUNT {
        uuid id PK
        uuid parentID FK "self-ref account tree"
        string name
        string email
        string kind "b2b or end-user"
    }

    USER {
        uuid id PK
        uuid accountID FK
        string email
        string fullName
    }

    SYSTEM {
        uuid id PK
        string name
    }

    GATEWAY {
        uuid id PK
        string serialnumber
        string connectionStatus
    }

    ASSET {
        uuid id PK
        uuid parent FK "nullable at top level"
        string name
        string type "INVERTER, METER, EVSTATION, HEATER, HEAT_PUMP, IO_DEVICE"
        string gatewayType "GRIDBOX or CLOUD - determines whether this asset needs the system's Gateway"
    }
2 Likes