Question about logic if else

what i can to take instead of “None” ? i dont want to see such errors in log
How correctly should this condition look?

  - service: switch.turn_on      
    data_template:
      entity_id: >
        {% if states.input_boolean.alarmcomp.state == "on" %}
          switch.on_off_comp
        {% else %}
          None
        {% endif %}

Instead of using a data template just put the test as a condition of the automation.