How to add calculated parameters into the message?

Using plugins to add new fields into the device messages based on the expression evaluation.

The "msg-expression" plugin type is used to add a new message parameter with the value calculated in the specified expression.

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

flespi panel telematics hub plugins

Let's define a new plugin that will calculate the current speed in mph and add it to the speed.mph message parameter:

add plugin of message expression type

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

assign plugin to flespi device

And then you should be able to see the new calculated field in the new device messages. Go to the Logs & Messages tab for the given device to check:

calculated field in device messages

Done.

Advanced note: replacing existing parameters

If you specify the name of the existing message parameter (e.g. position.altitude) as the plugin field name, the respective original message parameter will be replaced by the value from the plugin:

add plugin to replace existing parameters

Change log

Subscribe to the expressions plugin change log to stay in sync with any updates.

More plugin types

Find a comprehensive list of available plugin types here.


See also
Using a webhook plugin to make requests to the script on your custom server to modify messages.