How to merge parameters from the message with the same timestamp?

Using plugins to merge specific parameters from the stored message with the same timestamp.

Sometimes this is convenient to restore message parameters from the database before registering a new message. The "msg-merge" plugin type is used exactly for this - to restore specified (or all) parameters from the existent device message with the same timestamp, if it is available.

Initially it was developed to restore message parameters for messages with media (photo and video) before registering new media data because messages with links to video clips or photo images are usually the result of media data retrieval command and their flow is out of band. With this plugin such media messages (and events about them to to MQTT subscribers or streams) are enriched with device telemetry already available for given timestamp.

How to use

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

In the window that appears, enter the name of the plugin in the Name field. In the Type ID field, select msg-merge. In the Configuration -> Fields section, enter the names of the parameters that will be merged (you can use wildcards for naming). If you leave the Fields section empty, all message parameters will be merged.

Then we need to assign this plugin to the right devices. Go to the Plugins tab for the required device and click the "+" button:

Let's go to Logs&Messages tab and check how the plugin processed the message, first message has position parameters:

Next message has the same timestamp and param1 parameter, position parameters were merged from the previous message by the plugin:

Done.

Change log

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

More plugin types

Find a comprehensive list of available plugins types here.


See also
Using plugins to replicate device messages.