We have created the pipe-cache-params protocol.
The channel with this protocol will receive messages from other flespi channels, cache the specified message parameters and adds them to all the subsequent messages if missing.
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:
- list of the channel id's with source messages
- the token with ACL to the source channel messages
- 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.
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 for any reason will clear the cache with all listed parameter values. After channel start, the cache will be filled from scratch with the new messages.
See here for more details: https://flespi.com/blog/fill-in-the-gaps-in-telemetry-data-via-flespi-pipe