Author Topic: How To Trigger Scene On Double-Tap  (Read 145 times)

Offline MichaelCoffin

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
How To Trigger Scene On Double-Tap
« on: November 12, 2017, 02:29:40 pm »
I'm trying to code a double-tap scene trigger for a Leviton DZ6HD-1BZ dimmer switch.  In the scene editor the only device triggers are when the device is turned ON or OFF.  How do I code double-tap-on or double-tap-off triggers?

-MC

Offline swambach

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: How To Trigger Scene On Double-Tap
« Reply #1 on: November 16, 2017, 10:21:57 am »
Replying to you in hope of additional info-

Short answer is I'm not sure yet, but it looks like you might need to modify the device or create a new device that has those types of actions (e.g. doubleTapUp, doubleTapDown) and then listen for the specific event values that toggle those (e.g. for the GE devices it seems to be values of 255 and 0 respectively).

How to do the above, though, I'm not sure.  Hopefully someone else can jump in

Offline aa6vh

  • Hero Member
  • *****
  • Posts: 602
  • Karma: +12/-0
Re: How To Trigger Scene On Double-Tap
« Reply #2 on: November 17, 2017, 10:43:26 am »
It is possible to do this using LUA programming.

I do not know if it can do it also, but you might look at the PLEG plugin.

Offline swambach

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: How To Trigger Scene On Double-Tap
« Reply #3 on: November 17, 2017, 01:10:03 pm »
That's true, but it's not quite the same as the switch itself sending the double-tap status (assuming I'm talking about the same thing you are).

What I have working at the moment is this:

Set two global variables in the startup lua - one for light on and one for light off.  These are counters.
Then create two new scenes - one activates when a switch goes on and the other with off.  In the lua code of these I increment the counter; when it hits two (double tap) I turn the lights off.  When the other hits three, I turn the lights on.  Then reset the counters.

This isn't as elegant as just responding to a single event though and that's what I'd prefer.  Seems like it would be doable with a custom device type as there are devices that already do this in Vera.  I'd just like my existing switches to be supported in the same way

Offline aa6vh

  • Hero Member
  • *****
  • Posts: 602
  • Karma: +12/-0
Re: How To Trigger Scene On Double-Tap
« Reply #4 on: November 17, 2017, 02:44:04 pm »
I suppose we might not be.

I was assuming that one thing would happen on a single tap, and something else on a double tap. And some sort of timer needs to be involved so that two single taps a minute apart are not mistaken as a double tap.

I use similar logic on a garage light: One tap turns on the light for five minutes, a double tap turns on the light for 10 minutes, and a triple tap turns on the light for 30 minutes.