system.mes.oee.getCalculationRecordByLocationAndPeriodStart
Description
Returns the single pre-computed OEE calculation record matching the exact period start time for
the given location and period type. Returns None if no record exists for that combination.
Permissions
This method requires the OEE.READ.GET permission.
Syntax
system.mes.oee.getCalculationRecordByLocationAndPeriodStart(locationIdOrPath, periodType, startDate)
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 | Exact start_date of the record to retrieve. |
Returns
A JSON representation of an OeeCalculationRecordDTO, or None if not found.
| 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 |
goodCount | Double | False | Total good units recorded during the period. | 0.0 |
wasteCount | Double | False | Total waste units recorded during the period. | 0.0 |
Code Examples
import system.date
from java.util import Date
# Get the record for today's midnight hour boundary
location = "Enterprise/Site/Line1"
midnight = system.date.midnight(Date())
record = system.mes.oee.getCalculationRecordByLocationAndPeriodStart(location, "DAY", midnight)
if record is not None:
print "OEE for today:", record['oee']
else:
print "No record found for this period"