Hello,
With reference to Alarm Event properties, I try to access some properties in notification pipeline script block. (def handleAlarm(event))
https://docs.inductiveautomation.com/display/DOC80/Alarm+Event+Properties+Reference
But I always get this error:
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 2, in handleAlarm TypeError: publish(): 3rd arg can't be coerced to byte
at org.python.core.Py.TypeError(Py.java:265)
at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:211)
at org.python.core.PyReflectedFunction.throwBadArgError(PyReflectedFunction.java:314)
at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:323)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:169)
I need to access these properties of current alarm to make my message packet.
def handleAlarm(event):
"""
Called for each alarm event that passes through the block. To cancel the
event, call "event.cancelNotification()". Note: The event received is
actually an "event instance", and properties set on it are only local to the
event while it is in the pipeline. To set properties that persist between
changes in state, use "event.setGlobal(name, value)".Arguments:
event: The alarm event instance. Properties can be accessed, set, and
created using dictionary syntax.
"""
system.cirruslink.engine.publish('MyHome','Alert', event.EventValue ,1,0)