HELP to make a template for aqara FP1 ZHA

I have active do automations with the events of the aqara fp1 using a simple input boolean automation, but I want to convert this on a binary sensor. has anyone acomplished this?
this is my automation

alias: motion fp1
description: ""
trigger:
  - device_id: 3f952b48b452c16df229506b191be538
    domain: zha
    platform: device
    type: Enter
    subtype: sensor
    id: Enter
  - device_id: 3f952b48b452c16df229506b191be538
    domain: zha
    platform: device
    type: Approach
    subtype: sensor
    id: Approach
  - platform: state
    entity_id:
      - binary_sensor.aqara_fp1
    from: "on"
    to: "off"
    for:
      hours: 0
      minutes: 1
      seconds: 0
    id: "OFF"
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Enter
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.motion_fp1
      - conditions:
          - condition: trigger
            id: Approach
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.motion_fp1
      - conditions:
          - condition: trigger
            id: "OFF"
        sequence:
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.motion_fp1
mode: single

I would like to make this simpler with a template or something that give me a binary motion sensor. thanks in advance

Hello @Alexis_Iglesias , I stumbled upon your question trying to do the same, and managed to get it up and running.

This example has a two sensors, one a binary motion sensor using the event (instant response) and an enum sensor for more advanced automations. Hope it helps.

- trigger:
    - platform: event
      event_type: zha_event
      event_data:
        device_ieee: <<your device ieee e.g. 54:ef:44:11:05:58:4e:31>> 
  binary_sensor:
    - name: "Living room Instant MS"
      state: >
        {{trigger.event.data.command!="Away" and trigger.event.data.command!="Leave"}}
      icon: mdi:motion-sensor
      device_class: motion
  sensor:
    - name: "Living room MS command"
      state: "{{ trigger.event.data.command }}"
      device_class: enum