The code as written iterates the duty cycle to the correct place to have the average temperature equal the target. I've never seen a need to try it with Ki equal to anything except zero, so I guess it is more of a PD controller than a PID controller.
I thought I'd try to be helpful so this implementation could be fixed (should be pretty simple) so it works with the integral turned on, but...
Let us know how your version works, and how the performance compares to the version described by @Glorious1 .
the first response is passive aggressive. I had heard the freenas forums had gotten better. Guess not.