PID control of 0-10v heater with excess solar power

Hello
Been looking for an app/rule to control a 0-10v output(feeds heater load) from excess solar export (power).
Found 1 app by Guffman (2020) but this app fails to compile.
https://raw.githubusercontent.com/guffman/Hubitat/master/apps/AmbientLightDimmerController.groovy
Any help with a PID controller would be appreciated
Ok with rule machine, useless with groovy.
Thanks