Skip to main content

system.kanoa.event.addStateEvent(stateInfo, userId)

Adds a stateEvent record. All stateInfo keys are required.


Parameters

stateInfo Dictionary

- assetIdInteger
- assetStateIdIntegerCan set this to a sub asset if asset is down due to a downtime fault on a child cell otherwise set to assetId
- noteString
- stateCodeInteger
- tStampString

userId Integer: Id of user executing the function


Returns

stateEventId Dictionary


Example

stateInfo = {'assetId': 18, 'assetStateId': 18, 'stateCode': 1, 'tStamp': system.date.now(), 'note': None}
userId = 123
stateInfo = system.kanoa.event.addStateEvent(stateInfo, userId)