Where best to process modbus values

I have a modbus configuration reading the holding registers of my Goodwe inverter. The sensors look like this

- name: GW8_Vac1

        slave: 247

        input_type: holding

        address: 772

        count: 1

        data_type: int16

        precision: 2

        scan_interval: 5

        unit_of_measurement: V

        device_class: voltage

this works fine but the receive data must be divided by 10 to reperesent the true value.
where and how can I best do this division? in the configuration.yaml or in another file?

I don’t use it but looks like can set scale and offset. So scale = 0.1 should do it

works partly.
indeed it scales down the received value but because the value is an int, I loose the decimal.
changing the type to float does not work.
but adding the parameter precision: 1 does the job

You can do that in a template based on the modbus data

      grid_consumption_energy_wh:
        unit_of_measurement: 'Wh'
        value_template: "{{ (states('sensor.modbus_importenergy_a')|float) * 1000 }}"