system.kanoa.event.getAssetStateEventsByShift(paramsDict)
Returns state event data filtered by the given parameters and grouped by shift
Parameters
paramsDict Dictionary
| - assetId | Integer | |
| - durationSecs | Integer | Filter downtime events for event greater than this value |
| - endDate | DateTime | |
| - showChanged | Boolean | Filter downtime events that have been modified |
| - showDowntimeOnly | Boolean | |
| - startDate | DateTime |
Returns
stateEventData pyDataset
Example
startDate = system.date.parse("2025-11-01 00:00:00")
endDate = system.date.parse("2025-11-05 00:00:00")
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
}
>>>