Skip to content

API reference documentation – constants module

Constants/definitions for the Kamstrup KMP protocol.

Constants

pykmp.constants.REGISTERS: Final[Mapping[int, str]] = {60: 'Heat Energy (E1)', 68: 'Volume', 74: 'Flow', 80: 'Current Power', 86: 'Temp1', 87: 'Temp2', 89: 'Tempdiff', 97: 'Temp1xm3', 110: 'Temp2xm3', 113: 'Infoevent', 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', 266: 'E1HighRes', 1004: 'HourCounter'} 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: 'kW', 22: 'kW', 23: 'MW', 24: 'GW', 25: 'kvar', 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'} 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