the last version I installed was OpenWrt 18.06.1 I currently have not tried on anything newer- but I would think it works still
nano /usr/bin/stat-genconfig
then scroll down on that file you will see a section that starts
plugins = {
just paste
modbus = config_modbus,
I pasted mine just above netlink = { and after the close bracket for memory },
if you did everything correctly from above and installed collectd-mod-modbus, libmodbus
you should get a a window in luci-statistics that looks like this
then you can configure for your modbus setting