# env: environment and power

> Readings from environmental sensors, such as dust and noise, together with the device's power status.

The `env` table holds the readings of Asense environmental sensors, such as the noise and dust sensor. Each record also reports the device's power status: battery, solar panel and external supply. A device usually sends one record every 10 minutes.

## Air quality

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `pm1_ug/m3` | number | µg/m³ | PM1 mass concentration. |
| `pm2_5_ug/m3` | number | µg/m³ | PM2.5 mass concentration. |
| `pm10_ug/m3` | number | µg/m³ | PM10 mass concentration. |
| `pm1_/cm3` | number | particles/cm³ | PM1 particle count. |
| `pm2_5_/cm3` | number | particles/cm³ | PM2.5 particle count. |
| `pm10_/cm3` | number | particles/cm³ | PM10 particle count. |
| `is_ob_ov` | integer | | `1` when the dust sensor reports an obstruction. While it is `1`, the PM values are not valid readings. |

Some field names contain a `/`. In JavaScript read them with brackets, for example `row["pm2_5_ug/m3"]`.

## Noise

Each noise reading is taken over a 10-second capture. The average is the mean level over the capture, and the peak is the highest 100 ms level within it.

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `spl_avg_db` | number | dB | Average sound pressure level, unweighted. |
| `spl_pk_db` | number | dB | Peak sound pressure level, unweighted. |
| `spl_avg_dba` | number | dB(A) | Average A-weighted level. |
| `spl_pk_dba` | number | dB(A) | Peak A-weighted level. |
| `spl_avg_uv`, `spl_pk_uv` | number | | Older field pair. Devices that do not yet send the `_dba` fields put dB(A) × 100 here, so `6750` means 67.50 dB(A). |

## Power and status

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `bat_mv` | integer | mV | Battery voltage. |
| `pv_mv` | integer | mV | Solar panel voltage. |
| `in_mv` | integer | mV | External supply voltage. |
| `soc` | number | | Battery state of charge, as reported by the device. |
| `prod_mvas` | integer | mV·A·s | Energy counter for power produced, as reported by the device. |
| `cons_mvas` | integer | mV·A·s | Energy counter for power consumed, as reported by the device. |
| `run_sec` | number | s | Time the device has been running. |
| `temp_c` | number | °C | Temperature. |
| `lat`, `long` | number | degrees | Position, as decimal latitude and longitude. |

A field the device does not send is returned as `0`.

## Order and timestamps

`env` supports `ascending=false`, to get the newest record first, and `timestamps_only=true`, to list record times without the readings. `merge` has no effect on this table.

Source page: https://asense.semitronica.pt/docs/data-model/env/
