Harry-Chen / qingping-mqtt-interceptor

Parse data from MQTT traffic of Qingping Air Monitor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Qingping MQTT Interceptor

Note: This is a toy project, please use qingping-api-influxdb-forwarder instead.

Tool to parse data from MQTT traffic of Qingping Air Monitor, and print in InfluxDB line protocol.

There are several ways to get data from the monitor:

  1. The monitor publishes data via (clear text) MQTT. However the interval (normally 15 minutes) cannot be controlled by user.
  2. Poll HTTP API (used by Qingping+ App) to fetch the latest data. However it requires HTTPS MITM.
  3. Connect the monitor to MIJIA and use miIO protocol to access the device.

If you can control the network, intercepting MQTT traffic should be the easiest way.

Usage

First install libpcap, then run:

cargo install --git https://github.com/Harry-Chen/qingping-mqtt-interceptor.git
sudo env PCAP_INTERFACE="br-lan" PCAP_FILTER="port 11883" MEASUREMENT="qingping" qingping-mqtt-interceptor

Note: during the initilization of tVOC sensor, no data will be provided.

About

Parse data from MQTT traffic of Qingping Air Monitor

License:MIT License


Languages

Language:Rust 100.0%