Xiaomi Aqara wireless button single click and long click triggering the same

I have 3 different buttons and I’ve tested them all so it’s probably not HW issue on the buttons side (maybe on Gateway?)

Here is my automation for single click :

- alias: Bedroom button single click
  trigger:
    platform: event
    event_type: click
    event_data:
      entity_id: binary_sensor.switch_158d12316c3900
      click type: single
  action:
    - service: light.toggle
      entity_id: group.yeelight_bulbs 

Here is the automation for longclick:

- alias: Bedroom button long click
  trigger:
    platform: event
    event_type: click
    event_data:
      entity_id: binary_sensor.switch_158d12316c3900
      click type: long_click_press
  action:
    - service: input_boolean.toggle
      entity_id: input_boolean.bedroom_ac_next_state

When I single click the button I can see both automations are triggered.
Same when I long click (it’s even worse since the light goes off and back on due to the ‘single click’ automation executed twice)

Were you able to solve this? I am having the same exact problem.

Enable logging for the xiaomi components and check the log

The issue lies in the configuration :slightly_smiling_face:
I accidentally wrote click type with no underline.
Maybe the best practice in this case is an error but… at least I got it to work