Modbus TCP temperature meter readings, no decimals?

Hi,
I’m using Inveo Nano temperature meter in boiler/heat reservoir. It’s able to output into Inveo MQTT-server, but not my local MQTT. Currently using scrape-sensor for readings (production) and just enabled ModBus TCP as experimental, my long time goal is to use ModBus.

ModBus works with this configuration (I have separate config-files, this is from modbus.yaml):

- name: hub1
  type: tcp
  host: 192.168.1.212
  port: 502
  sensors:
    - name: modbus_temp_varaaja
      unique_id: 6040b6f0-9a9b-11ee-b9d1-0242ac120002
      unit_of_measurement: °C
      state_class: measurement
      device_class: temperature
      scan_interval: 15
      address: 4004
      input_type: holding

My problem is, that output is only whole degrees, without decimal. Accroding to manufacturers documentation, register 4004 is measured temp multiplied by ten, eg. 30.4° C would be 304. Register 4005 returns integer part of measured temp and 4006 decimal part. I tried readings using Schneider’s Modbus tester-app (for Windows) and reading register 4004 really returns reading as described by manufacturer, multiplied by ten (for 30.4°C it is 304). Device is supposed to be able to report negative values, but documentation doesn’t mention format (int, signed, whatever).

I tried Home Assistant ModBus scaling option in config, but it still dropped decimals, and for example, for temp reading 76.5° C I got 7.6° C (scaling 0.1) and 760° C (scaling 10). Without scaling HA gives measured temp without decimals and correctly (for 76.5° C, HA gives integer 76), even if it’s supposed to be multiplied by ten!

By no means this is not big problem, whole degree accuracy is just fine, but it would be nice to know, why HA behaves this way?

LESSON LEARNED: When tinkering with ModBus TCP, I had to restart whole HA on config changes. Quick reload didn’t work / update ModBus-config. Did quite a lot stupid unnecessary work before noticing this behavior. Still, have to say, ModBus TCP is simply cool and elegant.

Edit: code formatting

1 Like

Hi - I have a load of the Inveo Nano temp sensors and I just set up Home Assistant last week. I have connected via MQTT but I also want to connect via modbus.
Did you make more progress ? I have all my Nano sensors configured with fixed IP and it would be great if you could share exactly what you have done ?
I am new to HA.
Thanks so much.

Still no decimals. If I’ll get them, I’m happy, but don’t really need them, it’s still more accurate than old conventional analog meter. I equipped second site with Inveo Hero web sensor (it has more inputs, four total), it works ith following code (comments and sensor names in Finnish, but idea is clear):

- name: hub1
  type: tcp
  host: 10.0.0.123
  port: 502
  sensors:
    - name: modbus_temp_varaaja_T1 #Inveo Hero ModBus
      unique_id: cceca93f-80f3-4443-8d84-d4b429982502 #UUID-generaattorin tekemä
      unit_of_measurement: °C
      state_class: measurement
      device_class: temperature
      scan_interval: 15
      address: 1000
      input_type: holding
    - name: modbus_temp_varaaja_T2 #Inveo Hero ModBus
      unique_id: d4155018-f4eb-496e-8d00-252f6a35f618 #UUID-generaattorin tekemä
      unit_of_measurement: °C
      state_class: measurement
      device_class: temperature
      scan_interval: 15
      address: 1003
      input_type: holding
    - name: modbus_temp_varaaja_T3 #Inveo Hero ModBus
      unique_id: 53e723a7-e851-4216-acc7-594b084424eb #UUID-generaattorin tekemä
      unit_of_measurement: °C
      state_class: measurement
      device_class: temperature
      scan_interval: 15
      address: 1006
      input_type: holding