What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Feedback about MQTT-Sensors

Votes:

0

Hello Paessler, Some feedback about the MQTT_Sensors.

Cosmetic Question: MQTT Roundtrip-Sensor: It looks like the Sensor is changing the Topic sometimes. Is this some obfusation, that no other MQTT-Device can hijack that and disturb the sensor?.

Understanding of MQTT Custom Subscribe Sensor: I have a BTLE2MQTT-Gateway sending BTLE Beacons as MQTT-Message to mosquitto with temperature and humidity. (See https://www.msxfaq.de/sonst/iot/mi_sensor_mit_btle_gateway.htm). The problem here is, that the Gateway is sending multiple JSON-Messages with different content. The output of "mosquitto_sub -h 192.168.178.10 -t tele/tasmota_156324/SENSOR " looks like

{"Time":"2021-10-04T16:05:03","ATC18fb56":{"mac":"a4c13818fb56","Temperature":23.7,"Humidity":46.0,"DewPoint":11.4,"Battery":83,"RSSI":-71}}
{"Time":"2021-10-04T16:05:15","ESP32":{"Temperature":44.4},"TempUnit":"C"}
{"Time":"2021-10-04T16:10:03","ATC18fb56":{"mac":"a4c13818fb56","Temperature":23.7,"Humidity":46.0,"DewPoint":11.4,"Battery":83,"RSSI":-65}}
{"Time":"2021-10-04T16:10:15","ESP32":{"Temperature":44.4},"TempUnit":"C"}
{"Time":"2021-10-04T16:15:03","ATC18fb56":{"mac":"a4c13818fb56","Temperature":23.7,"Humidity":46.0,"DewPoint":11.4,"Battery":83,"RSSI":-61}}
{"Time":"2021-10-04T16:15:15","ESP32":{"Temperature":45.0},"TempUnit":"C"}

I Created a sensor with the folowing data

Topic               : tele/tasmota_156324/SENSOR
Channel #1 JSONPath : $.ATC18fb56.Temperature

And the Debug Trace looks like

2021-09-30 19:45:23.668365 DEBG TId   41676 Result of Sensor 2216> MQTT Client - PRTG_F7D14: Message received on topic: tele/tasmota_156324/SENSOR
2021-09-30 19:45:23.668365 DEBG TId   41676 Result of Sensor 2216> Received on topic "tele/tasmota_156324/SENSOR" with payload bytes: 140 and payload:
{"Time":"2021-09-30T20:45:22","ATC18fb56":{"mac":"a4c13818fb56","Temperature":23.4,"Humidity":47.0,"DewPoint":11.4,"Battery":83,"RSSI":-66}}
2021-09-30 19:45:37.697615 DEBG TId   41676 Result of Sensor 2216> MQTT Client - PRTG_F7D14: Message received on topic: tele/tasmota_156324/SENSOR
2021-09-30 19:45:37.697615 DEBG TId   41676 Result of Sensor 2216> Received on topic "tele/tasmota_156324/SENSOR" with payload bytes: 74 and payload:
{"Time":"2021-09-30T20:45:36","ESP32":{"Temperature":53.3},"TempUnit":"C"}
2021-09-30 19:46:09.015979 DEBG TId   20184 Result of Sensor 2216> #################### Enter sensor scan ####################
2021-09-30 19:46:09.015979 DEBG TId   20184 Result of Sensor 2216> Working with message: {"Time":"2021-09-30T20:45:36","ESP32":{"Temperature":53.3},"TempUnit":"C"}
2021-09-30 19:46:09.016978 DEBG TId   20184 Result of Sensor 2216> Processing channel 1 with json path: $.ATC18fb56.Temperature
2021-09-30 19:46:09.016978 DEBG TId   20184 Result of Sensor 2216> Error while processing channel #1 with json path: $.ATC18fb56.Temperature: The queried field is empty. Internal Message: $.ATC18fb56.Temperature

It looks like the sensor is not processing every message in realtime. it looks it collects the messages and parses the last message every interval. Thats my guess. Do you have some more details, how the "backend" is working? MQTT is "push" and not pull (if the pusblisher is not using retained messages) and PRTG collects values in intervals. How does that match together?

custom iot mqtt subscriber

Created on Oct 4, 2021 3:40:44 PM

Last change on Oct 5, 2021 4:17:45 AM by  Felix Wiesneth [Paessler Support]



1 Reply

Votes:

0

Hello Frank,

Thank you for your message.

I have asked confirmation to our development team and will update my response accordingly if modification are necessary.

For the MQTT Round Trip sensor, the topic should stay the same as long as the configuration in PRTG do not change. For example, if the sensor is paused, resumed or the probe is restarted the topic will change as illustrated below:

Topic changed

Regarding the MQTT Subscribe sensor, the values are indeed collected and only the latest is displayed in PRTG within an interval (30 seconds at lowest). This is due to the implementation of the sensor and I'm afraid that it can't be changed. By default, the scanning interval is configure to 30 seconds minimum which should be enough for most of cases, however I invite you to open a feature request by following our guideline for lower intervals.

Regards.

Created on Oct 7, 2021 12:43:27 PM by  Florian Lesage [Paessler Support]

Last change on Oct 8, 2021 1:56:15 PM by  Florian Lesage [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.