daq-tools / kotori

A flexible data historian based on InfluxDB, Grafana, MQTT, and more. Free, open, simple.
https://getkotori.org/
GNU Affero General Public License v3.0
110 stars 17 forks source link

Acquire bulk readings in compact JSON format #41

Open amotl opened 3 years ago

amotl commented 3 years ago

Coming from #39 and building upon #40, this implements the acquisition of bulk readings in compact JSON format as needed by @valentinbarral. The "compact JSON" format is currently defined with timestamps as keys.

An example payload is:

{
  "1611082554": {
    "temperature": 21.42,
    "humidity": 41.55
  },
  "1611082568": {
    "temperature": 42.84,
    "humidity": 83.1
  }
}

Instead of submitting data to the /data.json MQTT topic suffix, this "compact JSON" format is decoded on the /tc.json MQTT topic suffix. "tc.json" in this context means "timestamped compact json".