danimtb / dasshio

Hass.io add-on to easily use Amazon Dash Buttons with Home Assistant
Apache License 2.0
192 stars 63 forks source link

Toggling Device On/Off Constently #86

Closed gdreelin closed 4 years ago

gdreelin commented 5 years ago

I figured I would start with a simple application of turning on and off a light with the Dash Button so I put this in config.

{ "timeout": 20, "buttons": [ { "name": "wunderbrow", "address": "F0:23:B9:EB:29:90", "domain": "light", "service": "toggle", "service_data": "{\"entity_id\": \"light.master_bulb_1\"}" } ] }

The button will work but with a long delay. The I was sitting there and the light kept going on and off by itself like it was continuously getting a signal from the Add-on. It stopped after I stopped the Add-on. Any ideas?

samelhusseini commented 5 years ago

I'm also seeing a similar issue after a recent update where the addon would make 2 API calls (on and then an immediate off) after a single dash button press.

Here's my log:

2019-04-18 05:00:35,225 | INFO | Finishing sniffing
2019-04-18 05:00:35,226 | INFO | Starting sniffing...
2019-04-18 05:01:15,658 | INFO | Garage Light button pressed!
2019-04-18 05:01:16,941 | INFO | Request: http://hassio/homeassistant/api/services/light/toggle - body: {"entity_id": "light.garage_light"}
2019-04-18 05:01:16,942 | INFO | Status Code: 200
2019-04-18 05:01:16,943 | INFO | Successful request
2019-04-18 05:01:17,036 | INFO | Finishing sniffing
2019-04-18 05:01:17,037 | INFO | Starting sniffing...
2019-04-18 05:01:17,694 | INFO | Garage Light button pressed!
2019-04-18 05:01:19,238 | INFO | Request: http://hassio/homeassistant/api/services/light/toggle - body: {"entity_id": "light.garage_light"}
2019-04-18 05:01:19,239 | INFO | Status Code: 200
2019-04-18 05:01:19,240 | INFO | Successful request
2019-04-18 05:01:19,306 | INFO | Finishing sniffing
2019-04-18 05:01:19,307 | INFO | Starting sniffing...

You can see in the log an API call is made within 3 seconds even though my timeout is set to the default 20 seconds.

gdreelin commented 5 years ago

Yep I am getting the exact information on my logs too.

BertrumUK commented 5 years ago

I am also getting the same issue which is not ideal when I use it for the bedroom fan on the hot nights

2019-04-23 10:07:52,035 | INFO | Bedroom Fan button pressed! 2019-04-23 10:07:52,349 | INFO | Request: http://hassio/homeassistant/api/services/switch/toggle - body: {"entity_id": "switch.bedroom_fan"} 2019-04-23 10:07:52,350 | INFO | Status Code: 200 2019-04-23 10:07:52,350 | INFO | Successful request 2019-04-23 10:07:52,422 | INFO | Finishing sniffing 2019-04-23 10:07:52,422 | INFO | Starting sniffing... 2019-04-23 10:07:57,099 | INFO | Bedroom Fan button pressed! 2019-04-23 10:07:57,143 | INFO | Request: http://hassio/homeassistant/api/services/switch/toggle - body: {"entity_id": "switch.bedroom_fan"} 2019-04-23 10:07:57,143 | INFO | Status Code: 200 2019-04-23 10:07:57,144 | INFO | Successful request 2019-04-23 10:07:57,192 | INFO | Finishing sniffing 2019-04-23 10:07:57,192 | INFO | Starting sniffing...

neilma1 commented 5 years ago

If it helps to have another me too. Mine also started doing the double api call since upgrading to 0.3.6 (Running Hassio 0.91.4) . Thanks Dani!

2019-04-24 21:27:49,163 | INFO | Starting sniffing... 2019-04-24 21:28:09,332 | INFO | racingoptics button pressed! 2019-04-24 21:28:09,364 | INFO | Request: http://hassio/homeassistant/api/services/switch/toggle - body: {"entity_id": "switch.s20famrmspot"} 2019-04-24 21:28:09,365 | INFO | Status Code: 200 2019-04-24 21:28:09,365 | INFO | Successful request 2019-04-24 21:28:09,378 | INFO | Finishing sniffing 2019-04-24 21:28:09,378 | INFO | Starting sniffing... 2019-04-24 21:28:09,723 | INFO | racingoptics button pressed! 2019-04-24 21:28:09,752 | INFO | Request: http://hassio/homeassistant/api/services/switch/toggle - body: {"entity_id": "switch.s20famrmspot"} 2019-04-24 21:28:09,753 | INFO | Status Code: 200 2019-04-24 21:28:09,753 | INFO | Successful request 2019-04-24 21:28:09,774 | INFO | Finishing sniffing 2019-04-24 21:28:09,775 | INFO | Starting sniffing...

xenio commented 5 years ago

I've the same problem, every press is repeted different times, and with toggle on lights is not working.

neilma1 commented 5 years ago

Hi @danimtb Thanks for your hard work on this addon - Have you had a chance to review or acknowledge that this is an issue? Has anyone else found a way or working round this in the interim? (I am using mine to toggle a light switch on and off - However with the problem the light turns on then immediately off :)) So I have re configured mine to just turn the light off.

danimtb commented 4 years ago

This should be fixed by #94 with the fix for the timeout parameter in config. Increase the number of seconds in order to avoid multiple requests with a single button press. Thanks!