I would love to see the Modbus spec he used. First I noticed he is reading the first 100 registers in a single read. The documentation we have explicit says inverter will not answer to that, for sure newer models have upgraded spec. He also removed the upper nibble calculation from power, not big deal since most small to medium installs will never reach such a high power. He sure have two arrays because he sums the voltage of vpv1 and vpv2, I did not care for a second array. He takes the inverter temperature from register 97, our documentation says this register is Grid Fault Record 2 (daily | hour)
So, clearly, the modbus spec went through revision for those newer models.