Setting binary sensor based event conditional template

Basically want to turn on binary sensor for 5 sec if and event met the condition.
meaning if the 2 of conditions( logical and) is true → set on the binary sensor
It does pass validation - but no binary sensor created .


template:
  trigger:
    platform: event
    event_type: dahua_vto
  condition:
    condition: template 
    value_template: >
      {{ (trigger.event.data["Code"] =='BackKeyLight') and (trigger.event.data["Data"]["State"] | int in [0,5] )}}
  binary_sensor:
    - name: intercom call
      auto_off: 5
      state: "true"