PWM for Cpu fans

I have pwmled working with pigpio as an automation to run the twin cooling fans on my armour case. This is my automation

- id: Update Cpu Temperature
  alias: Time to Start Cpu Cooling
  trigger:
    platform: numeric_state
    entity_id: sensor.cpu_temperature
    above: 50
  action:
    service: light.turn_on
    entity_id: light.pwm_cooling_fan
    data_template:
      brightness_pct: '{{ states(''sensor.cpu_temperature'') }}'
- id: Update Cooling
  alias: Time to Stop Cpu Cooling
  trigger:
    platform: numeric_state
    entity_id: sensor.cpu_temperature
    below: 47
  action:
    service: light.turn_off
    entity_id: light.pwm_cooling_fan

I notice that the entity PWM Cooling Fan does not follow the cpu temp as desired by way of the data template.

Can this be improved by making it a closed loop control?