Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Smart Energy Clusters

Smart Energy clusters provide utility metering for electricity, gas, and water consumption.


Simple Metering (0x0702)

Tracks cumulative energy consumption and instantaneous demand. This is a read/report-only cluster with no cluster-specific commands — all data is published via attribute reads and reporting.

Attributes

AttributeIDTypeAccessDescription
CurrentSummationDelivered0x0000U48ReportTotal energy delivered to premises
CurrentSummationReceived0x0001U48ReportTotal energy exported (solar, etc.)
UnitOfMeasure0x0300Enum8ReadMeasurement unit
Multiplier0x0301U24ReadValue multiplier
Divisor0x0302U24ReadValue divisor
SummationFormatting0x0303Bitmap8ReadDisplay format
DemandFormatting0x0304Bitmap8ReadDemand display format
MeteringDeviceType0x0308Bitmap8ReadDevice type
InstantaneousDemand0x0400I32ReportCurrent power draw (signed)
PowerFactor0x0510I8ReadPower factor (-100 to +100)

Unit of Measure Values

ValueUnitDescription
0x00kWhKilowatt hours
0x01Cubic meters
0x02ft³Cubic feet
0x03CCFCentum cubic feet
0x04US galUS gallons
0x05IMP galImperial gallons
0x06BTUBritish thermal units
0x07LLiters
0x08kPaKilopascals (gas pressure)

Metering Device Types

ValueType
0x00Electric metering
0x01Gas metering
0x02Water metering

Value Conversion

To convert raw attribute values to engineering units:

Actual Value = RawValue × Multiplier ÷ Divisor

For example, with Multiplier=1 and Divisor=1000:

  • CurrentSummationDelivered = 123456 → 123.456 kWh
  • InstantaneousDemand = 1500 → 1.500 kW

Usage

#![allow(unused)]
fn main() {
use zigbee_zcl::clusters::metering::*;

// Electric meter: kWh, multiplier=1, divisor=1000
let mut meter = MeteringCluster::new(UNIT_KWH, 1, 1000);

// In your metering ISR / periodic callback:
meter.add_energy_delivered(100);  // Add 100 Wh
meter.set_instantaneous_demand(1500); // 1.5 kW draw

// Read cumulative total:
let total_wh = meter.get_total_delivered(); // returns u64
}

Reporting Example

A typical energy monitor reports:

  • InstantaneousDemand: every 10 seconds, or on 100W change
  • CurrentSummationDelivered: every 5 minutes, or on 100 Wh change
Configure Reporting for Metering (0x0702):
  Attribute: InstantaneousDemand (0x0400), Type: I32
    Min: 10s, Max: 60s, Change: 100
  Attribute: CurrentSummationDelivered (0x0000), Type: U48
    Min: 60s, Max: 300s, Change: 100

Electrical Measurement (0x0B04)

While technically a “Measurement & Sensing” cluster, Electrical Measurement is closely related to Smart Energy metering. It provides real-time electrical parameters:

  • RMS Voltage (0x0505)
  • RMS Current (0x0508)
  • Active Power (0x050B)
  • Power Factor (0x0510)

See the Measurement & Sensing chapter for details.