Templating climate.set_preset_mode

For some reason templating does not work for my climate.

I am trying two different methods, which both do not work for me:

update_heating:
  alias: "Set heating to a standard value"
  sequence:
    - service: script.set_desired_preset_mode
    - service: climate.set_preset_mode
      data:
        entity_id: climate.toon
        preset_mode: "{{ states('input_select.desired_preset_mode') }}"
        # preset_mode: >
        #   {%   if now().hour < 7 %}Sleep
        #   {% elif now().hour < 9 %}Home
        #   {% elif now().hour < 23 %}Comfort
        #   {% else %}Sleep
        #   {% endif %}

input_select.desired_preset_mode is made like this and the values can be changed:

input_select:
  desired_preset_mode:
    name: 'Desired preset_mode'
    options:
      - Away
      - Comfort
      - Home
      - Sleep
    initial: Away
    icon: mdi:fire