Restricting modbus value to minimum

I’m reading values of an SMA solar inverter via modbus.
When the inverter is working one specific value is OK, but for some reason, when the sun goes down, the value goes to 0x80000000. I read this value as an int32, so it’s converted to -2147483648.
Is there a way to change negative numbers to 0 ? Preferably on the input-side.

Hello @Koenraad,
Are you using the mobus telegraf input plugin?
You can use the execd processor plugin. To convert those values.

Thanks for your response.
After my post I did further research and came to the same conclusion. However, …
I installed golang and “wrote” (copy/paste from the Internet) a “hello world” program which worked OK after compiling. Then I copied the example program of the execd plugin. That didn’t compile. It complained about those github imports. Unfortunately, I can’t specify more, the hard-disk of my laptop crashed so I can’t recreate the process and output at the moment.

But, I found a solution. The value I’m reading is the actual powerproduction. My inverter is 5000W, so why would the value need a 32bit number as specified by the supplier ? So I used the LSByte as the value. That seems to work. I activated this last night, so I’m waiting to see if it’s really a solution.
One caveat : it seems I need to read the 4 bytes.
Before :

     { name = "Pac",    byte_order = "ABCD",   data_type = "INT32", scale=1.0,  address = [30775,30776]},

This is my config now :

     { name = "Pac",    byte_order = "AB",   data_type = "INT16", scale=1.0,  address = [30776]},
     { name = "PacH",    byte_order = "AB",   data_type = "INT16", scale=1.0,  address = [30775]},

I need to read the PacH, or the value is still wrong.