ditto icon indicating copy to clipboard operation
ditto copied to clipboard

Retrieving the state of a thing in a Javascript incoming payload mapper

Open pedro-nicolau-carvalho opened this issue 7 months ago • 0 comments

When working with IoT devices, sometimes we need to compute things that are not immediately available on the incoming payload. For example:

  • A device connects to an MQTT broker, and publishes its sampling rate
  • In subsequent messages, the device only sends a counter and a value

To calculate the timestamp of a message, we would need the registration time and the sampling rate. Is this possible using a javascript incoming payload mapper? I guess it is possible by publishing the entire state of the device to mqtt and reading it again, but this seems redundant.

Thank you.

pedro-nicolau-carvalho avatar Jun 26 '24 17:06 pedro-nicolau-carvalho