system.kanoa.event.getAssetStateEventsByShift
Description
Returns state event data filtered by the given parameters and grouped by shiftSyntax
getAssetStateEventsByShift(paramsDict)Parameters:
Returns:
Dictionary
Parameter | Type | Required | Notes |
---|---|---|---|
assetId | int | ||
startDate | datetime | ||
endDate | datetime | ||
durationSecs | int | Filter downtime events for event greater than this value | |
showChanged | bool | Filter downtime events that have been modified | |
downtimeOnly | bool |
Code Examples
# Example Usage:
startDate = system.date.parse("2025-05-01 00:00:00")
endDate= system.date.now()
data = system.kanoa.event.getAssetStateEventsByShift({'assetId': 510, 'startDate': startDate, 'endDate': endDate})
print system.kanoa.utilities.convertDatasetToJSON(data)
>
{
'stateDurationMins': 0.0,
'note': None,
'shiftId': 362,
'stateEventId': 28490060,
'stateTypeId': 3,
'endDate': 2025-05-01 00:00:00.0,
'origStateCode': None,
'stateTypeName': 'Running',
'assetStateId': 510,
'stateDurationSecs': 0,
'stateColor': None,
'stateCategoryName': 'Running',
'shiftName': '2nd Shift',
'origAssetId': None,
'stateName': 'Running',
'assetId': 510,
'assetPath': 'Kanoa Industries\\Buffalo Bakery\\Production\\Mix Line 1',
'assetName': 'Mix Line 1',
'stateCode': 1,
'stateTypeColor': '#00639a',
'startDate': 2025-05-01 00:00:00.0
}
>>>