# MQTT Engine - JsonPayloadHandler NULL Values

**URL:** <https://forum.cirrus-link.com/t/mqtt-engine-jsonpayloadhandler-null-values/317>\
**Category:** MQTT Modules\
**Tags:** mqtt-engine\
**Created:** [March 13, 2023, 12:54pm UTC](https://forum.cirrus-link.com/t/mqtt-engine-jsonpayloadhandler-null-values/317 "2023-03-13T12:54:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ylamay](https://avatars.discourse-cdn.com/v4/letter/y/e99b99/32.png) [@ylamay](https://forum.cirrus-link.com/u/ylamay)\
**Post date:** [March 13, 2023, 12:54pm UTC](https://forum.cirrus-link.com/t/mqtt-engine-jsonpayloadhandler-null-values/317/1 "2023-03-13T12:54:22Z")

</div>

Hi. I was configuring a new connection within MQTT Engine (Version 4.0.8) along with a custom namespace that had the option [Parse payload as JSON] enabled. When I do, I receive error logs from the JsonPayloadHandler logger that contains “JSON value for is NULL” and then it fails to handle adding tags for that specific topic. When I disable the parsing option, it generates all tags it has subscribed to. Most of the values within the payload are not null.

 ![jsonpayloaderror_cleansed](https://canada1.discourse-cdn.com/flex028/uploads/cirrus_link/original/1X/098cf0413fbc95d87372d4de5c3a7c7307614a25.jpeg)

Does MQTT Engine not consider NULL values to be valid when generating tags even if the key is valid?

If so, is there a way to handle generating tags with NULL values within a configuration I’m missing? I’m assuming if not, then I just have to disable the JSON Parsing option to continue handling these messages.

---

<div class="post-metadata">

**Author:** ![wes.johnson](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@wes.johnson](https://forum.cirrus-link.com/u/wes.johnson)\
**Post date:** [March 13, 2023, 2:34pm UTC](https://forum.cirrus-link.com/t/mqtt-engine-jsonpayloadhandler-null-values/317/2 "2023-03-13T14:34:24Z")

</div>

The JSON parser in MQTT Engine for custom namespaces can’t handle null values because it doesn’t know what tag datatype to create based on that ‘value’. The parser uses the value to determine the datatype to create for the tag. If it is null, it is unable to do so.

---

<div class="post-metadata">

**Author:** ![ylamay](https://avatars.discourse-cdn.com/v4/letter/y/e99b99/32.png) [@ylamay](https://forum.cirrus-link.com/u/ylamay)\
**Post date:** [March 13, 2023, 2:50pm UTC](https://forum.cirrus-link.com/t/mqtt-engine-jsonpayloadhandler-null-values/317/3 "2023-03-13T14:50:12Z")

</div>

Thanks for the quick response! This makes sense and answers my question.

---

<div class="post-metadata">

**Author:** ![michael.edmonson](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@michael.edmonson](https://forum.cirrus-link.com/u/michael.edmonson)\
**Post date:** [January 22, 2025, 6:16pm UTC](https://forum.cirrus-link.com/t/mqtt-engine-jsonpayloadhandler-null-values/317/4 "2025-01-22T18:16:41Z")

</div>

Wes, is there any update to the engine module to handle this Null error in a later version? Any idea?

---

<div class="post-metadata">

**Author:** ![wes.johnson](https://avatars.discourse-cdn.com/v4/letter/w/f14d63/32.png) [@wes.johnson](https://forum.cirrus-link.com/u/wes.johnson)\
**Post date:** [January 22, 2025, 8:01pm UTC](https://forum.cirrus-link.com/t/mqtt-engine-jsonpayloadhandler-null-values/317/5 "2025-01-22T20:01:46Z")

</div>

The latest version of Engine (4.0.26) does support null values if the tag has already been created. But, it still won’t for new tags for the reasons stated above.
