Surely I can share my code/nodes Hopefully you can get something out of it.
All the data gathering is in this flow.
Whenever I have calculated values to send as InWRte, OutWRte, StorCtl_Mod or ChaGriSet then I send the values throug this function:
InWRte, OutWRte, StorCtl_Mod or ChaGriSet
Before sending into the “Modbus execute” group:
Likewise I use the function node to send WMaxLim_Ena and WMaxLimPct in the same Modbus command, - also to the Modbus execute group.
Lots of the other nodes has been refactored and are primarily used as very specific calculations for our house, and most can only be used coherent with my other flows and specific data from Home Assistant.
Hope the above gives you some ideas - and if you find anything not working out, please write so I can change it