How to add static parameters into the message?

Using plugins to add new fields into the device messages.

The "item-fields" plugin type is used to add static fields to the designated devices and/or to store custom data associated with the device and reference it in REST API calls.

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 for devices that will add a customer_id field that is a positive integer and a required field:

add new plugin add message field type

Note: by default, the plugin fields will be added and stored in the message and telemetry (edit the "store" setting to change that behavior).

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 field in the new device messages. Go to the Logs & Messages tab for the given device to check:

field added to message in logs

Done.

New! Independently of the "store" configuration option value, you may now reference plugin fields values to address a specific device in REST API calls, for example GET /gw/devices/plugins.fields.customer_id=12345/messages to fetch its messages. 

Change log

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

More plugin types

Find a comprehensive list of available plugins types here.


See also
Explore the pros and cons of various reverse geocoding services supported by flespi.
Getting plain parameters’ values from array-structured ‘ble.beacons’ parameters