Dynamic Script or automation [Solved]

I want a script (or automation) that when triggered will adjust my AC to + or - X degrees. I tried this with a template script but it didn’t work, here is what I tried:

too_cold:
  sequence:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.thermostat
        temperature:  {{ states("sensor.thermostat_setpoint") | int + 2 }}

Any thoughts?

SOLVED!

too_cold:
  sequence:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.thermostat
        temperature:  '{{ float(states("sensor.thermostat_setpoint")) + 2 }}'