How can i write a modbus register through MQTT?

Hello,

As another user pointed out, this can be done via scripts. However, an easier option would be to use Modbus MQTT Gateway. Configuration examples for each can be found here:

This can be used to write/read Modbus registers on the RUT device itself, as well as any connected devices.
Hope this helps!

Best regards,