Skip to main content

system.kanoa.event.getAssetStateEventsByInterval

This function requires KanoaOPS module

Description

Returns state data filtered by the given parameters

Syntax

getAssetStateEventsByInterval(paramsDict)
  • Parameters
      paramsDict (dict)
      - 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
      - showDowntimeOnly (bool)
      - interval (string) - i.e 'Hour', 'Day', 'Week', None - If None, interval will be auto calculated
      - deviceUTCOffsetMins (int): Timezone offset for the client
  • Returns
    data (pyDataset).
  • Code Example

    # Example Usage:
    startDate = system.date.parse("2025-05-01 00:00:00")
    endDate= system.date.now()
    data = system.kanoa.event.getAssetStateEventsByInterval({'assetId': 510, 'startDate': startDate, 'endDate': endDate})
    print system.kanoa.utilities.convertDatasetToJSON(data)
    >
    {
    'Mix Line 1 - Running': 838.999998,
    'Mix Line 1 - Out of infeed material': None,
    'Mix Line 1 - Not enough personnel': None,
    'Mix Line 1 - CIP': 141.0,
    'Mix Line 1 - Quality Hold': 57.016666,
    'interval': '05-01',
    'Mix Line 1 - Safety': 42.016666
    }


    >>>