Pushing third party monitor (AirGradient) data succeeds, but sensor does not appear on map

I have an AirGradient Outdoor Monitor (O-1PST) and like to donate its data to sensor community. The monitor exposes its current readings via a local webserver as JSON.

I wrote a simple script, airgradient-to-sensor-community.sc that pulls the data from the monitor and pushes it to the sensor community API in 2 minute intervals. The script runs on a Raspberry PI.

As far as I can tell, the script successfully pulls the data, transforms the Airgradient JSON to the JSON expected by the sensor.cummunity API and pushes it successfully to sensor.community. However, even though I see the pushed data at https://devices.sensor.community/sensors/51613/data, my monitor does not appear on the map. :frowning:

I am not sure what is going wrong here or what I am missing. Any help is appreciated.

An example output of the exchanges JSON follows. Note that the script maps the monitor’s values to two sensor.community X-PIN JSONs.

# Pulling the data from the outdoor sensor
Response({"wifi":-73,"serialno":"<redacted>","rco2":414,"pm01":8,"pm02":13,"pm10":13,"pm003Count":1530,"atmp":15.32,"rhum":55,"tvocIndex":84,"tvoc_raw":33039,"noxIndex":1,"nox_raw":26596,"boot":12900,"ledMode":"co2","firmwareVersion":"3.0.9","fwMode":"O-1PST"},200,,List(connection: close, content-length: 253, content-type: application/json),List(),RequestMetadata(GET,http://192.168.188.44/measures/current,Vector(Accept-Encoding: gzip, deflate)))

# Push to sensor.community #1: JSON for X-PIN 1
{"software_version":"3.0.9","sensordatavalues":[{"value_type":"co2_ppm","value":414},{"value_type":"P10","value":13},{"value_type":"P0","value":8},{"value_type":"P2","value":13},{"value_type":"N03","value":1530}]}

# sensor.community API response #1
Response(Right({"sensor":86970,"timestamp":"2024-04-18T09:52:17.560215","sensordatavalues":[{"sensordata":20094661330},{"sensordata":20094661330},{"sensordata":20094661330},{"sensordata":20094661330},{"sensordata":20094661330}]}),201,,List(transfer-encoding: chunked, allow: POST, OPTIONS, server: Apache/2, content-type: application/json, date: Thu, 18 Apr 2024 09:52:17 GMT),List(),RequestMetadata(POST,https://api.sensor.community/v1/push-sensor-data/,Vector(Accept-Encoding: gzip, deflate, Content-Type: application/json, X-Sensor: esp32-<redacted>, X-Pin: 1, Content-Length: 213)))

# Push to sensor.community #2: JSON for X-PIN 7
{"software_version":"3.0.9","sensordatavalues":[{"value_type":"humidity","value":55},{"value_type":"temperature","value":15.32}]}

# sensor.community API response #2
Response(Right({"sensor":86971,"timestamp":"2024-04-18T09:52:18.079010","sensordatavalues":[{"sensordata":20094661382},{"sensordata":20094661382}]}),201,,List(transfer-encoding: chunked, allow: POST, OPTIONS, date: Thu, 18 Apr 2024 09:52:18 GMT, server: Apache/2, content-type: application/json),List(),RequestMetadata(POST,https://api.sensor.community/v1/push-sensor-data/,Vector(Accept-Encoding: gzip, deflate, Content-Type: application/json, X-Sensor: esp32-<redacted>, X-Pin: 7, Content-Length: 129)))