Overview
Greenhouses are physical structures that belong to a tenant. Each greenhouse contains sensors, actuators, and sectors for monitoring and controlling environmental conditions.Get All Greenhouses for Tenant
Path Parameters
Unique identifier of the tenant
Response
Unique identifier of the greenhouse
Unique readable code (e.g., “GRH-00001”)
Greenhouse name
ID of the tenant that owns this greenhouse
Area in square meters
Timezone (e.g., “Europe/Madrid”)
Whether the greenhouse is active
Creation timestamp (ISO 8601)
Last update timestamp (ISO 8601)
Get Greenhouse by ID
Path Parameters
Unique identifier of the tenant
Unique identifier of the greenhouse
Response
Create Greenhouse
Path Parameters
Unique identifier of the tenant
Request Body
Greenhouse name
Area in square meters
Timezone identifier
Whether the greenhouse is active
Response
Update Greenhouse
Path Parameters
Unique identifier of the tenant
Unique identifier of the greenhouse to update
Request Body
All fields are optional. Only provided fields will be updated.Greenhouse name
Geographic coordinates
Area in square meters
Timezone identifier
Whether the greenhouse is active
Response
Delete Greenhouse
Path Parameters
Unique identifier of the tenant
Unique identifier of the greenhouse to delete
Response
MQTT Topic Mapping
Each greenhouse is associated with an MQTT topic for receiving sensor data:Topic Structure
GREENHOUSE/SARA- Vivero Sara’s greenhouse dataGREENHOUSE/001- Generic tenant with ID 001GREENHOUSE/DEFAULT- Legacy format (backward compatible)
Data Flow
- Sensor devices publish data to the MQTT topic
- API receives messages via MQTT subscriber
- Data is cached in Redis (last 1000 messages, 24h TTL)
- Data is persisted in TimescaleDB time-series database
- WebSocket broadcast sends real-time updates to connected clients
Sensor Data Structure
Greenhouse sensor messages contain 22 fields:- Temperature & Humidity
- Sectors (12 fields)
- Extractors
- Reserved
TEMPERATURA INVERNADERO 01- Temperature for greenhouse 1 (°C)HUMEDAD INVERNADERO 01- Humidity for greenhouse 1 (%)TEMPERATURA INVERNADERO 02- Temperature for greenhouse 2 (°C)HUMEDAD INVERNADERO 02- Humidity for greenhouse 2 (%)TEMPERATURA INVERNADERO 03- Temperature for greenhouse 3 (°C)HUMEDAD INVERNADERO 03- Humidity for greenhouse 3 (%)
Sectors and Devices
Each greenhouse can contain:- Sectors: Physical zones within the greenhouse for monitoring specific areas
- Sensors: Temperature, humidity, soil moisture, light intensity, CO2 levels
- Actuators: Irrigation systems, ventilation fans, heating/cooling units
Related Resources
- Tenant Management - Manage parent tenant
- User Management - Manage users with access to greenhouses
- Alert Management - View alerts from greenhouse sensors