MxMQTT and how to parse a metric from a JSON-line

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
mojavan
Posts: 2
Joined: 06 Jul 2022 00:18

MxMQTT and how to parse a metric from a JSON-line

Post by mojavan »

Hi,

I'm struggling with getting MxMQTT to read/show the separate values being sent from a Mi Flora sensor via a broker.

This is the text that is sent to the topic if listening with mosquitto_sub:

Code: Select all

Client received PUBLISH (d0, q0, r0, m0, 'miflora/villav-Mi_Flora', ... (85 bytes))
{"light": 245, "temperature": 23.2, "moisture": 6, "conductivity": 0, "battery": 100}
How do I get MxMQTT to catch the moisture-value?
  • MxMQTT is connected to the topic and is receiving
  • Reading from Multiline device says "[object Object]⋯ ".
  • I'm suspecting that it's "the Displayed Value (Level)"-field under "Create Virtual Devices for Single Topics" that's the culprit?
I'm planning to set up an if-then to trigger opening a Zipato GR105-valve for some watering in case of too low humidity. :|
Using this handy solution: https://github.com/ThomDietrich/miflora-mqtt-daemon

Yours
moj
piet66
Posts: 266
Joined: 04 Feb 2017 17:00

Re: MxMQTT and how to parse a metric from a JSON-line

Post by piet66 »

MxMQTT Subscriber only accepts one value per topic.

If you want to extract only the moisture you can try with
Object Keys = moisture
(':lc:ack:ts' you can omit, if your object doesn't contain such data)
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me ZW0700 7.20.00 07.38/1766938484 1025/257
Z-Way version v3.2.3 from 2022-04-06 04:56:23 +0300
mojavan
Posts: 2
Joined: 06 Jul 2022 00:18

Re: MxMQTT and how to parse a metric from a JSON-line

Post by mojavan »

That worked brilliantly.

Image

It was all a matter of understanding how the Object Keys-field was supposed to work.

Image

One suggestion for future updates might be to expand the help text/instructions regarding the formatting of this field, maybe with some examples.

Anyhow, thanks alot! :)
Post Reply