lazcad / homeassistant

Home Assistant Development
249 stars 83 forks source link

Multiple Events for Single Click Button #55

Open choongyouqi opened 7 years ago

choongyouqi commented 7 years ago

My automation script always got triggered 3 times every time I press the xiaomi zigbee button once. any idea? (I verify by putting a pushbullet notifier in the action)

Below is my automation code:

- alias: Turn on SPHERE when button click once
  trigger:
    platform: event
    event_type: click
    event_data:
      entity_id: binary_sensor.switch_158d0001138943
      click_type: single
  action:
    - service: notify.pushbullet
      data_template: {"message": "button single", "target": ["email/myemail@gmail.com"]}
    - service: homeassistant.turn_on
      entity_id: light.hue2__sphere
      data:
        xy_color: [0.4596, 0.4105]
        brightness: 254
        transition: 1
michaelmcarthur commented 7 years ago

@choongyouqi I had the same problem. I updated to the new gateway firmware 1.4.1_147.0143 now it works as expected. This issues seams to come and go depending on firmware.

choongyouqi commented 7 years ago

I suspect the problem could be coming from my routers. I have a fairly complicated setup with 3 routers(2 in repeater mode) in the same subnet. I believe what happen is the multicast got rebroadcast again when it reaches the repeater. The temporary solution is to connect my raspberrypi from ethernet to wifi and the problem seems to fade away for now.

michaelmcarthur commented 7 years ago

I think you could be right. I have 2 routers (one in repeater mode). My issue was it triggered twice yours three times with 3 routers. I will have to investigate if my issue comes back.