Pipe-cache-params protocol

Integration level: params
Channel with this protocol will consume messages from other channels, store the last values of specified parameters and add them into new messages if missing.
flespi parses the Pipe-cache-params protocol messages into a JSON object with the fields listed below in the Parameters tab.
channel.id
number
ID of channel that received a message
custom
Any custom parameter
device.id
number
ID of device that received a message
device.name
string
Name of device that received a message
device.type.id
number
ID of device type of device that received a message
ident
string
Device unique identificator and optional password
protocol.id
number
ID of protocol
server.timestamp
number
seconds
Timestamp when server received a message
timestamp
number
seconds
Message timestamp

Protocol by Gurtam that receives messages from other flespi channels, caches the specified message parameters and adds them to all the subsequent messages if missing. Please read special article about protocol usage in our blog.

Usually, the protocol helps when your tracking devices send some messages with the position data but some without. To solve this issue you may create a pipe-cache-params channel and add "position.latitude" and "position.longitude" to the list of parameters to cache in its configuration. The channel may cache any parameter, not only position but, for example, any sensor value.

To make it work you have to fill the channel configuration:

  1. list of the channel id's with source messages
  2. the token with ACL to the source channel messages
  3. the list of parameters you want to cache.

After that, the new pipe-cache-params channel will subscribe to the messages from the source channels. It will copy each new message from the source channels and add the missing parameters you have listed using the last value from the cache.

If you also set the "Generate messages only when ALL listed parameters are cached" option, the platform will skip all source messages until all listed parameters reappear in the cache.

If you enable "Add cached value ignoring timestamp" switch then cached values will be added to all new coming messages disregarding timestamp. NOTE! Messages with older timestamp may have cached parameter values from future messages which may lead to data corruption on receiving side!

IMPORTANT! If the cache is cleared either because it expires or our servers are rebooted, all listed parameters in it will be lost. Consequently, newly received messages will be discarded until ALL listed parameters are cached again.

You may control how long the channel will preserve the cache for the listed parameters using the "Cache expiry interval" parameter.

Please note that stopping the channel will clear the cache with all listed parameter values. After channel start, the cache will be filled from scratch with the new messages.