{
  "$schema": "https://raw.githubusercontent.com/nobrega8/mbmap-library/main/schema/mbmap-2.schema.json",
  "mbmap": 2,
  "vendor": "Kostal",
  "model": "KOSTAL Smart Energy Meter",
  "models": ["KOSTAL Smart Energy Meter", "KSEM"],
  "vendor_website": "kostal-solar-electric.com",
  "description": "KOSTAL Smart Energy Meter (KSEM) as Modbus RTU slave (RS485 A/B) or Modbus TCP slave (port 502): internal OBIS power and energy registers",
  "revision": 3,
  "revised": "2026-11-10",
  "source": "KOSTAL Solar Electric, \"KOSTAL Smart Energy Meter - Modbus interface description\" (BA KOSTAL Interface KSEM EN)",
  "sources": [{"title": "KOSTAL Smart Energy Meter Interface description", "url": "https://www.kostal-solar-electric.com/fileadmin/downloadcenter/kse/BA_KOSTAL_Interface_KSEM_EN.pdf", "note": "Sections 3.2 and 3.3: internal instantaneous and energy registers"}],
  "notes": [
    "Registers are read with FC03. Multi-register values are big-endian, high word first; request all registers of a value in one read.",
    "Modbus TCP slave listens on port 502 (802 with TLS). The RS-485 ports are configured in the web interface; the document gives no serial defaults.",
    "Power values are split into + (import) and - (export) registers, each unsigned.",
    "Unlisted registers return exception 0x02. Only the identity part of the KSEM/RM PnP block (8195 and 8196 to 8243) is in this map. Not in this map: the rest of the PnP block (8192 onwards), the SunSpec block (40000-40177), and the energy flow, wallbox, group and sensor blocks."
  ],
  "protocol": "tcp",
  "unit_id": 1,
  "port": 502,
  "byte_order": "big",
  "word_order": "big",
  "address_base": 0,
  "x_status": "official",
  "registers": [
    {"name": "Active power import", "group": "Measurements", "area": "holding", "address": 0, "type": "uint32", "scale": 0.1, "unit": "W", "access": "R", "description": "OBIS 1-0:1.4.0*255"},
    {"name": "Active power export", "group": "Measurements", "area": "holding", "address": 2, "type": "uint32", "scale": 0.1, "unit": "W", "access": "R", "description": "OBIS 1-0:2.4.0*255"},
    {"name": "Reactive power import", "group": "Measurements", "area": "holding", "address": 4, "type": "uint32", "scale": 0.1, "unit": "var", "access": "R", "description": "OBIS 1-0:3.4.0*255"},
    {"name": "Reactive power export", "group": "Measurements", "area": "holding", "address": 6, "type": "uint32", "scale": 0.1, "unit": "var", "access": "R", "description": "OBIS 1-0:4.4.0*255"},
    {"name": "Apparent power import", "group": "Measurements", "area": "holding", "address": 16, "type": "uint32", "scale": 0.1, "unit": "VA", "access": "R", "description": "OBIS 1-0:9.4.0*255"},
    {"name": "Apparent power export", "group": "Measurements", "area": "holding", "address": 18, "type": "uint32", "scale": 0.1, "unit": "VA", "access": "R", "description": "OBIS 1-0:10.4.0*255"},
    {"name": "Power factor", "group": "Measurements", "area": "holding", "address": 24, "type": "int32", "scale": 0.001, "access": "R", "description": "OBIS 1-0:13.4.0*255"},
    {"name": "Frequency", "group": "Measurements", "area": "holding", "address": 26, "type": "uint32", "scale": 0.001, "unit": "Hz", "access": "R", "description": "OBIS 1-0:14.4.0*255"},
    {"name": "Active power import L1", "group": "Measurements", "area": "holding", "address": 40, "type": "uint32", "scale": 0.1, "unit": "W", "access": "R", "description": "OBIS 1-0:21.4.0*255"},
    {"name": "Active power export L1", "group": "Measurements", "area": "holding", "address": 42, "type": "uint32", "scale": 0.1, "unit": "W", "access": "R", "description": "OBIS 1-0:22.4.0*255"},
    {"name": "Reactive power import L1", "group": "Measurements", "area": "holding", "address": 44, "type": "uint32", "scale": 0.1, "unit": "var", "access": "R", "description": "OBIS 1-0:23.4.0*255"},
    {"name": "Reactive power export L1", "group": "Measurements", "area": "holding", "address": 46, "type": "uint32", "scale": 0.1, "unit": "var", "access": "R", "description": "OBIS 1-0:24.4.0*255"},
    {"name": "Apparent power import L1", "group": "Measurements", "area": "holding", "address": 56, "type": "uint32", "scale": 0.1, "unit": "VA", "access": "R", "description": "OBIS 1-0:29.4.0*255"},
    {"name": "Apparent power export L1", "group": "Measurements", "area": "holding", "address": 58, "type": "uint32", "scale": 0.1, "unit": "VA", "access": "R", "description": "OBIS 1-0:30.4.0*255"},
    {"name": "Current L1", "group": "Measurements", "area": "holding", "address": 60, "type": "uint32", "scale": 0.001, "unit": "A", "access": "R", "description": "OBIS 1-0:31.4.0*255"},
    {"name": "Voltage L1", "group": "Measurements", "area": "holding", "address": 62, "type": "uint32", "scale": 0.001, "unit": "V", "access": "R", "description": "OBIS 1-0:32.4.0*255"},
    {"name": "Power factor L1", "group": "Measurements", "area": "holding", "address": 64, "type": "int32", "scale": 0.001, "access": "R", "description": "OBIS 1-0:33.4.0*255"},
    {"name": "Active power import L2", "group": "Measurements", "area": "holding", "address": 80, "type": "uint32", "scale": 0.1, "unit": "W", "access": "R", "description": "OBIS 1-0:41.4.0*255"},
    {"name": "Active power export L2", "group": "Measurements", "area": "holding", "address": 82, "type": "uint32", "scale": 0.1, "unit": "W", "access": "R", "description": "OBIS 1-0:42.4.0*255"},
    {"name": "Reactive power import L2", "group": "Measurements", "area": "holding", "address": 84, "type": "uint32", "scale": 0.1, "unit": "var", "access": "R", "description": "OBIS 1-0:43.4.0*255"},
    {"name": "Reactive power export L2", "group": "Measurements", "area": "holding", "address": 86, "type": "uint32", "scale": 0.1, "unit": "var", "access": "R", "description": "OBIS 1-0:44.4.0*255"},
    {"name": "Apparent power import L2", "group": "Measurements", "area": "holding", "address": 96, "type": "uint32", "scale": 0.1, "unit": "VA", "access": "R", "description": "OBIS 1-0:49.4.0*255"},
    {"name": "Apparent power export L2", "group": "Measurements", "area": "holding", "address": 98, "type": "uint32", "scale": 0.1, "unit": "VA", "access": "R", "description": "OBIS 1-0:50.4.0*255"},
    {"name": "Current L2", "group": "Measurements", "area": "holding", "address": 100, "type": "uint32", "scale": 0.001, "unit": "A", "access": "R", "description": "OBIS 1-0:51.4.0*255"},
    {"name": "Voltage L2", "group": "Measurements", "area": "holding", "address": 102, "type": "uint32", "scale": 0.001, "unit": "V", "access": "R", "description": "OBIS 1-0:52.4.0*255"},
    {"name": "Power factor L2", "group": "Measurements", "area": "holding", "address": 104, "type": "int32", "scale": 0.001, "access": "R", "description": "OBIS 1-0:53.4.0*255"},
    {"name": "Active power import L3", "group": "Measurements", "area": "holding", "address": 120, "type": "uint32", "scale": 0.1, "unit": "W", "access": "R", "description": "OBIS 1-0:61.4.0*255"},
    {"name": "Active power export L3", "group": "Measurements", "area": "holding", "address": 122, "type": "uint32", "scale": 0.1, "unit": "W", "access": "R", "description": "OBIS 1-0:62.4.0*255"},
    {"name": "Reactive power import L3", "group": "Measurements", "area": "holding", "address": 124, "type": "uint32", "scale": 0.1, "unit": "var", "access": "R", "description": "OBIS 1-0:63.4.0*255"},
    {"name": "Reactive power export L3", "group": "Measurements", "area": "holding", "address": 126, "type": "uint32", "scale": 0.1, "unit": "var", "access": "R", "description": "OBIS 1-0:64.4.0*255"},
    {"name": "Apparent power import L3", "group": "Measurements", "area": "holding", "address": 136, "type": "uint32", "scale": 0.1, "unit": "VA", "access": "R", "description": "OBIS 1-0:69.4.0*255"},
    {"name": "Apparent power export L3", "group": "Measurements", "area": "holding", "address": 138, "type": "uint32", "scale": 0.1, "unit": "VA", "access": "R", "description": "OBIS 1-0:70.4.0*255"},
    {"name": "Current L3", "group": "Measurements", "area": "holding", "address": 140, "type": "uint32", "scale": 0.001, "unit": "A", "access": "R", "description": "OBIS 1-0:71.4.0*255"},
    {"name": "Voltage L3", "group": "Measurements", "area": "holding", "address": 142, "type": "uint32", "scale": 0.001, "unit": "V", "access": "R", "description": "OBIS 1-0:72.4.0*255"},
    {"name": "Power factor L3", "group": "Measurements", "area": "holding", "address": 144, "type": "int32", "scale": 0.001, "access": "R", "description": "OBIS 1-0:73.4.0*255"},
    {"name": "Minimum active power+", "group": "Measurements", "area": "holding", "address": 146, "type": "uint32", "scale": 0.1, "unit": "W", "access": "R"},
    {"name": "Active energy import", "group": "Energy", "area": "holding", "address": 512, "type": "uint64", "scale": 0.1, "unit": "Wh", "access": "R", "description": "OBIS 1-0:1.8.0*255"},
    {"name": "Active energy export", "group": "Energy", "area": "holding", "address": 516, "type": "uint64", "scale": 0.1, "unit": "Wh", "access": "R", "description": "OBIS 1-0:2.8.0*255"},
    {"name": "Reactive energy import", "group": "Energy", "area": "holding", "address": 520, "type": "uint64", "scale": 0.1, "unit": "varh", "access": "R", "description": "OBIS 1-0:3.8.0*255"},
    {"name": "Reactive energy export", "group": "Energy", "area": "holding", "address": 524, "type": "uint64", "scale": 0.1, "unit": "varh", "access": "R", "description": "OBIS 1-0:4.8.0*255"},
    {"name": "Apparent energy import", "group": "Energy", "area": "holding", "address": 544, "type": "uint64", "scale": 0.1, "unit": "VAh", "access": "R", "description": "OBIS 1-0:9.8.0*255"},
    {"name": "Apparent energy export", "group": "Energy", "area": "holding", "address": 548, "type": "uint64", "scale": 0.1, "unit": "VAh", "access": "R", "description": "OBIS 1-0:10.8.0*255"},
    {"name": "Active energy import L1", "group": "Energy", "area": "holding", "address": 592, "type": "uint64", "scale": 0.1, "unit": "Wh", "access": "R", "description": "OBIS 1-0:21.8.0*255"},
    {"name": "Active energy export L1", "group": "Energy", "area": "holding", "address": 596, "type": "uint64", "scale": 0.1, "unit": "Wh", "access": "R", "description": "OBIS 1-0:22.8.0*255"},
    {"name": "Reactive energy import L1", "group": "Energy", "area": "holding", "address": 600, "type": "uint64", "scale": 0.1, "unit": "varh", "access": "R", "description": "OBIS 1-0:23.8.0*255"},
    {"name": "Reactive energy export L1", "group": "Energy", "area": "holding", "address": 604, "type": "uint64", "scale": 0.1, "unit": "varh", "access": "R", "description": "OBIS 1-0:24.8.0*255"},
    {"name": "Apparent energy import L1", "group": "Energy", "area": "holding", "address": 624, "type": "uint64", "scale": 0.1, "unit": "VAh", "access": "R", "description": "OBIS 1-0:29.8.0*255"},
    {"name": "Apparent energy export L1", "group": "Energy", "area": "holding", "address": 628, "type": "uint64", "scale": 0.1, "unit": "VAh", "access": "R", "description": "OBIS 1-0:30.8.0*255"},
    {"name": "Active energy import L2", "group": "Energy", "area": "holding", "address": 672, "type": "uint64", "scale": 0.1, "unit": "Wh", "access": "R", "description": "OBIS 1-0:41.8.0*255"},
    {"name": "Active energy export L2", "group": "Energy", "area": "holding", "address": 676, "type": "uint64", "scale": 0.1, "unit": "Wh", "access": "R", "description": "OBIS 1-0:42.8.0*255"},
    {"name": "Reactive energy import L2", "group": "Energy", "area": "holding", "address": 680, "type": "uint64", "scale": 0.1, "unit": "varh", "access": "R", "description": "OBIS 1-0:43.8.0*255"},
    {"name": "Reactive energy export L2", "group": "Energy", "area": "holding", "address": 684, "type": "uint64", "scale": 0.1, "unit": "varh", "access": "R", "description": "OBIS 1-0:44.8.0*255"},
    {"name": "Apparent energy import L2", "group": "Energy", "area": "holding", "address": 704, "type": "uint64", "scale": 0.1, "unit": "VAh", "access": "R", "description": "OBIS 1-0:49.8.0*255"},
    {"name": "Apparent energy export L2", "group": "Energy", "area": "holding", "address": 708, "type": "uint64", "scale": 0.1, "unit": "VAh", "access": "R", "description": "OBIS 1-0:50.8.0*255"},
    {"name": "Active energy import L3", "group": "Energy", "area": "holding", "address": 752, "type": "uint64", "scale": 0.1, "unit": "Wh", "access": "R", "description": "OBIS 1-0:61.8.0*255"},
    {"name": "Active energy export L3", "group": "Energy", "area": "holding", "address": 756, "type": "uint64", "scale": 0.1, "unit": "Wh", "access": "R", "description": "OBIS 1-0:62.8.0*255"},
    {"name": "Reactive energy import L3", "group": "Energy", "area": "holding", "address": 760, "type": "uint64", "scale": 0.1, "unit": "varh", "access": "R", "description": "OBIS 1-0:63.8.0*255"},
    {"name": "Reactive energy export L3", "group": "Energy", "area": "holding", "address": 764, "type": "uint64", "scale": 0.1, "unit": "varh", "access": "R", "description": "OBIS 1-0:64.8.0*255"},
    {"name": "Apparent energy import L3", "group": "Energy", "area": "holding", "address": 784, "type": "uint64", "scale": 0.1, "unit": "VAh", "access": "R", "description": "OBIS 1-0:69.8.0*255"},
    {"name": "Apparent energy export L3", "group": "Energy", "area": "holding", "address": 788, "type": "uint64", "scale": 0.1, "unit": "VAh", "access": "R", "description": "OBIS 1-0:70.8.0*255"},
    {"name": "Vendor name", "group": "Device", "area": "holding", "address": 8196, "type": "string", "length": 16, "access": "R", "description": "KSEM/RM PnP block, padded with NUL bytes"},
    {"name": "Product name", "group": "Device", "area": "holding", "address": 8212, "type": "string", "length": 16, "access": "R", "description": "KSEM/RM PnP block, padded with NUL bytes"},
    {"name": "Serial number", "group": "Device", "area": "holding", "address": 8228, "type": "string", "length": 16, "access": "R", "role": "serial", "description": "KSEM/RM PnP block, padded with NUL bytes"},
    {"name": "Firmware major", "group": "Device", "area": "holding", "address": 8195, "type": "uint16", "bit": 8, "bits": 8, "access": "R", "role": "firmware", "description": "KSEM/RM PnP block: 0x0103 is 1.3.x"},
    {"name": "Firmware minor", "group": "Device", "area": "holding", "address": 8195, "type": "uint16", "bit": 0, "bits": 8, "access": "R", "role": "firmware", "description": "KSEM/RM PnP block: 0x0103 is 1.3.x"}
  ]
}
