Not possible; you only get the decoded application payload and the port number, and cannot preserve any state. It’s also not possible in the Decoder function.
See also:
- Access to previous data in Payload format
- How can i do a condition using two uplink messages?
- Access Metadata in decoder
- Payload Formats [HowTo] - #3 by arjanvanb
So, you’ll need to keep state on your application server, or use some third-party server. For Node-RED see Working with context. For Pipedream, see $checkpoint
in Workflow state.
And beware: