doudz / homeassistant-zigate

zigate component for Home Assistant
MIT License
48 stars 15 forks source link

Aqara button click not detected #79

Closed bokub closed 4 years ago

bokub commented 4 years ago

Hi ! First of all, thanks for this amazing component !

So I have a simple aqara button. If I click one or multiple times, the zigate.xxx entity is updated as expected, but most of the times, the associated binary_sensor.xxx (single click) and sensor.xxx (multi-click) are not updated...

image

So I can detect when the button is clicked, but I cannot really differentiate a single click from a double or triple click...

I tried subscribing to zigate.attribute_updated, but what happens when I click 2 times is that it triggers 2 events !

I know it looks like #42 but is there a way to fix that ? Maybe a way to increase the timeout between 2 events ? Thanks a lot 👍

doudz commented 4 years ago

For single click I use something like this:

trigger:
  - event_data:
      attribute: 0
      cluster: 6
      endpoint: 1
      ieee: 00158d00016c487e
      value: true
    event_type: zigate.attribute_updated
    platform: event
bokub commented 4 years ago

Yeah, I managed to solve the problem using events, as suggested

For single click:

trigger:
  - event_data:
      entity_id: zigate.my_button
      name: onoff
      value: true

For multiclick:

trigger:
  - event_data:
      entity_id: zigate.my_button
      name: multiclick
      value: 2

And, the most important thing to know:

Multi clicks should not be too fast, or they will be detected as multiple single clicks