Skip to main content

system.mes.oee.getState

Description

Retrieves a specific OEE state definition by its unique ID.

Permissions

This method requires the OEE.READ.GET permission.

Syntax

system.mes.oee.getState(id)

Parameters

ParameterTypeNullableDescription
idStringFalseThe unique ID of the OEE state.

Returns

A JSON representation of an OeeStateDTO object representing the requested OEE state.

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Statenull
locationIdStringFalseIdentifier of the associated locationnull
locationPathStringTruePath of the associated locationnull
codeIntegerFalseInteger state number, which must be unique for a given locationnull
nameStringFalseName of the statenull
calculationTypeOeeStateCalculationTypeFalseSpecifies how this state contributes to OEE calculationsDOWNTIME
colorStringFalseHex color code representing the state visually"#000000"
autoAcknowledgeBooleanFalseWhether to automatically acknowledge the state record when it is createdfalse
interruptionLocationIdStringTrueImmediate interruption location that caused a blocked/starved statenull
interruptionLocationPathStringTruePath to the location that caused a blocked/starved statenull
maxRootCauseDelaySecondsIntegerTrueMaximum delay in seconds for looking back at historical state records when resolving root cause for blocked/starved states0
notesStringTrueNotes associated with the OEE Statenull
enabledbooleanTrueIndicates whether the OEE State is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Code Examples

# Retrieve an OEE state by its ID
stateId = "01JCH3ENEB-SV2X8B3W-NFY8WZNK"

try:
oeeState = system.mes.oee.getState(stateId)
if oeeState:
print "State Name:", oeeState['name']
print "State Type:", oeeState['calculationType']
print "Color:", oeeState['color']
except:
print "OEE State with ID '{}' not found.".format(stateId)