Skip to content
Updated Oct 5, 2026 by Pablo Coufal · Owner: analysisactiveentityconfluence-migration Edit on GitHub

Entity: gauge ​

Entity Type: Database table

Description: A gauge is a measurement point that feeds consumption and reading data into the system. It may represent a physical metering device (kind = standard or subGauge) or a virtual aggregation / manual-input point (kind = virtual). Every gauge belongs to exactly one building node and one tenant. The gauge record holds configuration — not measurements; actual readings and consumption figures live in separate entities.

Data Attributes Table ​

Attribute NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
idUnique identifier for the gauge record.UUIDGenerated in code (app layer)YesYesUUID v7Must be a valid UUID v7.Primary Key01960000-0000-7000-8000-000000000001
tenantIdTenant this gauge belongs to. Required on every entity — primary mechanism for data isolation across organisations.UUID-YesNoUUID v7Foreign Key → tenant.idname: idx_gauge_tenantId, type: btree01960000-0000-7000-8000-000000000099
buildingIdBuilding node this gauge is attached to. Read-only for standard users; changeable only by a permitted user.UUID-YesNoUUID v7Foreign Key → building.id. Update requires building-reassignment permission; not enforceable at DB level, must be enforced in application/API layer.name: idx_gauge_buildingId, type: btree01960000-0000-7000-8000-000000000010
nameHuman-readable name of the gauge, shown in lists and detail views.String-YesNo-Max 200 characters; must not be empty.-Hlavní elektroměr 1NP
descriptionOptional free-text description providing additional context about the gauge.StringnullNoNo-Max 1000 characters.-Odběr technologie — serverovna
kindStructural role of the gauge. Immutable after creation. Determines which other fields are applicable.String-YesNoenumMust be one of the defined enum values.name: idx_gauge_kind_tenantId, type: btreestandard
virtualSubtypeSubtype of a virtual gauge. Null for non-virtual kinds. Immutable after creation.StringnullNoNoenumRequired when kind = virtual; null otherwise.-computed
mediumThe physical commodity measured by this gauge. Immutable after creation.String-YesNoenumMust be one of the defined enum values.name: idx_gauge_medium_tenantId, type: btreeelectricity
directionDLMS/COSEM flow direction. Always null for medium = kvp. Null for virtual gauges. Auto-set from the gaugePurposeOption referenced by purpose — not user-editable directly.StringnullNoNoenumValues: import, export, null. Required for standard and subGauge with medium ≠ kvp.-import
readingModeIndicates whether the physical device sends cumulative or interval readings. For energy/volume readings ingested from this gauge, this value is copied directly onto reading.format; it does not apply to power or KVP/climate readings, which always take format average.StringcumulativeYesNoenumNull for virtual gauges.-cumulative
outputModeHow the gauge contributes to the building total formula. Null for virtual gauges. Auto-set from the gaugePurposeOption referenced by purpose — not user-editable directly.StringnullNoNoenumRequired for standard and subGauge with medium ≠ kvp.-include
purposeReferences the specific gaugePurposeOption the user selected in the creation form. Determines direction and outputMode automatically — the user never sets those fields directly, only picks a word choice filtered by kind + medium. Multiple gaugePurposeOption rows (different wording) may point to the same underlying (direction, outputMode) target and the same business category; this field stores exactly which option was picked, so the original selection is reconstructable unambiguously on edit, even when several options are equivalent.UUIDnullNoNoUUID v7Foreign Key → gaugePurposeOption.id. Required for kind = standard or subGauge with medium ≠ kvp; null for virtual gauges and kvp gauges.name: idx_gauge_purpose, type: btree01960000-0000-7000-8000-000000000040
primarySourceWhere the energy physically originates. Carried over from EM2 (gauge_meter.primary_source, PHP constants SOURCE_* in GaugeType.php). Used in EnMS/EnPI reporting.IntegernullNoNoenum — PrimarySourceInteger values 1–28 mapped per enum PrimarySource. Null acceptable for sub-gauges, KVP gauges, and standard consumption gauges where source is implied.-1
labelOverrideOptional custom display label that overrides the system-generated label derived from medium + direction.StringnullNoNo-Max 100 characters.-FVE střecha – výroba
unitCanonical unit in which consumption figures are stored for this gauge.String-YesNoenum — UnitMust be compatible with the selected medium.-kWh
physicalMeterIdGroups all channels of the same physical device. Null for virtual gauges. Immutable after assignment.UUIDnullNoNoUUID v7Foreign Key → physicalMeter.id. Null for virtual gauges.name: idx_gauge_physicalMeterId, type: btree01960000-0000-7000-8000-000000000020
serialNumberSerial number of the physical meter at the current point in time. Updated by the application when a new gaugeSerialHistory record is inserted. Used for fast display without joining the history table.StringnullNoNoMax 100 charactersMax 100 characters; null for virtual gauges and KVP gauges.name: idx_gauge_serialNumber_tenantId, type: btree1EMH0004579834
manufacturerManufacturer or brand of the physical meter. Free-text field for informational purposes only; not used in any system logic. Carried over from EM2 (gauge_meter.manufacturer).StringnullNoNo-Max 200 characters; null for virtual gauges and KVP gauges.-Landis+Gyr
supplyPointIdIdentifier of the metering point (odběrné místo). Format and label are medium-aware. Immutable after creation. Hidden for kvp and virtual gauges.StringnullNoYesMedium-aware: EAN (18 digits), EIC (16 alphanumeric), or free string (max 50 chars).Unique per tenant. Required for standard electricity with direction = import.name: idx_gauge_supplyPointId_tenantId, type: btree859182400000000149
electricitySharingConsumptionIndicates this gauge participates in Community Energy Sharing as a consumption-side member.BooleanfalseYesNo-Applicable only when medium = electricity.-false
electricitySharingProductionIndicates this gauge participates in Community Energy Sharing as a production-side member.BooleanfalseYesNo-Applicable only when medium = electricity.-false
phaseCountNumber of electrical phases. Electricity only.IntegernullNoNo-Values: 1 or 3; null for non-electricity.-3
circuitBreakerRated current of the circuit breaker (main fuse) in amperes. Electricity only.IntegernullNoNo-Positive integer; null for non-electricity.-25
distributorTariffCode of the distribution rate currently assigned to the supply point — a read model of the latest gaugeDistributionRateHistory record, kept for lists and exports. Retail electricity only; the rate itself, with its tariff scheme, lives in the platform catalogue distributionRate. Not writable through the API — a rate change writes a history record.StringnullNoNo-Max 10 characters; null for non-electricity, for supplyType VN / VVN and for sub-gauges and virtual gauges.-D02d
tddGroupTDD (Typový diagram odběru) group code. Electricity only.StringnullNoNo-Max 20 characters; null for non-electricity.-C
reservedCapacityReserved capacity / sjednané maximum, in MW (electricity only). Corrected 2026-07-17 — EM2 staging data (gauge_properties.reserved_capacity, 4 records, range 0–1) confirmed MW, not kW as previously documented. EM2 also has a separate reserved_power column (9 records, range ~0–334k, likely Watts) with no EM3 equivalent yet — out of scope for v1, deferred to the future PXE Integration feature.DecimalnullNoNo-Positive decimal; null for non-electricity.-0.5
billingFrequencyHow often invoices are issued for this metering point.StringnullNoNoenum — GaugeBillingFrequency--monthly
isPartOfBulkPurchaseIndicates whether this metering point is included in a collective energy purchase contract. Applicable for electricity and gas only.BooleanfalseYesNo---false
meterOwnershipWho owns the physical metering device installed at this point.StringcustomerYesNoenum — GaugeMeterOwnershipDefault customer; changes to distributor only when the grid operator installs their own device on a customer FVE for export metering.-customer
parentGaugeIdReference to the standard gauge that is the upstream parent of this sub-gauge. Null for standard and virtual kinds.UUIDnullNoNoUUID v7Required when kind = subGauge. Referenced gauge must have kind = standard and belong to the same tenant.name: idx_gauge_parentGaugeId, type: btree01960000-0000-7000-8000-000000000005
subscriberIdThe organisation (odběratel) connected to this metering point. Organisation cannot be deleted while referenced by at least one active gauge.UUIDnullNoNoUUID v7Foreign Key → organisation.id. Null for virtual gauges and KVP gauges.name: idx_gauge_subscriberId, type: btree01960000-0000-7000-8000-000000000030
supplierOrganisationIdThe organisation supplying this metering point. Editable from the frontend, unlike the removed distributor-id columns it replaces.UUIDnullNoNoUUID v7Foreign Key → organisation.id.name: idx_gauge_supplier_organisation, type: btree01960000-0000-7000-8000-000000000033
sourcePriorityPer-gauge override of the tenant-level data source trust priority. When null, the tenant default applies.StringnullNoNoenum — GaugeSourcePriorityOne of 6 permutations of remote, manual, invoice; null = use client.defaultSourcePriority.-remote_manual_invoice
allowsManualReadingIndicates whether the specific channel accepts manually entered readings. When false, the API rejects reading submissions with source = manual for this gauge (hard restriction).BooleantrueYesNo-When false, POST /v1/readings (or equivalent) with source = manual and this gaugeId must be rejected by the API.-true
allowsNegativeWhen false, non-cumulative reading and consumption values that are negative are automatically flagged as anomalies. Does not apply to cumulative-format readings — a negative value there is rejected outright at write time regardless of this flag.BooleanfalseYesNo---false
anomalyToleranceMinOptional per-gauge override of the tenant-level lower tolerance bound (see clientTolerance). Percentage deviation, negative value. Corrected 2026-07-21 — replaces the retired single-multiplier anomalyTolerance field; split into min/max to stay consistent with clientTolerance's asymmetric bounds. Not editable via UI in v1 (reserved for future per-gauge configuration).IntegernullNoNo-Negative integer, range −25 to −1; null = use the matching clientTolerance.toleranceMin (looked up by clientTolerance.medium = gauge.medium), or the system default (−20) if no clientTolerance record exists. When set, overrides for this gauge only.-null
anomalyToleranceMaxOptional per-gauge override of the tenant-level upper tolerance bound (see clientTolerance). Percentage deviation, positive value. Corrected 2026-07-21 — replaces the retired single-multiplier anomalyTolerance field; split into min/max to stay consistent with clientTolerance's asymmetric bounds. Not editable via UI in v1 (reserved for future per-gauge configuration).IntegernullNoNo-Positive integer, range 1 to 25; null = use the matching clientTolerance.toleranceMax (looked up by clientTolerance.medium = gauge.medium), or the system default (+20) if no clientTolerance record exists. When set, overrides for this gauge only.-null
isSystemManagedWhen true, the gauge was created and is managed automatically by the system (e.g. buildingTotal virtual gauges). Cannot be manually archived or deleted.BooleanfalseYesNo---false
isArchivedSoft-archival flag. When true, the gauge is hidden from active lists but its historical data is preserved.BooleanfalseYesNo--name: idx_gauge_isArchived_tenantId, type: partial (WHERE isArchived = false)false
archivedAtTimestamp when the gauge was archived. Null when active.Timestamp with time zonenullNoNoISO 8601Set atomically with isArchived = true.-2026-01-15T10:00:00Z
archiveReasonReason for archiving the gauge. Required when archiving.StringnullNoNoenum — GaugeArchiveReasonRequired when isArchived = true.-replacement
showArchivedInReportsControls whether historical data of this archived gauge appears in reports and charts. Set in the Archivovat měřidlo dialog, not in the gauge form (5 Oct 2026).BooleantrueYesNo---true
supplyTypeSize category of the supply point (typ odběru). Drives which distribution, tariff and energy-purchase attributes apply. Electricity and gas only. Decided 2026-09-23: the attribute lives on the gauge. contract.medium keeps the commercial category of the contract (glossary decision of 12 Aug 2026); the two are different things and a gauge may only be attached to a contract of the matching category — validated by the application.StringnullNoNoenum — GaugeSupplyTypeNull for every medium other than electricity and gas. Electricity: retail, largeScaleVN, largeScaleVVN. Gas: retail, mediumScale, largeScaleGas.name: idx_gauge_supplyType_tenantId, type: btreeretail
measurementTypeType of measurement the distributor performs at the supply point. Shown for every electricity and gas supply type (PXE attribute 1 — previously retail only).StringnullNoNoenum — GaugeMeasurementTypeNull for every medium other than electricity and gas.-C
readingMethodHow the channel is read — by hand, by a remote feed, or both. Set on the measured-parameters table; decides how many gaugeSourceSetting records the channel has and whether the manual frequency check runs. Replaces the retired readingMode and allowsManualReading fields.StringmanualYesNoenum — GaugeReadingMethodremote and both require a paired remoteEndPoint. Null for virtual gauges.-both
usageTypeRetired 5 Oct 2026 — replaced by the per-channel allocation gaugeUsageAllocation (single usage, monthly estimate or measured split, versioned) over the platform catalogue usageType. Kept here only so migration mapping documents know the old field; not written by the API.StringnullNoNo-Always null in EM3.-null
placementWhere the meter physically sits, as free text ("Rozvodna 1.NP", "Předávací stanice 1.PP"). Carried over from EM2.StringnullNoNo-Max 200 characters.-Rozvodna 1.NP
supplyPointNumberNumber of the supply point as the distributor states it (číslo odběrného místa), kept separately from supplyPointId (EAN / EIC). Carried over from EM2.StringnullNoNo-Max 50 characters.-4000 1123
distributorPortalUrlLink to the distributor's portal page for this supply point.StringnullNoNoURLMax 500 characters; must be http(s).-https://portal.cezdistribuce.cz/...
photoDocumentIdPhoto of the meter, stored as a document of this gauge.UUIDnullNoNoUUID v7Foreign Key → document; image types only.-01960000-0000-7000-8000-000000000501
commentFree-text comment about the meter. Carried over from EM2.StringnullNoNo-Max 1000 characters.-Vyměněno po rekonstrukci rozvodny.
lowTariffWhether a low tariff (nízký tarif) applies at this supply point. Large-scale electricity only (EM2 forceLowTariff): for a retail supply point the tariff bands come from the distribution rate's tariffScheme and this field is null.BooleanfalseYesNo-Only for electricity with supplyType in (largeScaleVN, largeScaleVVN); null otherwise.-true
peakTariffWhether a peak tariff (špičkový tarif) applies at this supply point. Large-scale electricity only (EM2 forceSpecialTariff); adds the special tariff series to the channel.BooleanfalseYesNo-Only for electricity with supplyType in (largeScaleVN, largeScaleVVN); null otherwise.-false
lowTariffSpecificationFree-text specification of non-standard low-tariff hours (PXE attribute 18).StringnullNoNo-Max 500 characters. Only for electricity with supplyType in (largeScaleVN, largeScaleVVN) and lowTariff = true.-NT 22:00–06:00 a 13:00–15:00
additionalSupplyConditionsAdditional conditions of the supply point, filled in when consumption changes significantly (PXE attribute 7).StringnullNoNo-Max 1000 characters. Electricity and gas only.-Od 2027 připojena nová výrobní hala.
annualConsumptionHighAnnual consumption in the high tariff, in MWh (PXE attribute 13). Typed in or filled by "Načíst z databáze" — the consumption of the last 365 consecutive days with data.DecimalnullNoNoDecimal(18,3)Zero or greater. Electricity with supplyType = retail.-412.500
annualConsumptionLowAnnual consumption in the low tariff, in MWh (PXE attribute 14). Shares its help text and its "Načíst z databáze" button with annualConsumptionHigh — one button fills both.DecimalnullNoNoDecimal(18,3)Zero or greater. Electricity with supplyType = retail and a dual-tariff distribution rate.-128.300
annualConsumptionAnnual consumption in MWh for supply points with a single figure (PXE attribute 15) — electricity VN / VVN and retail gas. For gas medium / large-scale points the figure is computed from gaugeMonthlyValue instead and this column stays null (PXE attribute 16).DecimalnullNoNoDecimal(18,3)Zero or greater. Null when the figure comes from monthly values.-2480.000
reservedPowerReserved power (rezervovaný příkon) in MW. Electricity VN / VVN only — feature id26 moves it off retail supply points.DecimalnullNoNoDecimal(18,3)Zero or greater; null unless supplyType in (largeScaleVN, largeScaleVVN).-2.600
dailyReservedCapacityDaily reserved capacity of a gas supply point, in m³. Gas medium / large-scale only.DecimalnullNoNoDecimal(18,3)Zero or greater; null for non-gas.-3200.000
safetyMinimumSafety minimum (bezpečnostní minimum) in MW, entered together with the regulation levels (PXE attribute 20).DecimalnullNoNoDecimal(18,3)Zero or greater; only for electricity VN / VVN.-0.450
regulationLevel3Share of the reserved capacity that stays available at regulation level 3, in per cent (PXE attribute 20).IntegernullNoNo-0–100; only for electricity VN / VVN.-80
regulationLevel4Share of the reserved capacity that stays available at regulation level 4, in per cent.IntegernullNoNo-0–100; only for electricity VN / VVN.-60
regulationLevel5Share of the reserved capacity that stays available at regulation level 5, in per cent.IntegernullNoNo-0–100; only for electricity VN / VVN.-40
regulationLevel6Share of the reserved capacity that stays available at regulation level 6, in per cent.IntegernullNoNo-0–100; only for electricity VN / VVN.-20
regulationLevel7DurationTime the supply point needs to reach regulation level 7, in hours (free text in EM2, kept as text).StringnullNoNo-Max 50 characters; only for electricity VN / VVN.-2 hod
billingTypeWhether the supply point is invoiced on its own or merged with others (PXE attribute 4).StringnullNoNoenum — GaugeBillingTypeElectricity and gas, main gauges only.-merged
billingNameName that groups supply points invoiced under one invoice (PXE attribute 5).StringnullNoNo-Max 200 characters. Empty and not editable when billingType = separate.name: idx_gauge_billingName_tenantId, type: btreeZŠ Komenského — energie
depositTypeHow advance payments are agreed (PXE attribute 8).StringnullNoNoenum — GaugeDepositTypeElectricity and gas, main gauges only.-fixed
depositAmountSize of the advance payment — an amount in CZK for fixed, a percentage for percentage (PXE attribute 9).DecimalnullNoNoDecimal(18,2)Zero or greater; not editable when depositType = none.-18000.00
extraordinarySettlementDateDate of an extraordinary settlement agreed with the supplier (PXE attribute 10). Retail electricity and gas only.DatenullNoNoISO 8601 dateNull unless supplyType = retail.-2026-06-30
billingNoteFree-text note about the billing of this supply point; the last field of the billing section (PXE attribute 11).StringnullNoNo-Max 1000 characters.-Fakturovat po 15. dni v měsíci.
deviationResponsibilityWho carries the imbalance responsibility (PXE attribute 12).StringnullNoNoenum — GaugeDeviationResponsibilityElectricity VN / VVN and gas medium / large-scale only.-withTakeover
contractTypeType of supply contract as stated on the contract or invoice (PXE attribute 6). Moves into the contractual-price history once Contract Management owns it.StringnullNoNoenum — GaugeContractTypeElectricity: sssde, sde. Gas: sssdzp, sdzp.-sssde
consumptionDiagramDocumentIdThe consumption diagram of the supply point, stored as a document of this gauge (PXE attribute 17). The detail shows "Vybrat z nahraných dokumentů" while null and "Stáhnout" once set.UUIDnullNoNoUUID v7Foreign Key → document. Only for electricity VN / VVN; PXE requires a year back at hourly or finer resolution — validated when the report is sent, not on save.-01960000-0000-7000-8000-000000000502
incomeBillingFrequencyHow often income from this supply point is invoiced (e.g. for re-invoiced supply). Carried over from EM2.StringnullNoNoenum — GaugeBillingFrequency--yearly
depositFrequencyHow often advance payments are invoiced. Carried over from EM2.StringnullNoNoenum — GaugeBillingFrequencyNull when depositType = none.-monthly
supplierOrganisationIdThe organisation that supplies the commodity to this supply point (odběratel dodávky).UUIDnullNoNoUUID v7Foreign Key → organisation.id. Electricity and gas only.name: idx_gauge_supplierOrganisationId, type: btree01960000-0000-7000-8000-000000000033
paymentScopeWhat the invoice for this supply point covers (water: vodné, stočné, srážky and their combinations). Water only.StringnullNoNo-Max 100 characters; null for non-water.-Vodné + stočné + srážky
gasUsageProfileHow the gas supply point is used (heating, hot water, cooking and their combinations) — the distributor's TDD classification input. Gas only.StringnullNoNo-Max 100 characters; null for non-gas.-Vytápění a ohřev vody
createdAtTimestamp of entity creation. Immutable.Timestamp with time zoneSet in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ--2025-03-16T18:00:00Z
updatedAtTimestamp of last entity update. Set on insert equal to createdAt.Timestamp with time zoneSet in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ--2025-03-16T18:00:00Z
deletedAtTimestamp of soft delete. Once set, immutable. Records with deletedAt IS NULL are considered active.Timestamp with time zonenullNoNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ--null
createdByIdentifier of the actor who created this record.String-YesNotype:actor--user:01960000-0000-7000-8000-000000000099
updatedByIdentifier of the actor who last updated this record.String-YesNotype:actor--user:01960000-0000-7000-8000-000000000099
legacyIdLegacy-system identifier; migration provenance.StringnullNoNo--UNIQUE (tenantId, legacySource, legacyId) WHERE legacyId IS NOT NULL8814
legacySourceWhich legacy table this gauge was migrated from.String (enum)nullNoNoenum: gaugeMust equal the listed value, or null(composite with legacyId above)gauge
legacySupplierIdEM2-carried per-gauge supplier for "supplier flag only" gauges with no contract. Distinct from supplierOrganisationId — references contractSupplier, not organisation. Written only by the legacy-person-contract migration.UUIDnullNoNoUUID v7Foreign Key → contractSupplier.name: idx_gauge_legacy_supplier, type: btree018fa51f-fda1-79f4-8461-2cb8f1cabc10

Audited fields ​

Recorded on created (in full), updated (changed only) and deleted (in full): buildingId, name, description, kind, virtualSubtype, medium, direction, readingMode, outputMode, purpose, primarySource, labelOverride, unit, physicalMeterId, serialNumber, manufacturer, supplyPointId, electricitySharingConsumption, electricitySharingProduction, phaseCount, circuitBreaker, distributorTariff, tddGroup, reservedCapacity, billingFrequency, isPartOfBulkPurchase, meterOwnership, parentGaugeId, subscriberId, supplierOrganisationId, sourcePriority, allowsManualReading, allowsNegative, anomalyToleranceMin, anomalyToleranceMax, isSystemManaged, isArchived, archivedAt, archiveReason, showArchivedInReports, legacyId, legacySource, legacySupplierId.

Excluded: none — direction/outputMode are auto-set from the referenced gaugePurposeOption, but they are real, stored columns at write time, not computed at read time, so they are not derived in this sense and are audited like any other column.

physicalMeterId is a plain tracked reference field here; physicalMeter itself has no descriptive columns of its own to audit — see that entity's own page.

Correction: electricityDistributorId/gasDistributorId, previously documented above, do not exist anywhere in code or migrations — removed. supplierOrganisationId, legacyId, legacySource, legacySupplierId are real columns that were missing from this table — added.

Registered for entityName resolution — resolves to name (architecture 61-audit-log.md §7.4 in the code repo).

Attributes added by the 23 September 2026 design round ​

The rows above that name a PXE attribute number come from Confluence Nákup energie / Propojení s PXE (feature id26); the rest come from the EM2 scope check of the gauge form. They are proposed, not implemented — see the feature's story breakdown. Three fields are retired in the same round: readingMode (derived per reading source), allowsManualReading (always true; readingMethod now says how a channel is read) and labelOverride (no use). Unit and coefficient move off the gauge into gaugeSourceSetting, which holds one set per reading source; the twelve monthly figures live in gaugeMonthlyValue. Distribution rate and circuit breaker are to become versioned lookups following the gaugeSerialHistory pattern, and usageType needs the same treatment — both still to be specified.