Skip to content
Stand with Ukraine flag

Indoor Air Quality Degraded Alarm

  • Alarm Rule
  • 1 install
  • v1.0.0
  • Aug 11, 2026
  • MIT license
  • v4.3+

Raises one indoor air quality alarm from PM2.5, TVOC, formaldehyde and CO2 together, instead of one alarm per pollutant, so a single alert covers the whole room. For offices, meeting rooms, classrooms, schools, hospitals, and ventilation control.

Type
  • Alarm
Category
  • Environmental
  • Threshold
Use Cases
  • Air Quality Monitoring
  • Health Care
  • Smart Building
  • Smart Office

Who it’s for

Facility and building managers, workplace-wellness and school teams, and smart-home owners running an air-quality sensor. Use it when several pollutants share one alarm and you want to know the moment any of them crosses a health limit: “is a meeting room’s CO2 climbing while it fills up?”, “did a cleaning product or new furniture spike the TVOCs?”, “is PM2.5 drifting in from outside or from cooking?”

What it does

Reads up to four pollutants from one sensor - pm25, tvoc, co2, and hcho (formaldehyde) - and raises a Major alarm when any of them stays over its own limit for a few minutes, escalating to Critical when any stays over a multiple of that limit (twice, by default). Both alarms wait before firing, so a brief spike from cooking, cleaning, or a passing draft does not raise a nuisance alarm. The alarm details list all four readings next to their limits, so you can see which pollutant tripped it and by how much. It clears only once every metric has stayed back under the hysteresis level for a hold window.

Any subset of the keys works: a sensor that only reports CO2 still alarms on CO2, because a missing metric reads as zero and never trips. The default limits follow common health guidance (PM2.5 35 µg/m³, TVOC 500 ppb, CO2 1200 ppm, formaldehyde 100 µg/m³).

Indoor Air Quality Degraded Alarm diagram

How to set up

The rule has default values for every limit, so it works as soon as it is installed. Install on a device or asset profile so the alarm covers every air-quality sensor of that type at once and automatically picks up any new sensor added later. Single-device or single-asset installs are also supported.

How to customize

  • To match your sensor’s keys - change the Time series key on the pm25, tvoc, co2, and hcho arguments (e.g. pm25pm2_5, tvocvoc). Leave a key you do not have on its default and that metric simply never trips.
  • To use different limit attribute names - change the Attribute key on the warningPm25, warningTvoc, warningCo2, and warningHcho arguments to match what your sensors already use.
  • To change the per-metric limits used when no per-entity attribute is set - change the Default value on warningPm25, warningTvoc, warningCo2, and warningHcho.
  • To change how far past the limit is Critical - change the Default value on criticalMultiplier (2 means twice the warning limit).
  • To debounce brief spikes - change the Default value on warningHoldMinutes and criticalHoldMinutes. Each pollutant has to stay over its limit for that long before the alarm fires, so a short cooking, cleaning, or aerosol spike does not trigger it. Critical uses a shorter hold by default because it is more urgent.
  • To tune the clear behavior - change clearFactor (the fraction of the limit every metric must fall back under, 0.85 by default) and clearHoldMinutes (how long it must hold there before the alarm clears).
  • To tune limits at runtime without editing the rule - set the value on the entity as a regular server-side attribute. It can be edited directly from a dashboard using the Update Multiple Attributes input widget:
    • Per device or asset - set the attribute (e.g. co2WarningThreshold) on the sensor itself. The per-entity value overrides the Default value.
    • Per customer (in deployments that use customers) - change Entity type on the relevant argument to Current owner, then set the attribute on the customer.
    • Tenant-wide - change Entity type to Current tenant, then set the attribute on the tenant.
  • To watch a single pollutant - set the other three keys to a metric your sensor does not report (they stay at zero and never trip), or set their limits very high.
  • To make the alarm manual-clear-only - remove the Clear condition. The alarm then stays active until an operator clears it.
  • To control where the alarm shows up - toggle the propagation flags under Advanced settings.

Share Your Alarm Rule with the Community

Built a reliable alarm rule? Export it as a JSON from ThingsBoard and publish it to the IoT Hub. Share it with thousands of ThingsBoard developers and help the community react to incidents faster.