Back

Topic

[KB1137]How to filter Null value coming from MQTT device

Tags: MQTT, SV Manager Toolkit, Svmgr

4 years ago
By FABO
Options
Print
Applies to:

PcVue 15 onwards


Summary:

This article will show you how to use filter if you don’t want to take into account a “Null” value in a MQTT payload.


Details:

Let us imagine a simple situation. PcVue receives values like temperature in a MQTT topic.

The device sends 22 in the Json Key temperature of a MQTT topic. PcVue displays 22 in the register.

 JsonMqtt Value tempvalue Mqtt 22

The device sends null in the temperature of a MQTT topic. With a MQTT filter expression you can dismiss this Null value if you wish. PcVue will then still display the last value with the last timestamp. The null value will not be taken into account thanks to the filter expression.

Null value Mqtt 22

  The null is consided like an empty string. So use the following filter expression to prevent the null value: StrLen(JsonGetValue(value,temperature))>0

Config TATT

                                                                      

 

 


Created on: 21 Oct 2021 Last update: 30 May 2024