Kostal Kostal Smart Energy Meter (via inverter) (grid) Modbus TCP template

Kostal Smart Energy Meter (via inverter) (grid)

The Kostal Smart Energy Meter (KSEM) is a three-phase energy meter used in Kostal solar installations to measure grid import and export at the grid connection point. This template reads the KSEM's grid power value via the Kostal inverter's own Modbus TCP interface, using register 252 to expose total active power in watts. Positive values indicate power drawn from the grid; negative values indicate feed-in. Connecting the ModbusCloud Gateway to the inverter's LAN port gives installers and building owners continuous visibility into real-time grid exchange without a separate meter connection.

Protocol
Modbus TCP
Connection
Ethernet, Modbus TCP
Registers
1, read only
Brand
Kostal
Last updated

Registers (1)

1 read, 0 write

NameUnitAccessAddress (Hidden until you enter your email)Function (hidden)Type (hidden)
powerWRead

Loading registers…

Send your device list

If a device is not in the library yet, we build the template for free as soon as we have the register data.

Number of installations (optional)

Use cases

  • Monitor real-time grid import and export power to verify net-metering correctness at the grid connection point.
  • Alert on sustained grid import above a threshold to detect inverter or battery underperformance during peak PV hours.
  • Track sign changes in the power register to log the daily transition time from grid import to self-sufficiency mode.
  • Compare grid power readings over multiple days to verify that feed-in limitation settings are being respected.
  • Report grid exchange data to building owners or facility managers as part of monthly energy balance reports.

Installation

  1. Enable Modbus TCP on the Kostal inverter by navigating to the inverter web interface, opening the communication or Modbus section, and activating the Modbus TCP server; note the default port is 1502 and the default unit ID is 71.

  2. Confirm that the Kostal Smart Energy Meter is configured as sensor position 2 (grid connection) in the inverter settings, which determines the sign convention of register 252.

  3. Connect the ModbusCloud Gateway to the same LAN as the inverter using an Ethernet cable, then in the ModbusCloud portal add a new device, import this template, and set the host to the inverter IP address, port 1502, and unit ID 71.

  4. Verify the connection by reading the power register in the ModbusCloud portal live view: a plausible positive or negative watt value confirms correct decoding; if the value is astronomically large, check that the inverter byte order is set to little-endian (CDAB) under the Modbus or SunSpec settings.

Things to watch for

Why does the power register return an impossibly large value?

This is almost always a byte-order mismatch. Register 252 on the Kostal inverter uses little-endian word order (CDAB, also called float32s or swapped float). If the inverter Modbus or SunSpec byte order is set to big-endian (ABCD), the float32 bytes are read in the wrong sequence, producing garbage values in the trillions of watts. Set byte order to little-endian (CDAB) in the inverter web interface under the Modbus or SunSpec settings.

The register reads what looks like house consumption, not grid power. Why?

Register 252 changes meaning depending on which sensor position the KSEM occupies in the inverter configuration. For grid import and export, the KSEM must be assigned to sensor position 2 (grid connection) in the inverter settings. If it is assigned to sensor position 1 (home consumption), the register reports house consumption with the opposite sign convention.

The gateway connects but the power value never updates. What now?

Confirm that Modbus TCP is actively enabled on the inverter, not just the KSEM. The inverter's Modbus TCP server listens on port 1502 by default, not the standard port 502. Verify port 1502 is reachable from the ModbusCloud Gateway, that no firewall rule blocks it, and that the unit ID is set to 71 in the portal template assignment.

Values oscillate between correct readings and near-zero every few seconds. What causes this?

Intermittent oscillation typically means another Modbus client is competing for the same TCP connection to the inverter. The Kostal inverter allows only a limited number of simultaneous Modbus TCP connections. Ensure no other home-automation system (such as a parallel EVCC or ioBroker instance) is polling the same inverter address and port at the same time.

Want to see how it works?

Electrician working in an open distribution board