luftdaten-at / datahub

Open source data management system for air quality and environmental data. Used for citizen science and STEM education. Build in Django / PostgreSQL.
https://datahub.luftdaten.at
GNU Affero General Public License v3.0
0 stars 0 forks source link

/api/device/data/add umstellen #19

Open silvioheinze opened 2 months ago

silvioheinze commented 2 months ago

Super, hab noch kleine Änderung gemacht. Alles mit muss angegeben sein, alles andere ist zusätzlich. Du kannst Sensor-Namen mitschicken, wenn die Datenbank sie noch nicht kennt werden sie erstmal gleich registriert. { "time": "2024-04-29T08:25:20.766Z", "device": "string", "location: { "lat": double, "lon": double, "precision": integer, "mode": "string" } "workshop": { "id": "string", "participant": "string", } "measurements": [ "sensor*": "string", "pm1": double, "pm25": double, "pm10": double, "temperature": double, "humidity": double, "voc": double, "nox": double, "co2": double, "o3": double, "iaq_index": double, "iaq_acc": small_int, "iaq_static": double, "pressure": double ] }

silvioheinze commented 3 days ago

POST /api/device/data

{ "station": { "time": "2024-09-27T23:02:20.766Z", "device": "00112233AABDD", "firmware": "1.2", "apikey": "aaaaaaaaaaaaaaaaaaaa", "location": { "lat": 48.20194899118805, "lon": 16.337324948208195, "precision": integer, "mode": "string" } }, "sensors": { "1": { "type": 1, "data": { "2": 5.0, "3": 6.0, "5": 7.0, "6": 0.67, "7": 20.0, "8": 100 }}, "2": { "type": 6, "data": { "6": 0.72, "7": 20.1 }} }, "workshop": { "id": "string", "participant": "string", } }