Skip to content

1) Device Address

The driver splits "Meter Type (T)" and "Address Field (A0..A6)" into two fields (Consistent with CJ/T 188-2018 frame structure):

  • meterType: Meter Type (T, 1 byte, 0..=255)
  • address: Address Field (A0..A6, 7 bytes)

meterType (T)

Type code used to distinguish Water/Heat/Gas/Custom etc.

2018 Meter Type and Code (CJ/T 188-2018):

Meter Type RangeCode (T)Meter Description
10H ~ 19H10HCold Water Meter
11HDomestic Hot Water Meter
12HDirect Drinking Water Meter
13HReclaimed Water Meter
20H ~ 29H20HHeat Meter (Heat)
21HHeat Meter (Cooling)
22HHeat Meter (Heat & Cooling)
30H ~ 39H30HGas Meter
40H ~ 49HCustom Meter

2004 Meter Type and Code (CJ/T 188-2004):

Meter Type RangeCode (T)Meter Description
10H ~ 19H10HCold Water Meter
11HDomestic Hot Water Meter
12HDirect Drinking Water Meter
13HReclaimed Water Meter
20H ~ 29H20HHeat Meter (Heat)
21HHeat Meter (Cooling)
30H ~ 39H30HGas Meter
40H ~ 49H40HCustom Meter

address

Address field consists of 7 bytes (A0..A6), each byte is usually 2-digit BCD.

  • Driver Configuration Format: address uses 14-digit hex string, representing A6..A0 Bytes (High byte first), e.g., 00000000EE0001

Remark

Protocol definition "Low address first, High address last" refers to A0..A6 byte order on wire; Driver automatically completes conversion of A6..A0 (Config) ↔ A0..A6 (Wire Order) during protocol encoding/decoding.

2) DI

Driver UI expresses DI in 4-digit hex (2 bytes) (e.g., 901F).

DI Byte Order Difference:

  • 2018 Version: Little-Endian. 901F sent as 1F 90.
  • 2004 Version: Big-Endian. 901F sent as 90 1F.

Driver automatically handles byte order based on Protocol Version in channel configuration.

Practical Suggestion:

  • Base on manufacturer manual/master station tool
  • If reading fails, prioritize confirming:
    • Whether DI is valid under 2004/2018 version
    • Whether device needs SER/SEQ (2018) and link layer parameters consistency

3) field_key and Schema Driven Parsing

3.1 One DI ≠ One Point

One DI (Data Identifier) in CJ/T 188 usually represents a group of fields (e.g., 901F contains "Cumulative/Time/Status" etc.). This driver adopts DI Schema Driven Parsing:

  • Driver classifies Device.meterType into Water/Heat/Gas/Custom (Meter Family)
  • Selects built-in schema by (DI, Meter Family)
  • Parses response of that DI into a set of field_key -> NGValue
  • Each Point "picks" one field to report from DI data group via field_key

Therefore:

  • Same DI Multi-field Collection: Create multiple Points, same di, different field_key
  • Performance: Driver reads grouped by DI; only initiates one request for same device same DI, then distributes to multiple Points

3.2 field_key must come from built-in schema

field_key is not an arbitrary string, it must match field keys in driver built-in schema:

  • If field_key does not exist or does not belong to that DI/Meter Family: That point will be skipped, and log prompts point value not produced (You need to correct according to DI/field_key list in this article)
  • If schema not found for (DI, meterType family): That DI parsing fails, log prompts (You need to change DI or confirm meterType)

4) DI / field_key

4.1 Water / Gas

DI (hex)Meaning (Schema Semantics)Available field_key (All)
901FWater/Gas: Comprehensive Reading (Current Cumulative, Settlement Day, Time, Status)current_flow, settlement_flow, datetime, status
D120..D12BLast 1..12 Months: Settlement Day Cumulative Flowsettlement_flow
D200..D2FFLast 1..256 Months: Settlement Day Cumulative Flowsettlement_flow
D300..D3FFLast 1..256 Times: Timed Freeze Datafreeze_datetime, cumulative_flow, flow_rate, temperature, pressure
D400..D4FFLast 1..256 Times: Instant Freeze Datafreeze_datetime, cumulative_flow, flow_rate, temperature, pressure

Field Explanation (Water/Gas)

field_keyMeaningRecommended DataTypeRemark
current_flowCurrent Cumulative FlowFloat64BCDWithUnit(4 + unit), unit code not reported; Suggest Point.unit write
settlement_flowSettlement Day/Historical Settlement Day Cumulative FlowFloat64BCDWithUnit(4 + unit)
datetimeReal-time TimeTimestampUnix epoch ms (UTC)
statusStatus BitUInt16Actual semantics u16 Little Endian; Parse bitwise (See below)
freeze_datetimeFreeze Time (Last N Times)Timestamp7-byte DateTime → epoch ms (UTC)
cumulative_flowFreeze Time Cumulative FlowFloat64
flow_rateFreeze Time Instantaneous FlowFloat64BCDWithUnit(4 + unit), schema built-in decimals=4
temperatureTemperatureFloat64BCD(decimals=2)
pressurePressureFloat64BCD(decimals=2)

4.2 Heat

DI (hex)Meaning (Schema Semantics)Available field_key (All)
901FHeat Meter: Comprehensive Reading (Heat/Power/Flow/Temp/Hours/Time/Status)settlement_heat, current_heat, heat_power, flow_rate, cumulative_flow, supply_temp, return_temp, working_hours, datetime, status
911FHeat+Cool: Comprehensive Reading (With Cooling, Supply/Return Pressure)settlement_heat, settlement_cooling, current_heat, current_cooling, heat_power, flow_rate, cumulative_flow, supply_temp, return_temp, supply_pressure, return_pressure, working_hours, datetime, status
D120..D12BLast 1..12 Months: Settlement Day Heatsettlement_heat
D200..D2FFLast 1..256 Months: Settlement Day Heat/Cool/Flowsettlement_heat, settlement_cooling, settlement_flow

Field Explanation (Heat)

field_keyMeaningRecommended DataTypeRemark
settlement_heatSettlement Day Heat / Historical Settlement Day HeatFloat64BCDWithUnit
current_heatCurrent HeatFloat64BCDWithUnit
settlement_coolingSettlement Day Cooling (Only 911F/D200..D2FF)Float64BCDWithUnit
current_coolingCurrent Cooling (Only 911F)Float64BCDWithUnit
heat_powerHeat PowerFloat64BCDWithUnit(3 + unit)
flow_rateInstantaneous FlowFloat64BCDWithUnit(3 + unit) (schema built-in decimals=3/4)
cumulative_flowCumulative FlowFloat64BCDWithUnit
supply_tempSupply TemperatureFloat64BCD(decimals=2)
return_tempReturn TemperatureFloat64BCD(decimals=2)
supply_pressureSupply Pressure (Only 911F)Float64BCD(decimals=2)
return_pressureReturn Pressure (Only 911F)Float64BCD(decimals=2)
working_hoursCumulative Working HoursInt64BCDInteger
datetimeReal-time TimeTimestampUnix epoch ms (UTC)
statusStatus BitUInt16u16 Little Endian
settlement_flowHistorical Settlement Day Cumulative Flow (Only D200..D2FF)Float64BCDWithUnit

4.3 Common (Universal for all meter families)

DI (hex)Meaning (Schema Semantics)Available field_key (All)
907FReal-time Timedatetime
8102Price Table (3 Tiers)price_1, volume_1, price_2, volume_2, price_3
8103Settlement Day (day)settlement_day
8104Reading Day (day)reading_day
8105Purchase Amount (With Status)purchase_seq, this_purchase, total_purchase, remaining, status

5) Status Bit (status) Field

status field after schema parsing is semantically u16 Little Endian Bitmap. Recommend Point config as data_type=UInt16, easy for downstream bitwise parsing. Basic bit definition see driver code comments:

  • D0: Valve Switch (0=Open, 1=Closed)
  • D1: Valve Status (0=Normal, 1=Abnormal)
  • D2: Battery Voltage (0=Normal, 1=Undervoltage)
  • D3..D15: Manufacturer Defined

Recommended Practice:

  • Model status as a Point (field_key=status)
  • Parse bitwise in Northward or Rule Engine (Or remap to multiple boolean attributes)

Released under the Apache License 2.0.