A message handler custom function can be added through a device instance in the end application.
To add a message handler through a device,
Access the End Application.
Select Devices > Devices in the left pane. Click on the name of the device for which you want to add the message handler. This opens the device's information page. For this illustration, My Rpi device is selected. Click Actions > Message Formatter and Handler. Click the Edit Message Handler button. Click Choose Custom Function.
Click Add Custom Function.
Note: You also have the option to select from previously created message handler custom functions if needed. Provide the details in the appropriate fields and click Save and Associate. This will open the custom function editor. For this illustration, a message handler custom function called My custom message handler is created.
Learn more about the
fields involved in creating a message handler custom function.
Provide the required message handler custom function, in the Deluge scripting language.
Click Save and Associate to save the custom function and exit the editor. Click Save. The custom function will now be associated with the selected device instance.
Message Handler Settings
When creating or editing a message handler custom function through a device instance, you will encounter the following options:
Handler Setting
Customization Mode:
Model: Selecting this option enables the use of the message handler custom function associated with the device model that the device instance is based on. It also allows you to edit the message handler for the model. Any changes made to the custom function will apply to all instances of the model with model customization.
Instance: Selecting this assigns a message handler function exclusively to the specific instance. This means any messages received for this instance will be handled by the assigned custom function, overriding the one defined in the model.
Message Handler: Here, you can modify the message handler custom function assigned to the device instance or create and assign a new one.
Execution Settings
Status: This setting determines whether the message handler must be executed for this specific device instance.
Continue on Failure: Allows the system to proceed with subsequent processing in other layers, bypassing the current handler, even if the selected message handler encounters an execution failure.
Connection Update: Configures message handling processes to be executed specifically when a device using MQTT device connectivity connects or disconnects.
See Also