PI-controller made by Homey script

Hello
Anyone who has a Homey script for a PI-controller? Tentative a PID?
I have no knowledge for programming, but if someone have to share I would be very greatful for that. I tried Chat GPT, but none of those worked.

That would be excelent, and intergrade it in the flow building blocks

I managed to make a kind of PI-controller by using som math-blocks. Integration was harder, but used better logic to increase/decrease value by use of date/time flowcard and some condition.
Not accurate, but good enough. Now all heaters are connected with powerregulator to adjust output 0-100%