Switch template error

- platform: template
  switches:
    computer:
      value_template: "{% if is_state('switch.wol', 'on') %}on{% else %}off{% endif %}"
      turn_on:
        service: switch.turn_on
        entity_id: switch.wol
      turn_off:
        service: switch.turn_off
        entity_id: switch.pc

Why is this giving me the following errot?

17-03-23 11:17:30 ERROR (MainThread) [homeassistant.config] Invalid config for [switch.template]: invalid template (TemplateSyntaxError: unexpected ‘%’) for dictionary value @ data[‘switches’][‘computer’][‘value_template’]. Got “{{% if is_state(‘switch.wol’, ‘on’) %}on{% else %}off{% endif %}}”.

Initial double {{ instead of single {?

Nope i tried that

value_template is supposed to equate to true or false not on or off. If you just replace it with
"{{is_state('switch.wol', 'on')}}"
it should work.