How to cancel device message registration

Using plugins to silently cancel device message registration.

The 'msg-cancel' plugin type is utilized to prevent the registration of messages into the device. This can be effectively employed to eliminate privacy-sensitive data, messages that fall outside of business hours or prevent registration of any other undesired message. 

Specify in the validate_message field the correct expression to ensure that the plugin is applied only to specific messages. If nothing is specified in that field plugin will prevent registration of all device messages.

Keep in mind that the plugin does not affect the registration of messages to the channel storage where you can always find messages before they are modified by plugins. Also, for each cancelled message the plugin publishes the corresponding event into its logs.

How to use

Click on the '+' button in the Telematics Hub > Plugins section to create a new plugin:

Name the plugin and check 'enabled' to activate it. In the 'validate_message' field set up a rule with a logical expression. For example, if you need to drop any message sent after 18:00 and go on with receiving them after 8:00, use the following syntax: hour(timestamp) < 8 || hour(timestamp) >= 18

Important: as long as you're dealing with time make sure to select a proper timezone in the plugin dialog box.

Then we need to assign this plugin to the right devices. Go to the Devices tab for the required device and click the "+" button for a list of available plugins:

Once the plugin is applied to the device it cancels registration into device storage for each message that conforms to "validate_message" expression. All canceled messages are individually published into the plugin log for diagnostics purposes.

Done!

Change log

Subscribe to the msg-cancel plugin change log to stay in sync with any updates.

More plugin types

Find a comprehensive list of available plugins types here.


See also
Getting plain parameters’ values from array-structured ‘ble.beacons’ parameters