Modbus write negative value to register

Hi i want a automation to write a negative value to a modbus register. It work fine when i sent values abowe 0 but not under. Error says data must be at least 0. How can i make a walkaround to send ex. - 600?

I tried copy modbus.py to custom component and named it modbus1 in domain to make another modbus plugin. i also changed validation to vol.All(int) but now i get an “unkown” error like the service cant handle the negative symbol (-) (it works fine when i send positive values). Any ideas to get it solved?

Try sending 64936, which is the 16bit 2’s compliment representation of -600.

1 Like

hello, how should I enter the “64936” (-600) to be able to write a negative number on the register? in calling the “write_register” service I use this:
hub: hub1
unit: 2
address: 10
value: ‘64936’
it’s right??