LongPress with Button

Hi all,

I am a little bit confused becahuse I wanted to define a longpress on my enocean button which has been connected voa mqtt from a fhem server.

In works finde, but I am struggling with the long-press. I found a workaround with the trigger.tp_state. but the condition is not working and returns undefined trigger. I do not understand what I have to change in the automation. Can some pls. help to fix this?

alias: Trigger test
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.en_ft55_test_on
    from: "off"
    to: "on"
    id: ein
  - platform: state
    entity_id:
      - binary_sensor.en_ft55_test_off
    from: "off"
    to: "on"
    id: aus
condition:
  - condition: template
    value_template: >-
      {{ trigger.to_state.last_changed - trigger.from_state.last_changed  >
      as_timedelta("00:00:01") }}
    enabled: true
action:
  - if:
      - condition: trigger
        id: ein
    then:
      - type: turn_on
        device_id: 4e27115505fd70e30fa465f29e022456
        entity_id: light.lidl_edison_bulb_2
        domain: light
  - if:
      - condition: trigger
        id: aus
    then:
      - type: turn_off
        device_id: 4e27115505fd70e30fa465f29e022456
        entity_id: light.lidl_edison_bulb_2
        domain: light
mode: single

Spartacus