Modbus sensor scale 0.1 changes 184 to 18 instead of 18.4

Modbus register contains an integer of temperature multiplied by 10.
I can simply convert it to “normal” value with template sensor.

Is it possible to get “normal” value from modbus sensor itself, without additional template sensor?

I have tried to use scale and data_type parameters, but failed.

My configuration:

modbus:
  name: Z031
  type: tcp
  host: 192.168.1.200
  port: 502

sensor:
  - platform: modbus
    scan_interval: 1
    registers:
      - name: _test_asis
        hub: Z031
        register: 30000
      - name: _test_scale
        hub: Z031
        register: 30000
        scale: 0.1
      - name: _test_float
        hub: Z031
        register: 30000
        data_type: float
      - name: _test_float_and_scale
        hub: Z031
        register: 30000
        data_type: float
        scale: 0.1

Results are:
184
18
0
0

Needed: 18.4

Found solution.

sensor:
  - platform: modbus
    scan_interval: 1
    registers:
      - name: _test_OK
        hub: Z031
        register: 30000
        scale: 0.1
        precision: 1
3 Likes