Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More than one click recognised #9

Open
sejoki opened this issue Nov 24, 2016 · 25 comments
Open

More than one click recognised #9

sejoki opened this issue Nov 24, 2016 · 25 comments

Comments

@sejoki
Copy link

sejoki commented Nov 24, 2016

I played around with the dash buttons and figured I could make them do more than one thing, not only depending on sunrise/sunset, but also if it was on/off.
Since for me, the integration into home app doesn't seem to be working, I'm setting up my actions with Eve. I added two dummy switches, which are linked to a scene, so in theory, if I press the button and the switch is off, it triggers a scene and sets the switch to on. If I press it again and the switch is on, it triggers a different scene.

A great theory, there's one issue though, which is caused by the way the dash buttons work. It tries to enter the network more than once, hence more than one "click" is recognised. So if scene A is triggered to turn on one light and turn on the virtual button and scene B to turn of the light if the virtual button is on, it activates scene A and a couple of seconds later activates scene B, because the button is seemingly pressed again after the virtual switch has been set.

In node bin/findbutton I get the following:

Possible dash hardware address detected: ac:63:be:02:87:2e Manufacturer: Amazon Technologies Inc. Protocol: udp Possible dash hardware address detected: ac:63:be:02:87:2e Manufacturer: Amazon Technologies Inc. Protocol: udp Possible dash hardware address detected: ac:63:be:02:87:2e Manufacturer: Amazon Technologies Inc. Protocol: arp

Can you add some sort of a timeout that after the initial click, it ignores further clicks for 10-15 seconds?

@kolossboss
Copy link

I'm not sure what exactly do you want to do. Only switch a light on and off? For me the button only sends only one click and rhe follow works perfectly.
And pls try to use the app Hesperus. Hesperus supported to Dash Button a way more better then Eve oder Home.app.

Try this:

Automation 1.
If Dash pressed and switch off then switch on.

Automation 2.
If Dash pressed and switch on then switch off.

@sejoki
Copy link
Author

sejoki commented Nov 24, 2016

No, the issue isn't the setup of the automation rule. It's that every button click is recognised twice, which results in the rules cancelling each other.

The find button command shows two udp actions and one arp.

With the rules I have set up, the following happens:
first button press -> automation 1, which turns my dummy switch ON and the corresponding lights as well. Everything fine so far.
but then a second press is recognised (proven by the find button log), which triggers automation 2, since the dummy switch is turned ON.

The result is that the light turns on for about four seconds and then turns off again. It's basically putting itself in a loop because of that.

I tried Hesperus, it's more convenient for setting up rules, but it gives me the same result, as the issue isn't in any app but in the dash button itself, which apparently logs into my wifi twice. It's the same for both of my buttons, so I don't think I have a faulty one.
The simple solution imo would be to only register the first button press, which can't be done in HomeKit, Eve or Hesperus.

@marcodesantis71
Copy link

Hi

I don't understand how ti configure dash button on Hesperus.

Can you help me?

@KhaosT
Copy link
Owner

KhaosT commented Jan 26, 2017 via email

@marcodesantis71
Copy link

Ops

My problem is how ti setup action

@KhaosT
Copy link
Owner

KhaosT commented Jan 26, 2017 via email

@marcodesantis71
Copy link

HI
I followed your steps, but I continue to have a problem.

I attach my screen.

Where do I wrong?
img_0257
img_0258
img_0259
img_0260

@KhaosT
Copy link
Owner

KhaosT commented Jan 26, 2017 via email

@marcodesantis71
Copy link

On Hesperus app, if I press the icon nothing happens

@KhaosT
Copy link
Owner

KhaosT commented Jan 26, 2017 via email

@DanBennettUK
Copy link

DanBennettUK commented Mar 29, 2017

I'm also having this issue. It seems like the latest Amazon Dash tries 5 times before giving up. Each try seems to be resolved as a click. So a timeout is required after the first click to ignore any more "clicks".

Did anyone manage to get this working as a On/Off switch? As for me, even using Hesperus, it performs both commands at the same time. And if using Hesperus I add an if statement (so if lights are off, turn them on) it just doesn't run at all.

@KhaosT
Copy link
Owner

KhaosT commented Mar 29, 2017

Same as I said before, are you sure you used the right MAC address for the dash? For some routers I see the behavior that when you press the Dash Button, it also sent out a few ARP messages. So if you are not using the correct MAC address then it may trigger multiple times.

@DanBennettUK
Copy link

Certainly using the correct MAC, as it does trigger (and I see it trigger in Homekit). The problem is the multiple ARC messages the Dash sends causes a trigger each time.

KhaosT added a commit that referenced this issue Mar 29, 2017
@KhaosT
Copy link
Owner

KhaosT commented Mar 29, 2017

Alright, give 0.0.4 a try?

@DanBennettUK
Copy link

Tried but no luck (whether that's HomeKit not updating the actions properly or not is another question).

What I've tried:
In Hesperus I have 2 toggle actions. For on: If Dash= Pressed & Light 1 = off & Light 2 = off THEN turn both on. Vice versa for toggling off.

What I see when I have the Home app open is it switches to the Toggle On then to Toggle off rapidly.

@KhaosT
Copy link
Owner

KhaosT commented Mar 29, 2017 via email

@DanBennettUK
Copy link

DanBennettUK commented Mar 29, 2017

Not sure it's really giving any indication!

Output from as soon as I button press;

  EventedHTTPServer [::ffff:192.168.1.68] Sending HTTP event '16.9' with data: {"characteristics":[{"aid":16,"iid":9,"value":1}]} +8s
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '16.9' with data: {"characteristics":[{"aid":16,"iid":9,"value":1}]} +2ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP request: /characteristics +88ms
  HAPServer [CC:22:3D:E3:CE:89] HAP Request: PUT /characteristics +0ms
  Accessory [Homebridge Pi1] Processing characteristic set: [{"remote":true,"value":true,"aid":7,"iid":9},{"remote":true,"value":100,"aid":8,"iid":12},{"remote":true,"value":0,"aid":7,"iid":10},{"remote":true,"value":0,"aid":7,"iid":11},{"remote":true,"value":0,"aid":8,"iid":11},{"remote":true,"value":100,"aid":7,"iid":12},{"remote":true,"value":true,"aid":8,"iid":9},{"remote":true,"value":0,"aid":8,"iid":10}] +2ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value true +0ms
  Accessory [Homebridge Pi1] Setting Characteristic "Brightness" to value 100 +27ms
[3/29/2017, 7:19:06 PM] [Lamp] BRIGHTNESS: 100
  Accessory [Homebridge Pi1] Setting Characteristic "Hue" to value 0 +29ms
[3/29/2017, 7:19:06 PM] [Desk LEDs] HUE: 0
  Accessory [Homebridge Pi1] Setting Characteristic "Saturation" to value 0 +27ms
[3/29/2017, 7:19:06 PM] [Desk LEDs] SATURATION: 0
  Accessory [Homebridge Pi1] Setting Characteristic "Saturation" to value 0 +19ms
[3/29/2017, 7:19:06 PM] [Lamp] SATURATION: 0
  Accessory [Homebridge Pi1] Setting Characteristic "Brightness" to value 100 +25ms
[3/29/2017, 7:19:06 PM] [Desk LEDs] BRIGHTNESS: 100
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value true +31ms
  Accessory [Homebridge Pi1] Setting Characteristic "Hue" to value 0 +17ms
[3/29/2017, 7:19:06 PM] [Lamp] HUE: 0
  EventedHTTPServer [::ffff:192.168.1.68] Muting event '8.9' notification for this connection since it originated here. +262ms
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '8.9' with data: {"characteristics":[{"aid":8,"iid":9,"value":true}]} +0ms
  EventedHTTPServer [::ffff:192.168.1.68] Muting event '7.9' notification for this connection since it originated here. +847ms
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '7.9' with data: {"characteristics":[{"aid":7,"iid":9,"value":true}]} +0ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP Response is finished +1ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP request: /characteristics +100ms
  HAPServer [CC:22:3D:E3:CE:89] HAP Request: PUT /characteristics +1ms
  Accessory [Homebridge Pi1] Processing characteristic set: [{"remote":true,"value":0,"aid":7,"iid":9},{"remote":true,"value":false,"aid":8,"iid":9}] +0ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value 0 +1ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value false +14ms
  EventedHTTPServer [::ffff:192.168.1.68] Muting event '7.9' notification for this connection since it originated here. +196ms
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '7.9' with data: {"characteristics":[{"aid":7,"iid":9,"value":0}]} +0ms
  EventedHTTPServer [::ffff:192.168.1.68] Muting event '8.9' notification for this connection since it originated here. +7ms
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '8.9' with data: {"characteristics":[{"aid":8,"iid":9,"value":false}]} +1ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP Response is finished +1ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP request: /characteristics +7ms
  HAPServer [CC:22:3D:E3:CE:89] HAP Request: PUT /characteristics +0ms
  Accessory [Homebridge Pi1] Processing characteristic set: [{"remote":true,"value":false,"aid":8,"iid":9},{"remote":true,"value":false,"aid":7,"iid":9}] +1ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value false +0ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value false +14ms
  EventedHTTPServer [::ffff:192.168.1.68] Muting event '7.9' notification for this connection since it originated here. +266ms
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '7.9' with data: {"characteristics":[{"aid":7,"iid":9,"value":false}]} +0ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP Response is finished +2ms

Interestingly no sign of it going "off" despite them going off... EDIT: Scrap that... Setting Characteristic "On" to value false

@KhaosT
Copy link
Owner

KhaosT commented Mar 29, 2017

From the log we only sent one notification to inform HomeKit about value changes. Can you tell which device is 192.168.1.68 and which is 192.168.1.146?

@DanBennettUK
Copy link

192.168.1.68 is the Apple TV. 192.168.1.146 is my iPhone.

@KhaosT
Copy link
Owner

KhaosT commented Mar 29, 2017

Is there by any chance you have other triggers that is triggered by power characteristic of the light? From the log it feels like the second off is triggered by something else instead of the programmable switch event.

@DanBennettUK
Copy link

The only triggers I have are based on location. Which I have off for testing this for that reason.

I've just noticed the triggers for toggling were appearing as disabled (even though it appeared to be toggling)... so I've re-enabled just in case and repost log... Sorry!

Doesn't really tell much a different story (I think somehow these are being cached when doing it via Hesperus.

Hesperus creates a scene for each toggle. And those are what are flipping each time. I'm hoping that is making sense to you because trying to bloody screen record is seemingly impossible now!

 EventedHTTPServer [::ffff:192.168.1.68] Sending HTTP event '16.9' with data: {"characteristics":[{"aid":16,"iid":9,"value":1}]} +8s
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '16.9' with data: {"characteristics":[{"aid":16,"iid":9,"value":1}]} +1ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP request: /characteristics +55ms
  HAPServer [CC:22:3D:E3:CE:89] HAP Request: PUT /characteristics +0ms
  Accessory [Homebridge Pi1] Processing characteristic set: [{"remote":true,"value":true,"aid":7,"iid":9},{"remote":true,"value":100,"aid":8,"iid":12},{"remote":true,"value":0,"aid":7,"iid":10},{"remote":true,"value":0,"aid":7,"iid":11},{"remote":true,"value":0,"aid":8,"iid":11},{"remote":true,"value":100,"aid":7,"iid":12},{"remote":true,"value":true,"aid":8,"iid":9},{"remote":true,"value":0,"aid":8,"iid":10}] +1ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value true +1ms
  Accessory [Homebridge Pi1] Setting Characteristic "Brightness" to value 100 +11ms
[3/29/2017, 7:30:04 PM] [Lamp] BRIGHTNESS: 100
  Accessory [Homebridge Pi1] Setting Characteristic "Hue" to value 0 +14ms
[3/29/2017, 7:30:04 PM] [Desk LEDs] HUE: 0
  Accessory [Homebridge Pi1] Setting Characteristic "Saturation" to value 0 +14ms
[3/29/2017, 7:30:04 PM] [Desk LEDs] SATURATION: 0
  Accessory [Homebridge Pi1] Setting Characteristic "Saturation" to value 0 +15ms
[3/29/2017, 7:30:04 PM] [Lamp] SATURATION: 0
  Accessory [Homebridge Pi1] Setting Characteristic "Brightness" to value 100 +15ms
[3/29/2017, 7:30:04 PM] [Desk LEDs] BRIGHTNESS: 100
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value true +39ms
  Accessory [Homebridge Pi1] Setting Characteristic "Hue" to value 0 +19ms
[3/29/2017, 7:30:04 PM] [Lamp] HUE: 0
  EventedHTTPServer [::ffff:192.168.1.68] HTTP Response is finished +359ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP request: /characteristics +7ms
  HAPServer [CC:22:3D:E3:CE:89] HAP Request: PUT /characteristics +1ms
  Accessory [Homebridge Pi1] Processing characteristic set: [{"remote":true,"value":0,"aid":7,"iid":9},{"remote":true,"value":false,"aid":8,"iid":9}] +0ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value 0 +1ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value false +11ms
  EventedHTTPServer [::ffff:192.168.1.68] Muting event '7.9' notification for this connection since it originated here. +173ms
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '7.9' with data: {"characteristics":[{"aid":7,"iid":9,"value":0}]} +1ms
  EventedHTTPServer [::ffff:192.168.1.68] Muting event '8.9' notification for this connection since it originated here. +25ms
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '8.9' with data: {"characteristics":[{"aid":8,"iid":9,"value":false}]} +1ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP Response is finished +4ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP request: /characteristics +8ms
  HAPServer [CC:22:3D:E3:CE:89] HAP Request: PUT /characteristics +0ms
  Accessory [Homebridge Pi1] Processing characteristic set: [{"remote":true,"value":false,"aid":8,"iid":9},{"remote":true,"value":false,"aid":7,"iid":9}] +1ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value false +0ms
  Accessory [Homebridge Pi1] Setting Characteristic "On" to value false +11ms
  EventedHTTPServer [::ffff:192.168.1.68] Muting event '7.9' notification for this connection since it originated here. +171ms
  EventedHTTPServer [::ffff:192.168.1.146] Sending HTTP event '7.9' with data: {"characteristics":[{"aid":7,"iid":9,"value":false}]} +0ms
  EventedHTTPServer [::ffff:192.168.1.68] HTTP Response is finished +1ms

@DanBennettUK
Copy link

https://www.youtube.com/watch?v=XeDSs0_2OiU finally... just to show I'm not mad more than anything xD

@DanBennettUK
Copy link

OK so I've left it 20 minutes to get a shower... come back and it's working flawlessly... so maybe your little patch has worked and HomeKit just hadn't updated the triggers from when they were last changed, or Homebridge was being silly buggers.

I'll keep an eye on this and update here in a while to confirm...

Caching? Hmm!

@KhaosT
Copy link
Owner

KhaosT commented Mar 29, 2017

lol this is interesting… let me know if it occurs again.

@DanBennettUK
Copy link

Indeed. I have a sneaky suspicion of the Apple TV, as I know I had an issue in the past where it's seemingly cached a device that didn't exist for 24 hours... Will see! Thanks for being proactive though :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants