bellrichm / WeeWX-MQTTSubscribe

A WeeWX service and driver that receives data from MQTT.
GNU General Public License v3.0
52 stars 13 forks source link

Parse more complex json messages #187

Closed bellrichm closed 10 months ago

bellrichm commented 10 months ago

Here is an example. Is is nested, has an array, and we only messages with a measurementId of 4100.

{"applicationID":"34",
  "applicationName":"S2103-CO2",
  "deviceName":"S2103",
  "deviceProfileName":"S2103-CO2",
  "deviceProfileID":"dc956d2b-771e-44cc-b87f-3559f8c647c3",
  "devEUI":"2cf7f1c044300464",
  "txInfo":
    {"frequency":903900000,
      "dr":0},
  "adr":true,
  "fCnt":726,
  "fPort":2,
  "data":"AQQQOCAHACDc",
  "object":
    {"data":
      {"err":0,
        "messages":
          [{"measurementId":4100,
            "measurementValue":467,
            "type":"report_telemetry"}],
        "payload":"0104103820070020DC",
        "valid":true}}}
bellrichm commented 10 months ago

See, https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki/json-example#complex-json

bellrichm commented 10 months ago

Completed in 2.3.0