steve228uk / homebridge-dash

A quick and dirty Homebridge plugin for Amazon Dash
MIT License
13 stars 4 forks source link

Reverting state of switch #2

Open mbeck94 opened 7 years ago

mbeck94 commented 7 years ago

Is there anyway to implement an option of returning a switch automatically to a certain state? This would allow for one push operation to set a scene.

Currently in iOS 10.3 I am able to set a rule that when the switch turns on or off, a scene will be applied. This is problematic due to the fact that the dash button 'saves' its state, so each click is an 'on' and the subsequent click is an 'off'. If the button could automatically revert back to a given state after a short delay, scenes could be automated. The plug-in homebridge-dummy does this.

I've tried experimenting with setting the same scene for the dash being 'on' and 'off' but I always have to cycle through through twice to activate it, I think somehow it is cancelling one of them out, or it has to do with the 1 or 0 being received, since it only works on every second click.

Thanks!

mbeck94 commented 7 years ago

For more clarity, here is my current workaround for activating an "arriving" and "departing" scene using dash buttons, and dummy switches created using the -dummy plugin

Six rules were created, three for 'Arriving' and three for 'departing Arriving:

  1. If Switch A=on, then Dummy Switch A = on
  2. If Switch A=off, then Dummy Switch A = on
  3. If Dummy Switch A= on, then Scene='Arriving"

Departing:

  1. If Switch B=on, then Dummy Switch B = on
  2. If Switch B=off, then Dummy Switch B = on
  3. If Dummy Switch B= on, then Scene='Departing"