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