Modbus controller role server in esphome

Hello. I’m developing a device that serves power data to an inverter, as substitution of a modbus energy meter. The device get the data from mqtt, and serves it via modbus rtu. I have implemented via micropython in an ESP32, but I wanted to do the same integrated within esphome (to improve the control over the device).
To do this, i tried to implement the example from the esphome.io page.

modbus:
  - uart_id: uart_modbus_server
    id: modbus_server
    role: server

modbus_controller:
  - modbus_id: modbus_server
    address: 0x4
    server_registers:
      - start_address: 0x0002
        value_type: S_DWORD_R
        lambda: |-
          return id(evse_voltage_l1).state;

The example doesn’t function , and the error the system gives is →

Failed config modbus_controller: [source /config/esphome/m5stack-prueba.yaml:70] - [source /config/esphome/m5stack-prueba.yaml:70] modbus_id: modbus_server address: 1 server_registers: [source /config/esphome/m5stack-prueba.yaml:73] 'read_lambda' is a required option for [server_registers]. - [source /config/esphome/m5stack-prueba.yaml:73] [start_address] is an invalid option for [server_registers]. Did you mean [address]? start_address: 0x0002 value_type: S_DWORD_R [lambda] is an invalid option for [server_registers]. Did you mean [read_lambda]? lambda: return id(evse_voltage_l1).state; required key not provided

I hope someone could help me. Thankyou in advance.

Ave,

try the following

uart:
  - id: uart_modbus_server
    tx_pin: 15
    rx_pin: 13
    baud_rate: 9600

modbus:
  - uart_id: uart_modbus_server
    id: modbus_server
    role: server

modbus_controller:
  - modbus_id: modbus_server
    address: 0x4
    server_registers:
      - address: 0x0002
        value_type: S_DWORD_R
        read_lambda: |-
          return 20;

Esphome documentation…
:neutral_face: