Analytics & Consumption Comparison
The Consumo Principal vs Secundario chart compares your community's main water meter (principal) against the sum of all individual resident meters (leaf children). The difference reveals unmetered water — consumption that passes through the principal meter but isn't captured by any individual meter.
How it works
Principal meter
The principal meter (hierarchy level 0) is the community's main inlet. Its daily consumption is calculated as:
daily = last_reading_of_day − last_reading_of_previous_day
The principal meter typically reports every hour, giving high-resolution data.
Leaf children (sub-meters)
Leaf children are the individual resident meters — devices with hierarchy_level > 0 that have no children of their own. Their daily consumption uses consecutive-only semantics:
- A device only contributes to a day's total when it has readings on both the current day AND the previous day
- This prevents "catch-up artefacts" — when an offline meter comes back and dumps multiple days of accumulated consumption into a single day
Unmetered water
unmetered = principal − children_sum
A positive value means water passed through the principal that wasn't measured by any sub-meter. Common causes:
- Offline meters — devices that didn't report on consecutive days
- Common areas — irrigation, pool, cleaning, fire systems
- Pipe losses — leaks in shared infrastructure
- Timing differences — principal reports hourly, children report once daily
Offline device analysis
When unmetered water exceeds 15% on a given day, the tooltip shows a breakdown explaining where the gap comes from.
How estimates are calculated
For each device that didn't contribute on a given day, DataKubo estimates its expected consumption using the median of its daily consumption over a 30-day lookback window:
- Fetch the device's readings from the last 30 days
- Compute daily deltas for consecutive calendar days only
- Take the median of positive deltas (ignoring zero-consumption days)
The median is used instead of the mean to avoid outlier influence — a single catch-up reading or unusual spike won't skew the estimate.
Breakdown components
The tooltip shows:
| Component | Description |
|---|---|
| Offline meters | Devices that didn't contribute, with their estimated daily consumption |
| Baseline | Remaining unmetered water after subtracting offline estimates (common areas, pipe losses) |
Up to 5 offline devices are shown, sorted by estimated impact (highest first).
Offline reasons
Each device in the breakdown shows why it didn't contribute:
| Reason | Meaning |
|---|---|
no_reading_today | Device reported yesterday but not today |
no_reading_yesterday | Device reported today but not yesterday (just came back online) |
offline | Device had no readings on either day |
View modes
Daily view
Bar chart (principal) + line chart (children sum). Shows daily deltas — useful for spotting which specific days had anomalies. Subject to sampling rate limitations.
Cumulative view
Two area lines showing cumulative consumption over the period, normalized to start from 0. The widening gap between the lines reveals unmetered water trends. This view is Nyquist-safe — it plots raw cumulative totals and doesn't depend on sampling rate.
Data quality indicators
- Offline badge — shown in the tooltip when devices didn't report on consecutive days
- Under-sampled warning — shown when >50% of leaf devices report fewer than 2 readings/day (Nyquist theorem requires ≥2 samples/day for accurate daily resolution)
- Partial day — today's data is marked as "(partial)" since the day isn't complete
Device hierarchy
DataKubo supports multi-level meter hierarchies:
Principal (level 0) — community inlet
├── Sub-meter group (level 1) — building riser (intermediate, excluded from leaf sum)
│ ├── Apartment A (level 2) — leaf child ✓
│ ├── Apartment B (level 2) — leaf child ✓
│ └── ...
├── Apartment C (level 1) — leaf child ✓
└── ...
Intermediate devices (level 1 with children of their own) are excluded from the leaf children sum to avoid double-counting. Only true leaf devices (no children) contribute to the comparison.
Tips for reducing unmetered water
- Fix offline meters — check battery levels and connectivity for devices that frequently miss days
- Monitor the baseline — a stable baseline of 2-5% is normal (common areas). A growing baseline may indicate a leak
- Use cumulative view — the widening gap over time is easier to interpret than daily spikes
- Check the 30-day view — smooths out daily noise and gives a clearer picture of the trend