system.mes.oee.getCalculationRecords
Description
Returns pre-computed OEE calculation records for the given location, period type, and date range,
ordered by startDate ascending. These records are generated by the nightly backfill job and
can also be rebuilt on demand with
rebuildCalculationRecords.
Permissions
This method requires the OEE.READ.GET permission.
Syntax
system.mes.oee.getCalculationRecords(locationIdOrPath, periodType, startDate, endDate)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
locationIdOrPath | String | False | Location ID (ULID) or path. |
periodType | String | False | Period granularity: "HOUR", "DAY", "WEEK", "MONTH", or "SHIFT". |
startDate | Date | False | Start of the query range (inclusive). |
endDate | Date | False | End of the query range (inclusive). |
Returns
A JSON list of OeeCalculationRecordDTO objects ordered by startDate ascending.
| Name | Type | Nullable | Description | Default Value |
|---|---|---|---|---|
id | String | True | The ID of the record (ULID). | null |
locationId | String | False | Identifier of the associated location. | null |
locationPath | String | True | Path of the associated location (display only). | null |
periodType | String | False | Period granularity: HOUR, DAY, WEEK, MONTH, or SHIFT. | null |
startDate | Instant | False | Start of the period bucket (calendar-aligned). | null |
endDate | Instant | False | End of the period bucket (calendar-aligned). | null |
calculatedDate | Instant | False | When this record was computed. | null |
availability | Double | True | Availability metric (0.0 to 1.0). | null |
performance | Double | True | Performance metric (0.0 to 1.0). | null |
quality | Double | True | Quality metric (0.0 to 1.0). | null |
oee | Double | True | Overall Equipment Effectiveness metric (0.0 to 1.0). | null |
teep | Double | True | Total Effective Equipment Performance metric (0.0 to 1.0). | null |
totalDurationSec | Double | False | Total duration of the period in seconds. | 0.0 |
scheduledDurationSec | Double | False | Duration scheduled for production in seconds. | 0.0 |
runningDurationSec | Double | False | Duration the machine was actively running in seconds. | 0.0 |
downtimeDurationSec | Double | False | Duration in downtime state in seconds. | 0.0 |
scheduledDowntimeDurationSec | Double | False | Duration in scheduled downtime mode in seconds. | 0.0 |
unscheduledDowntimeDurationSec | Double | False | Duration in unscheduled downtime mode in seconds. | 0.0 |
productionCount | Double | False | Total units produced during the period. | 0.0 |
expectedProductionCount | Double | False | Expected units to be produced during the period. | 0.0 |
wasteCount | Double | False | Total waste units recorded during the period. | 0.0 |
goodCount | Double | False | Total good units recorded during the period. | 0.0 |
Code Examples
from java.util import Date
import system.date
# Get all daily records for the past week
location = "Enterprise/Site/Line1"
endDate = Date()
startDate = system.date.addDays(endDate, -7)
records = system.mes.oee.getCalculationRecords(location, "DAY", startDate, endDate)
for record in records:
print record['startDate'], "OEE:", record['oee']