RFID System
Tag Families

Tag Families

A tag family defines the calibration curve and classification parameters for a type of RFID sensor tag. Calibration is stored in the rfid_tag_families Supabase table and loaded at runtime.

AZN3120-AFR (Magnus S3)

The primary moisture-sensing tag used by Parlevel.

PropertyValue
NameAZN3120-AFR
TID prefixE28240 (first 3 bytes of TID bank)
Sensor bankReserved
Sensor wordWord 12 (byte offset 24)
SC value range0–511 (9-bit)
Recommended RF link1 (PR ASK / Miller4 / 250 kHz)

Calibration curve

11-point SC → volume mapping used to compute fluid level:

SC valueVolume (mL)
511700
480650
450560
400490
360420
310350
260280
210210
160140
10070
400

Linear interpolation is used between calibration points.

Level bands

BandMin SCMax SCLabel
Full460511Full
3/43804593/4
1/22803791/2
1/41402791/4
Empty0139Empty

Classification parameters

ParameterValueDescription
minReads3Minimum stable readings before emitting a level
ambiguousZones±15 around band boundariesSC ranges treated as ambiguous (uses hysteresis)

Adding a new tag family

  1. Insert a row into rfid_tag_families:
INSERT INTO rfid_tag_families (
  name, tid_prefix, description,
  calibration, level_bands, min_reads, ambiguous_zones
) VALUES (
  'MY-TAG-FAMILY',
  'E28241',
  'Description of the tag',
  '[{"sc": 511, "volumeMl": 700}, ...]'::jsonb,
  '[{"label": "Full", "minSc": 460, "maxSc": 511}, ...]'::jsonb,
  3,
  '[{"centerSc": 460, "halfWidthSc": 15}]'::jsonb
);
  1. In the location RFID settings (UI or API), set moisture.tagFamily to 'MY-TAG-FAMILY'

  2. Calibration is loaded once per process start and cached in memory. Restart the server after adding a new family.

Per-location tag family

Each location can use a different tag family. The setting is stored in device_config as moisture.tagFamily. If unset, falls back to the RFID_TAG_FAMILY env var, then to AZN3120-AFR.