Allow write negative values to modbus

Many heatingproducts use modbus (heatpumps and ventilation etc. All these units handle negative values as read an also in settings so to change these settings from home assistant the modbus component need to be able to send negative values to change (witch isnt possible now)

Have you tried sending the 16bit 2s compliment instead?

1 Like

Havet tried so much more than figure out that voluptous doesnt accept anything under zero

Any chance of this being implemented?

is this really a missing feature or a bug??

I´m trying to use the same in an automation any only can write positive values:

service: modbus.write_register
data:
  address: 30
  slave: 1
  hub: Nibe
  value: -1

dunno but I would be nice just to type the value instead of calculating backwards each time

What do you mean with calculating backwards?

since you must send the value in 16bit 2s compliment you have to calculate and convert it to a another value that yu send for example to get -1 you have to send the value 65535 why can’t home assistant convert it by it self ?

Any update her? This would be very nice

How you calculate those values?

dont remeber exactly but after alot of goolge i found out this:

if you take 65536 - (your your number )
example: you want to send -25, send 65511 (65536-25)

1 Like

Thank you, will try. But according to this you are right.

Please does anyone knows how to call write register “40103” on hassio? I tried address: 102 using service Modbus: Write register (value: 1) but it doesn´t work. What runs is register 40004 reading as address 3. So I thought 40103 will be 102 but seems like this is not true. Anybody?