# Multiple sensors with different payload decoding TTN

**URL:** <https://www.thethingsnetwork.org/forum/t/multiple-sensors-with-different-payload-decoding-ttn/30351>\
**Category:** v2 Backend\
**Created:** [September 30, 2019, 3:11am UTC](https://www.thethingsnetwork.org/forum/t/multiple-sensors-with-different-payload-decoding-ttn/30351 "2019-09-30T03:11:55Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [November 23, 2019, 12:24pm UTC](https://www.thethingsnetwork.org/forum/t/multiple-sensors-with-different-payload-decoding-ttn/30351/7 "2019-11-23T12:24:25Z")

</div>

See also [How to best write an application that contains many nodes with different measure data types](https://www.thethingsnetwork.org/forum/t/how-to-best-write-an-application-that-contains-many-nodes-with-different-measure-data-types/6916) (also explaining how to set the port number in some libraries, or how to use the DevEUI which is not available in a Payload Format, but is exposed by other APIs).

And some examples:

- [A Decoder for the Zane Ztrack](https://www.thethingsnetwork.org/forum/t/a-decoder-for-the-zane-ztrack/15226), using the LoRaWAN port number, hence adding no extra overhead.

- [ESP32-Paxcounter](https://github.com/cyberman54/ESP32-Paxcounter#payload-format), using both the LoRaWAN port number and the message length for fixed-order but variable-length payloads, adding no extra overhead.

- [Nemeus NIS-UL – Ultrasonic sensor](https://www.thethingsnetwork.org/forum/t/nemeus-nis-ul-ultrasonic-sensor/14770/11), using a single byte as a bit mask to describe what sensor values are in the variable-length but fixed-order payload, and another byte to define the number of reported measurements per sensor.

- [Elsys payload](https://www.elsys.se/en/elsys-payload/) for their own devices, adding 1 byte of overhead _per value_ for a variable-length payload, but requiring a fixed-order if multiple sensors are of the same type.

- [Cayenne Low Power Payload](https://mydevices.com/cayenne/docs/#lora-cayenne-low-power-payload) (as mentioned above, and supported in [the TTN Arduino library](https://www.thethingsnetwork.org/docs/devices/arduino/api/cayennelpp.html) and [the myDevices integration](https://www.thethingsnetwork.org/docs/applications/cayenne/)), adding 2 bytes of overhead _per value_, but allowing for multiple sensors of the same type in a variable-length payload.

- [How to decode Elvaco CMi4110 standard M-Bus payload?](https://www.thethingsnetwork.org/forum/t/how-to-decode-elvaco-cmi4110-standard-m-bus-payload/31747), adding 2 bytes of overhead _per value_, using some sort of standard “M-Bus encoding”.

- CBOR, like as supported by the [AllThingsTalk integration](https://www.thethingsnetwork.org/docs/applications/att/#send-data-from-ttn-console-and-receive-it-in-maker), but adding _a lot_ of overhead despite being advertised as suitable for LoRaWAN.

Beware that some standards, such as Cayenne LPP, have a fixed list of supported types, which might not fully match one’s use case.

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/multiple-sensors-with-different-payload-decoding-ttn/30351)._
