Working with endpoints
This section explains how to use Homsai APIs to model a plant: creating and managing plants, devices and sensors, and the recommended client‑side workflow.
Overview
In Homsai, modeling a plant usually follows these steps:
- Create a Plant.
- Configure the Sensors attached to the plant and/or devices.
- Add one or more Devices to the plant.
In this guide you will see:
- how to create, read, update and delete Plants;
- how to define and use Sensors to collect data;
- how to manage Devices within a plant.
Plants
Plants are the starting point: without a plant you cannot attach devices or sensors.
Typical operations:
-
Create a plant
- Endpoint:
POST /plants - Purpose: defines a new plant (e.g. “Rossi Home – PV + Battery”).
- Requires: permission
PLANTS CREATE.
- Endpoint:
-
List plants
- Endpoint:
GET /plants - Purpose: get the list of the user’s plants with pagination and filters (
search,plantUuids,externalIds). - Requires: permission
PLANTS READ.
- Endpoint:
-
Get plant details
- Endpoint:
GET /plants/{plantUuid} - Purpose: retrieve full information for a single plant.
- Requires: permission
PLANTS READand ownership on the plant.
- Endpoint:
-
Update a plant
- Endpoint:
PUT /plants/{plantUuid} - Purpose: modify metadata and configuration of an existing plant.
- Requires: permission
PLANTS UPDATEand ownership.
- Endpoint:
-
Delete a plant
- Endpoint:
DELETE /plants/{plantUuid} - Purpose: remove a plant (and dependent entities according to domain rules).
- Requires: permission
PLANTS DELETEand ownership.
- Endpoint:
Devices
Devices represent the physical or logical components of the plant (inverters, batteries, heat pumps, wallboxes, etc.) and are always linked to a plant.
Typical operations:
-
Create a device in a plant
- Endpoint:
POST /plants/{plantUuid}/devices - Purpose: add a new device to the plant (body:
DevicesCreateDto). - Requires: permission
DEVICES CREATEand plant ownership.
- Endpoint:
-
List devices of a plant
- Endpoint:
GET /plants/{plantUuid}/devices - Purpose: get the list of devices of a plant, with support for
search,includeRelationships, pagination. - Requires: permission
DEVICES READ.
- Endpoint:
-
Get device details
- Endpoint:
GET /plants/{plantUuid}/devices/{deviceUuid} - Purpose: retrieve full information about a device, optionally including relationships (e.g. linked sensors).
- Parameters:
includeRelationships. - Requires: permission
DEVICES READ.
- Endpoint:
-
Update a device
- Endpoint:
PUT /plants/{plantUuid}/devices/{deviceUuid} - Purpose: modify configuration or metadata of a device.
- Requires: permission
DEVICES UPDATEand plant ownership.
- Endpoint:
-
Delete a device
- Endpoint:
DELETE /plants/{plantUuid}/devices/{deviceUuid} - Purpose: remove a device from the plant.
- Requires: permission
DEVICES DELETEand plant ownership.
- Endpoint:
Sensors
Sensors are the data sources of the plant: they measure consumption, production and other values, and can be attached to devices or directly to the plant.
Typical operations:
-
Create a sensor
- Endpoint:
POST /plants/{plantUuid}/sensors - Purpose: add a new sensor linked to a plant (and optionally to a device).
- Parameters: optional flag
ignoreConnectionsTestto skip connection checks. - Requires: permission
SENSORS CREATE.
- Endpoint:
-
List sensors of a plant
- Endpoint:
GET /plants/{plantUuid}/sensors - Purpose: get the list of sensors associated with a plant.
- Parameters:
searchfor text filtering;dataTypesCollectUuidto filter by collected data type;includeRelationshipsto include relationships (e.g. linked device);- pagination parameters (
page,size,sort).
- Requires: permission
SENSORS READand ownership.
- Endpoint:
-
Get sensor details
- Endpoint:
GET /plants/{plantUuid}/sensors/{sensorUuid} - Purpose: retrieve configuration and relationships of a specific sensor.
- Parameters:
includeRelationships. - Requires: permission
SENSORS READand ownership.
- Endpoint:
-
Update a sensor
- Endpoint:
PUT /plants/{plantUuid}/sensors/{sensorUuid} - Purpose: change configuration, associations or metadata of the sensor.
- Requires: permission
SENSORS UPDATEand ownership.
- Endpoint:
-
Delete a sensor
- Endpoint:
DELETE /plants/{plantUuid}/sensors/{sensorUuid} - Purpose: remove a sensor from the plant.
- Requires: permission
SENSORS DELETEand ownership.
- Endpoint:
Recommended workflow
To correctly model a new plant from a client perspective, the recommended order is:
-
Create the Plant
- Use
POST /plantsto define the plant (name, external identifiers, metadata).
- Use
-
Configure Sensors
- Create sensors with
POST /plants/{plantUuid}/sensors, linking them to devices or directly to the plant. - Make sure to use the appropriate Sensor Types and Data Types Collects (power, energy, temperature, etc.).
- Create sensors with
-
Register main Devices
- For each physical component (inverter, battery, heat pump, wallbox, etc.), use
POST /plants/{plantUuid}/devices. - Assign the correct Device Type to enable proper metrics and forecasts.
- For each physical component (inverter, battery, heat pump, wallbox, etc.), use
-
Verify configuration
- Use
GET /plants/{plantUuid}/devicesandGET /plants/{plantUuid}/sensorswithincludeRelationshipsto check that the domain structure is correct. - Only after this phase does it make sense to start using metrics and forecast endpoints (consumptions, productions, pv‑health, predict, etc.).
- Use
Following this flow makes client‑side integration more straightforward and reduces configuration errors that may impact energy metrics and subsequent analyses.