Skip to main content

system.mes.oee.calculateOeeByTimeInterval

Calculates OEE metrics broken down by time intervals for a specific location within a date range.

Permissions

This method requires the OEE.READ.CALCULATE permission.

Syntax

# Basic calculation with positional parameters
system.mes.oee.calculateOeeByTimeInterval(locationIdOrPath, startDate, endDate, interval, intervalTimeUnits=None)

# Extended calculation with keyword arguments
system.mes.oee.calculateOeeByTimeInterval(
locationIdOrPath=location,
startDate=start,
endDate=end,
interval=intervalValue,
intervalTimeUnits=timeUnits,
unitOfMeasureName=unit
)

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe ULID or path of the location to calculate OEE for.
startDateDateFalseThe start date for the calculation period.
endDateDateFalseThe end date for the calculation period.
intervalIntegerFalseThe time interval value for breaking down the calculations.
intervalTimeUnitsStringTrueTime units for interval ("MINUTES", "HOURS", "DAYS"). Default: "MINUTES"
unitOfMeasureNameStringTrueThe unit of measure name for production calculations (keyword only).

Returns

Returns a list of JSON objects representing OeeResultsDTO objects for each time interval.

Each object has the following properties:

NameTypeNullableDescriptionDefault Value
locationIdStringFalseIdentifier of the associated location where this OEE production record was capturednull
locationPathStringTruePath of the location where this OEE production record was capturednull
startDateInstantFalseStart date and time of the OEE production recordInstant.now()
endDateInstantTrueEnd date and time of the OEE production recordnull
totalDurationSecDoubleFalseTotal duration of the OEE production record in seconds0.0
scheduledDurationSecDoubleFalseDuration in seconds that the machine was scheduled to run during this record period0.0
scheduledProductionModeEventCountIntegerFalseTotal number of scheduled production mode events during this record period0
scheduledDowntimeDurationSecDoubleFalseDuration in seconds that the machine was scheduled to be in downtime during this record period0.0
scheduledDowntimeModeEventCountIntegerFalseTotal number of scheduled downtime mode events during this record period0
unscheduledDowntimeDurationSecDoubleFalseDuration in seconds that the machine was in unscheduled downtime during this record period0.0
unscheduledDowntimeEventCountIntegerFalseTotal number of unscheduled downtime mode events during this record period0
runningDurationSecDoubleFalseDuration in seconds that the machine was actively running during this record period0.0
runningStateEventCountIntegerFalseTotal number of running state events during this record period0
blockedDurationSecDoubleFalseDuration in seconds that the machine was in BLOCKED state during this record period0.0
blockedStateEventCountIntegerFalseTotal number of blocked state events during this record period0
starvedDurationSecDoubleFalseDuration in seconds that the machine was in STARVED state during this record period0.0
starvedStateEventCountIntegerFalseTotal number of starved state events during this record period0
idleDurationSecDoubleFalseDuration in seconds that the machine was in IDLE state during this record period0.0
idleStateEventCountIntegerFalseTotal number of idle state events during this record period0
downtimeDurationSecDoubleFalseDuration in seconds that the machine was in DOWNTIME state during this record period0.0
downtimeStateEventCountIntegerFalseTotal number of downtime state events during this record period0
productionCountDoubleFalseTotal number of units produced during this record period0.0
expectedProductionCountDoubleFalseExpected number of units to be produced during this record period0.0
averageStandardRateDoubleFalseAverage Standard Rate for the time period. Calculated as per minute0.0
maximumStandardRateDoubleFalseMaximum Standard Rate for the time period. Calculated as per minute0.0
wasteCountDoubleFalseTotal number of waste units recorded during this period0.0
goodCountDoubleFalseTotal number of good units recorded during this period0.0
productionCountUnitOfMeasureIdStringTrueIdentifier of the unit of measure for the production countnull
productionCountUnitOfMeasureNameStringTrueName of the unit of measure for the production countnull
productionCountUnitOfMeasureSymbolStringTrueSymbol of the unit of measure for the production countnull
availabilityDoubleTrueAvailability metric (0.0 to 1.0)1.0
teepDoubleTrueTotal Effective Equipment Performance (TEEP) metric (0.0 to 1.0)1.0
performanceDoubleTruePerformance metric (0.0 to 1.0)1.0
qualityDoubleTrueQuality metric (0.0 to 1.0)1.0
oeeDoubleTrueOverall Equipment Effectiveness (OEE) metric (0.0 to 1.0)1.0

Code Examples

from java.util import Date
import system.date

# Calculate hourly OEE for the last 8 hours
locationPath = "Enterprise/Site/Area/Line1"
endDate = Date()
startDate = system.date.addHours(end_date, -8)

hourly_oee = system.mes.oee.calculateOeeByTimeInterval(
locationPath,
startDate,
endDate,
1,
"HOURS"
)

print "Hourly OEE Results:"
for interval in hourly_oee:
startTime = interval.get('startTime')
endTime = interval.get('endTime')
oeePct = interval.get('oeePercentage', 0)
print "Hour {} - {}: {}% OEE".format(startTime, endTime, oeePct)