Data Quality Flags
This section documents the data quality flagging framework used by the API to evaluate incoming IoT measurements and determine whether each sample can be trusted for analytics, reporting, and alerting.
For every received metric, the system applies a consistent set of quality rules and produces:
- one or more flags (what was detected and why),
- a quality status (
okornot_ok), - and, where applicable, an action marker indicating the record was flagged (kept but annotated) or corrected (e.g., timestamp normalization).
What the framework covers
The rules are grouped into clearly defined categories:
- Timestamp validation and correction
Detects invalid device timestamps (e.g., zero/too old) and future timestamps (device time ahead of server time). Future timestamps can be corrected to ensure time-series consistency. - Sentinel and malformed payload detection
Filters out known sentinel values/ranges used by devices to represent invalid readings, and validates histogram payload integrity (empty/malformed/parse errors). - Range and “bad quality” thresholds
Enforces physical minimum/maximum thresholds and separate quality thresholds (device- and metric-specific), such as temperature, RMS voltage/current, RSSI/LSNR, humidity, THD, CO₂, and other environmental metrics. - Physical impossibility checks
Detects combinations that cannot occur in real systems (e.g., power > 0 while voltage or current is effectively zero), protecting downstream power/energy analytics. - Device health and outage inference
Differentiates between grid outage scenarios (device alive, measured zeros likely represent real outage) and device offline behavior (zeros plus poor health signals), plus “low confidence” cases that remain usable but flagged. - Counter-specific validations
Ensures counters are valid over time, identifying missing values, resets, rollovers (handled vs misconfigured), invalid time intervals, and large data gaps (flagged where tolerated). - Phase configuration validation
Flags unexpected measurement phases that do not match the configured device sensor setup while keeping the data available for troubleshooting.
How to interpret results
not_ok: the measurement should not be used for aggregations, reporting, or alerts.ok (flagged): the measurement remains usable, but the flag indicates elevated risk or a configuration/health ambiguity.ok (corrected): the measurement is usable and was normalized (typically timestamp correction) to preserve time-series consistency.
This reference enables consistent, auditable data quality handling across all metrics, devices, and payload types, and provides transparent reasons when data is excluded or annotated.
Quality handling
Section titled “Quality handling”Each measurement returned by the API includes quality information that should be respected by all integrations to ensure accurate analytics and alerts. The primary control is quality_status, which indicates whether a data point is usable (ok) or invalid (not_ok) according to validation rules (timestamp checks, sentinel values, range checks, device health inference, counter integrity, and other quality rules). In addition, quality_flags provide the exact reason(s) why a point was rejected or annotated, enabling transparent troubleshooting and auditability.
When submitting queries, quality_filter allows you to request only valid points (ok), only invalid points (not-ok), or all points (all) depending on your use case. For most dashboards and aggregations, the recommended approach is to request ok or request all and explicitly exclude not_ok in your processing pipeline while logging flags for diagnostics.
Some scenarios may return points that remain usable but should be treated with caution (for example, flagged values that indicate low-confidence or configuration ambiguity); in those cases, keep the point but surface the flag in your UI or monitoring.
As a best practice, never compute KPIs, totals, or alerts from not_ok points, and always store the flags alongside raw data when building an audit-ready integration.