Shelly automation using Shelly Dimmer2 - SW2(input) as trigger

I like to make a automation using a Shelly Dimmer2 input (SW1 and SW2).

  • I use “ShellyForHass (Shelly integration)”
  • The SW1 and SW2 is connected to button with spring
 alias: Gæste toilet - Spejl
  description: Tænd spejl
  - type: turned_on
    platform: device
    device_id: c641255fe6dd114a7e0ea7a3dce17c99
    entity_id: binary_sensor.shelly_shdm_2_3c6105e350a9_2_switch
    domain: binary_sensor
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 1
  condition: []
  - type: toggle
    device_id: 597e164d700d92533bc3d225423f2e85
    entity_id: light.shelly_shdm_2_483fda91998f
    domain: light
  mode: single

With this i need to press and hold the SW2 (press and realise button) for a split second and i need it to do the automation when i just fast press the SW2.

  • The action is immediate (When testing the automation)
  • When i test the input in “development tool” the input is done pushing the SW2 for a split second

How to make the trigger work?