Modbus¶
Sensors - Modbus RTU (RS485)¶
It is possible to operate up to 5 independent devices on a single Modbus bus. The configuration consists in selecting the module and entering its slave ID.
Support for the following modules is built-in:
- SDM120
- SDM72D-M
- Epever Tracer
- Sofarsolar
- SDM630/72D-v2
- CHINT-DTSU666
In addition, it is possible to add support for other Modbus devices using the adding own/custom modules feature.
Custom devices¶
The function allows you to configure data reading from any module that supports the Modbus protocol. To do this, open the configuration panel by clicking the Configure custom modules button. You can save up to 5 different configurations.
In the form, enter your own name for module, communication data (bitrate, parity bit, stop bit, delay between register reads (in s)) and define the list of readings. For each reading, specify the name, unit, divisor, register address, function code, type (kind) and endian. After completing the configuration, confirm with the Save changes button. Then the configuration can be selected on each of the five slots.
The configuration can be exported to a file by clicking the Export configuration button and loaded by clicking Import configuration (save changes after import).
More configuration files are available at our forum. However, please be aware that these configurations might have been contributed by other users, and as such, we cannot guarantee their accuracy or proper functioning. While we strive to curate and verify the content, we encourage you to exercise caution when using these configurations. Your feedback and experiences with these configurations are valuable to the community and can help ensure their reliability.
Reading mapping¶
Reading mapping allows selected measurement values to be used in other LK functions such as the HTTP client, MQTT client, OLED, VOLED, LTE Modem, or Events.
This function applies to readings originating from:
- Modbus modules,
- additional I2C sensors,
- the Dynamic energy prices function (variable
m1).
To use these readings outside their original configuration tab, mapping to variables m1 – m30 must be configured.
In the case of the Dynamic energy prices function, the current energy price is periodically written to variable m1 (when retrieving data from the API and after saving the configuration). This does not require manual mapping.
The Configure mapping to variables m1–m30 button, which opens the configuration form (shown in the image below), is available:
- on the Modbus page,
- in the I2C tab (for additional sensors).
A specific reading position (slot and reading number) is assigned to a given m variable. This is important when changing the configuration of Modbus modules or I2C sensors — the mapping remains assigned to the selected slot and reading number, even if no module or sensor is currently detected in that slot.
Variables m1 – m30 can then be used in:
- the HTTP client,
- the MQTT client,
- OLED,
- VOLED,
- LTE Modem.
The first 10 variables (m1–m10) are also available in the Events function.
Variables m1 – m4 can additionally be selected in the Power and Energy tab in the I field.
In this case, the selected m variable is treated as the source of the power value.
Commands - Modbus RTU (RS485)¶
Available since SW 1.42
This function allows you to define Modbus RTU (RS485) write commands, which can then be executed manually, via the API, or from other device functions.
You can configure up to 10 command entries, each containing the following parameters:
- custom command name,
- RS485 communication parameters,
- Modbus device address (slave id),
- Modbus function code,
- register address,
- data to be written.
The following Modbus function codes are supported:
0x05– write a single bit,0x06– write a single register,0x0F– write multiple bits,0x10– write multiple registers.
Commands can be executed:
- manually – using the command test button,
- from the API,
- as Events function actions,
- as Schedule function actions.
Modbus TCP Server¶
Form for enabling Modbus TCP Server and table with information about available data.




