I have a modbus device with address 26 that shows the temperature, here are its data types on the screenshot, I can’t understand how to write all this in yaml correctly.
modbus:
- name: modbus_hub
type: tcp
host: 192.168.0.15
port: 502
sensors:
- name: sensor1
address: 8
input_type: input
data_type: float16 # or maybe int16
swap: byte # for little endian. Modbus is usually big endian, yours is not, see below
modbus:
- name: modbus_hub
type: tcp
host: 192.168.0.15
port: 502
sensors:
- name: sensor1
slave: 26 # <- Device address
address: 8 # <- Register address
input_type: input
data_type: float16 # or maybe int16
swap: byte # for little endian. Modbus is usually big endian, yours is not, see below
You can also use device_address: instead of slave: if you don’t like that word.
I can’t link directly to this in the documentation because it has the same relative url as another section but it is there at the top of the entities configuration section, it applies to all entities:
I need to apply the formula in_Value = (in_Value-830)*0.026666 to the value from the modbus sensor; that is, first do the subtraction and then the multiplication, using offset: -830 and scale: 0.026666 on the docks, multiplication occurs first, and then subtraction, can this be changed somehow ?
I have the same problem! When the sensor is connected, the readings differ from the real ones.
The SHT20 sensor reads both temperature and humidity. If I read only one value (either temperature or humidity), then the readings are correct, but if I read both, then the temperature is too low and the humidity is too high!
I understand that you can write a correction, but:
this is not correct - after entering the coefficient, I try to breathe into the sensor and it shows me a temperature of 70°C;
when connecting any one sensor, the readings are correct, which means it can work without corrections!
my code: