Get All Devices
Retrieve all devices (sensors and actuators) for a specific tenant.Path Parameters
ID of the tenant
Response
Unique ID of the device (TSID - Time-Sorted ID)
Unique code per tenant (e.g., DEV-00001)
ID of the tenant owning this device
ID of the sector where the device is installed
Code of the sector
Human-readable name (e.g., “Temperature Sensor Greenhouse 1”)
Category ID (1=SENSOR, 2=ACTUATOR)
Category name (SENSOR or ACTUATOR)
Device type ID (e.g., 1=TEMPERATURE, 2=HUMIDITY, 3=VALVE)
Device type name
Unit of measurement ID
Unit symbol (°C, %, ppm, etc.)
Whether the device is active
Creation timestamp (ISO 8601)
Last update timestamp (ISO 8601)
Example Request
Example Response
Get Device by ID
Retrieve a specific device by its ID.Path Parameters
ID of the tenant
ID of the device
Response
Returns a single device object (same structure as “Get All Devices”).Example Request
Create Device
Create a new device for a tenant.Path Parameters
ID of the tenant
Request Body
ID of the sector where the device will be installed
Human-readable name (max 100 characters)
Category ID (1=SENSOR, 2=ACTUATOR)
Device type ID (e.g., 1=TEMPERATURE, 2=HUMIDITY)
Unit of measurement ID
Whether the device is active
Response
Returns the created device object with status code201 Created.
Example Request
Example Response
Update Device
Update an existing device.Path Parameters
ID of the tenant
ID of the device to update
Request Body
All fields are optional. Only include fields you want to update.ID of the sector (must belong to the same tenant)
Human-readable name (max 100 characters)
Category ID (1=SENSOR, 2=ACTUATOR)
Device type ID
Unit of measurement ID
Whether the device is active
Response
Returns the updated device object.Example Request
Delete Device
Delete a device from a tenant.Path Parameters
ID of the tenant
ID of the device to delete
Response
Returns status code204 No Content on success, or 404 Not Found if the device doesn’t exist.
Example Request
Device Categories
Devices are categorized into two main types:1. Sensors
- Category ID: 1
- Purpose: Collect environmental data
- Types: Temperature, Humidity, CO2, Light, Soil Moisture, Atmospheric Pressure
- Data Flow: Sensors → MQTT → API → Database
2. Actuators
- Category ID: 2
- Purpose: Control greenhouse systems
- Types: Valves, Fans, Heaters, Lights, Vents
- Data Flow: API → MQTT → Actuators
- Control Modes: Manual, Automatic, Scheduled
Device Types
Common device types include:| Type ID | Type Name | Category | Unit |
|---|---|---|---|
| 1 | TEMPERATURE | Sensor | °C |
| 2 | HUMIDITY | Sensor | % |
| 3 | SOIL_MOISTURE | Sensor | % |
| 4 | LIGHT_INTENSITY | Sensor | lux |
| 5 | CO2 | Sensor | ppm |
| 6 | ATMOSPHERIC_PRESSURE | Sensor | hPa |
| 7 | VALVE | Actuator | - |
| 8 | FAN | Actuator | - |
| 9 | HEATER | Actuator | - |
| 10 | VENT | Actuator | - |
Device Hierarchy
Devices are organized in a hierarchical structure:- Tenant: The organization or customer
- Greenhouse: Physical greenhouse location
- Sector: Zone within a greenhouse (e.g., Zone A, Zone B)
- Device: Individual sensor or actuator
- Has a unique code per tenant (e.g., DEV-00001)
- Belongs to exactly one sector
- Inherits tenant context from its sector
- Can be activated/deactivated via the
isActiveflag