Xiaomi Doorbell Switch Automation Issue

Hi

I have been having a load of phantom doorbell rings with the WEMOS D1, tried the resistors, with no real luck, so U decided to MOD a Xiaomi Smart Switch that works well, however I cant get the folllowing automation to work, even though the doorbell ring that is based on the same trigger does work, any ideas

- alias: 'Notify DoorBell Pressed GH'
  initial_state: 'on'
  trigger:
    platform: event
    event_type: click
    event_data:
      entity_id: binary_sensor.switch_158d0001d8f5bb
      click_type: single
  action:
  - service: camera.snapshot
    data_template:
      entity_id: camera.front_door_camera
      filename: "/home/homeassistant/.homeassistant/www/snapshots/front_door_camera_{{trigger.to_state.last_changed}}.jpg"
  - service: notify.ios_iphone
    data_template:
      message: 'Someone has pressed the door bell at {{now().strftime("%H:%M %d-%m-%y")}}'
      data:
        attachment:
          content-type: jpeg
          url: "https://myurl:8123/local/snapshots/front_door_camera_{{trigger.to_state.last_changed|urlencode}}.jpg"
        entity_id: camera.front_door_camera

Does the device use a long press rather than a click? Most doorbells people keep their finger on for a few seconds.

I tried this but still couldn’t get the automation to work. however I have adapted a Xiaomi Door/Window Sensor Switch and works a treat :slight_smile: