Modbus.write_register

As I’m not the only one by far to miss a write register function, I’ll not bang on about it here, just reaffirm its desirability.
So for now I’ll use “service: modbus.write_register”.
Two questions are left open by the documentation.
Where do I put it, in modbus.yaml or automations.yaml? I presume the latter, right?
Secondly the value I want to write is a numeric state, currently an input.number but I’m only trying things out for now. How do I write that? The examples in the documentation only show how to write fixed values put down in the source code, no variables.
Danke
Axel