Skip to content

API reference documentation – constants module

Constants/definitions for the Kamstrup KMP protocol.

Constants

pykmp.constants.REGISTERS: Final[Mapping[int, str]] = {1: 'Energy in', 2: 'Energy out', 13: 'Energy in hires', 14: 'Energy out hires', 60: 'Heat Energy (E1)', 61: 'Inlet Energy E4', 62: 'Outlet Energy E5', 63: 'Cooling Energy E3', 64: 'Tariff TA2', 65: 'Tariff TA3', 66: 'Tariff limit 2', 67: 'Tariff limit 3', 68: 'Volume V1', 69: 'Volume V2', 72: 'Mass M1', 73: 'Mass M2', 74: 'Flow V1', 75: 'Flow V2', 80: 'Current Power', 84: 'Pulse input A1', 85: 'Pulse input B1', 86: 'Temp1', 87: 'Temp2', 88: 'Temp3', 89: 'Tempdiff', 91: 'Pressure P1', 92: 'Pressure P2', 94: 'Heat Energy E2', 95: 'Tap water energy E6', 96: 'Tap water energy E7', 97: 'Temp1xm3 E8', 98: 'Target Date', 99: 'InfoCode', 104: 'Meter number for VB', 110: 'Temp2xm3 E9', 112: 'Customer number 2', 113: 'Infoevent', 114: 'Meter number for VA', 122: 'Temp4', 123: 'MaxFlowDate_Y', 124: 'MaxFlow_Y', 125: 'MinFlowDate_Y', 126: 'MinFlow_Y', 127: 'MaxPowerDate_Y', 128: 'MaxPower_Y', 129: 'MinPowerDate_Y', 130: 'MinPower_Y', 138: 'MaxFlowDate_M', 139: 'MaxFlow_M', 140: 'MinFlowDate_M', 141: 'MinFlow_M', 142: 'MaxPowerDate_M', 143: 'MaxPower_M', 144: 'MinPowerDate_M', 145: 'MinPower_M', 146: 'AvgTemp1_Y', 147: 'AvgTemp2_Y', 149: 'AvgTemp1_M', 150: 'AvgTemp2_M', 152: 'Program number', 153: 'Config number 1', 154: 'Software Checksum 1', 168: 'Config number 2', 175: 'Error hour counter', 178: 'Differential energy dE', 179: 'Control energy cE', 180: 'Differential volume dV', 181: 'Control volume cV', 184: 'MbusPriAdrMod1', 185: 'MbusSekAdrMod1', 218: 'MbusPriAdrMod2', 219: 'MbusSekAdrMod2', 222: 'ConfigChangedEventCount', 224: 'Pulse input A2', 225: 'Pulse input B2', 228: 'Config number 3', 229: 'T1_average_autoint', 230: 'T2_average_autoint', 234: 'l/imp for VA', 235: 'l/imp for VB', 239: 'Volume V1 hires', 259: 'Nominal Qₚ V1', 260: 'Nominal Qₚ V2', 266: 'E1HighRes', 267: 'Cooling energy E3 hires', 346: 'Module SW rev', 347: 'Customer number', 348: 'Date and Time', 355: 'COP Year', 362: 'Tariff TA4', 364: 'Heat energy A1', 365: 'Heat energy A2', 366: 'T5 limit', 367: 'COP Month', 368: 'Config number 4', 369: 'Info bits', 371: 'COP', 372: 'Power input B1', 379: 'T1 time average day', 380: 'T2 time average day', 381: 'T1 time average hour', 382: 'T2 time average hour', 383: 'Flow V1 max year date', 385: 'Power max year date', 387: 'Flow V1 max month date', 389: 'Power max month date', 398: 'T1 actual (one decimal)', 399: 'T2 actual (one decimal)', 400: 'T1-T2 (one decimal)', 404: 'Meter Type', 473: 'Energy E10', 474: 'Energy E11', 477: 'T3 time average day', 478: 'T3 time average hour', 505: 'P1 average day', 506: 'P2 average day', 507: 'P1 average hour', 508: 'P2 average hour', 675: 'wM-Bus transmission interval', 1001: 'Fabrication No', 1002: 'Time', 1003: 'Date', 1004: 'HourCounter', 1005: 'Software edition', 1010: 'Customer number 1', 1023: 'Power in', 1024: 'Power out', 1032: 'Operation Mode', 1054: 'Voltage L1', 1055: 'Voltage L2', 1056: 'Voltage L3', 1076: 'Current L1', 1077: 'Current L2', 1078: 'Current L3', 1080: 'Power in L1', 1081: 'Power in L2', 1082: 'Power in L3', 1344: 'Power out L1', 1345: 'Power out L2', 1346: 'Power out L3'} module-attribute

pykmp.constants.UNITS_NAMES: Final[Mapping[int, str]] = {0: 'no unit (number)', 1: 'Wh', 2: 'kWh', 3: 'MWh', 4: 'GWh', 5: 'J', 6: 'kJ', 7: 'MJ', 8: 'GJ', 9: 'Cal', 10: 'kCal', 11: 'Mcal', 12: 'Gcal', 13: 'varh', 14: 'kvarh', 15: 'Mvarh', 16: 'Gvarh', 17: 'VAh', 18: 'kVAh', 19: 'MVAh', 20: 'GVAh', 21: 'W', 22: 'kW', 23: 'MW', 24: 'GW', 25: 'var', 26: 'kvar', 27: 'Mvar', 28: 'Gvar', 29: 'VA', 30: 'kVA', 31: 'MVA', 32: 'GVA', 33: 'V', 34: 'A', 35: 'kV', 36: 'kA', 37: '°C', 38: 'K', 39: 'l', 40: 'm³', 41: 'l/h', 42: 'm³/h', 43: 'm³×C', 44: 'ton', 45: 'ton/h', 46: 'h', 47: 'hh:mm:ss', 48: 'yy:mm:dd', 49: 'yyyy:mm:dd', 50: 'mm:dd', 51: 'no unit (number)', 52: 'bar', 53: 'RTC', 54: 'ASCII', 55: 'm³ ×10', 56: 'ton ×10', 57: 'GJ ×10', 58: 'minutes', 59: 'Bitfield', 60: 's', 61: 'ms', 62: 'days', 63: 'RTC-Q', 64: 'Datetime', 65: 'imp/l', 66: 'l/imp', 85: '%RH', 86: '%O₂', 87: 'm/s', 88: 'kJ/kg', 89: 'pH', 90: 'g/kg'} module-attribute

pykmp.constants.ACK_BYTES: Final[bytes] = ByteCode.ACK.value.to_bytes(1, 'big') module-attribute

Data classes & types

pykmp.constants.ByteCode

Bases: Enum

Special byte values on the physical layer.

START_FROM_METER = 64 class-attribute instance-attribute

START_TO_METER = 128 class-attribute instance-attribute

STOP = 13 class-attribute instance-attribute

ACK = 6 class-attribute instance-attribute

STUFFING = 27 class-attribute instance-attribute

pykmp.constants.DestinationAddress

Bases: Enum

Data link layer address.

HEAT_METER = 63 class-attribute instance-attribute

LOGGER_TOP = 127 class-attribute instance-attribute

LOGGER_BASE = 191 class-attribute instance-attribute

pykmp.constants.CommandId

Bases: Enum

CID values for messages.

GET_TYPE = 1 class-attribute instance-attribute

GET_SERIAL = 2 class-attribute instance-attribute

SET_CLOCK = 9 class-attribute instance-attribute

GET_REGISTER = 16 class-attribute instance-attribute

PUT_REGISTER = 17 class-attribute instance-attribute

GET_EVENT_STATUS = 155 class-attribute instance-attribute

CLEAR_EVENT_STATUS = 156 class-attribute instance-attribute

GET_LOG_TIME_PRESENT = 160 class-attribute instance-attribute

GET_LOG_PAST_PRESENT = 161 class-attribute instance-attribute

GET_LOG_ID_PRESENT = 162 class-attribute instance-attribute

GET_LOG_TIME_PAST = 163 class-attribute instance-attribute