OpenEMS Modbus-API (pv)
The OpenEMS Modbus-API is a software interface built into the OpenEMS Edge energy management platform, exposing internal channels to external systems over Modbus TCP. The PV variant of this template targets the photovoltaic production component of an OpenEMS installation. It reads two channels from the configured PV component: instantaneous production power at address 327 and cumulative produced energy at address 367. Both are floating-point values updated every cycle. Connecting ModbusCloud Gateway to the OpenEMS Edge TCP port gives installers a live view of solar yield and long-term production totals without modifying the EMS configuration.
- Protocol
- Modbus TCP
- Connection
- Ethernet, Modbus TCP
- Registers
- 2, read only
- Brand
- OpenEMS
- Compatible models
- Modbus-API
- Last updated
Registers (2)
2 read, 0 write
| Name | Unit | Access | Address (Hidden until you enter your email) | Function (hidden) | Type (hidden) |
|---|---|---|---|---|---|
| power | W | Read | |||
| energy | Wh | Read |
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.
Use cases
- Monitor instantaneous PV production power to verify the inverter is operating within expected output levels.
- Track cumulative PV energy over time to calculate monthly and annual solar yield per site.
- Alert on zero production power during daylight hours to detect inverter faults or communication failures.
- Compare daily production totals across multiple OpenEMS sites in the ModbusCloud multi-site overview.
- Verify that the energy counter increases continuously after firmware or configuration changes on the EMS.
Installation
Enable the Modbus-TCP API controller in OpenEMS Edge via Apache Felix Web Console under the 'Controller Api Modbus TCP' component, and confirm that the PV component is included in the exported channel list.
Connect the ModbusCloud Gateway to the same IP network as the OpenEMS Edge host, ensuring TCP port 502 (or the configured Modbus port) is reachable from the Gateway.
In the ModbusCloud portal, add the Gateway, import the OpenEMS Modbus-API (pv) template, and set the unit ID to match the Modbus slave ID configured in the OpenEMS controller.
Spot-check the connection by confirming that the power register at address 327 returns a non-null float value during daylight hours; if it reads zero at midday, verify the component ID mapping in the OpenEMS Modbus register export.
Things to watch for
Why does the power register return 0 during daylight hours?
The OpenEMS Modbus-API maps channels dynamically based on which components are exported. If the PV component is not included in the Modbus-API controller's component list, register 327 will return 0 or null. Open the OpenEMS UI, navigate to the Modbus-API controller configuration, and verify that the PV component ID is listed as an exported component.
Why do I get NaN or invalid float values on register 327?
Register 327 uses a 32-bit IEEE 754 float spanning two consecutive Modbus registers. Some polling tools interpret these as two separate 16-bit integers. Ensure your Modbus client (or ModbusCloud template) reads two registers starting at address 327 and decodes them as a single float32 in big-endian byte order, which is the OpenEMS default.
The gateway connects but register 367 reads stale or frozen values.
Register 367 holds a float64 energy counter across four consecutive registers. If the polling request spans fewer than four registers, the value will be incomplete or appear frozen. Confirm the Modbus read length covers all four registers (367 to 370 inclusive) and that function code 3 is used, matching the register's holding-register type.
Modbus connection is refused even though OpenEMS Edge is running.
The Modbus-TCP API controller must be explicitly activated in OpenEMS Edge. A running Edge instance does not expose Modbus by default. Check in the Apache Felix Web Console that a component of type 'Controller.Api.ModbusTcp.ReadOnly' or 'ReadWrite' is active, and confirm no firewall rule blocks TCP port 502 between the ModbusCloud Gateway and the Edge host.
Want to see how it works?








