Setting up a basic PID controller using a temperature sensor, and a power switch & PWM

I just reviewed your PWM code and i think found the reason why it’s not working.

You defined a command in your item action but the command should be empty.

Pulse Width Modulation (PWM) Automation - Automation | openHAB.