Trigger on switch press, regardless of prior switch state?

Hello,

Is there any way to trigger on the press of a switch (or dimmer), regardless of the prior state? In particular, I want to trigger based upon the "on" press of a switch, even though the switch may already be on.

The devices use the "Generic Z-Wave Smart Switch" (or "Generic Z-Wave Smart Dimmer") drivers. I see an event in the log for the device, but RM will not trigger on it, regardless of "on" or "changed", "switch" or "physical switch".

Thanks,
Denny

What event do you see in the logs? Some scene switches will send button events (really central scene commands that Hubitat interprets as such) for any event. For "regular" switches and dimmers, I'm not sure--perhaps someone will have some ideas since the triggers you suggested are the only ones that seem likely to work.

This depends on the device and the driver. The generic central scene drivers support this.
These drivers were written for zwp, zlink and homeseer dimmers and switches, they will produce various button events when the paddles are activated.

Assuming the switch is off, the first on press produces

DEVICE was turned on[physical]

each subsequent press produces

DEVICE is on [physical]

The physicals are Leviton switches, with the "Generic Z-Wave Smart Switch" driver. I don't know of a more specific driver for these devices.

What I am trying to implement is a switch with a timeout, with subsequent presses resetting the timer. Useful for situations where people might be in and out of a space and you don't want the light to go off unexpectedly such as in an attic or basement. Also useful for things like bathroom fans.

Could the Generic Z-Wave driver be enhanced to provide a button event?

the issue is really what the switch sends if it's already on and the on paddle is tapped again, same for off.

With debug logging enabled, open live logging and hit the on paddle twice in a row with a second or two delay between.
Please post the resulting live logging.
If the switch only sends one on command, meaning it only reports a transition between on and off, but can't report two on physical events in a row, then there wouldn't be any way to capture what you're looking for with this device.

Debug log from 3 "on" presses followed by 2 "off" presses spaced apart by several seconds.

dev:2202019-09-23 10:19:53.138 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)skip: Hail()

dev:2202019-09-23 10:19:53.130 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 8201, payload: , isMulticast: false

dev:2202019-09-23 10:19:46.335 [ **info** ](http://hubitat.cococafe.com/device/edit/220)Test switch is off [physical]

dev:2202019-09-23 10:19:46.323 [ **info** ](http://hubitat.cococafe.com/device/edit/220)BasicReport value: 0

dev:2202019-09-23 10:19:46.319 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 2003, payload: 00 00 00 , isMulticast: false

dev:2202019-09-23 10:19:45.812 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)skip: Hail()

dev:2202019-09-23 10:19:45.804 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 8201, payload: , isMulticast: false

dev:2202019-09-23 10:19:39.004 [ **info** ](http://hubitat.cococafe.com/device/edit/220)Test switch was turned off[physical]

dev:2202019-09-23 10:19:38.993 [ **info** ](http://hubitat.cococafe.com/device/edit/220)BasicReport value: 0

dev:2202019-09-23 10:19:38.989 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 2003, payload: 00 00 00 , isMulticast: false

dev:2202019-09-23 10:19:38.478 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)skip: Hail()

dev:2202019-09-23 10:19:38.473 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 8201, payload: , isMulticast: false

dev:2202019-09-23 10:19:31.612 [ **info** ](http://hubitat.cococafe.com/device/edit/220)Test switch is on [physical]

dev:2202019-09-23 10:19:31.599 [ **info** ](http://hubitat.cococafe.com/device/edit/220)BasicReport value: 99

dev:2202019-09-23 10:19:31.596 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 2003, payload: 63 63 00 , isMulticast: false

dev:2202019-09-23 10:19:30.833 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)skip: Hail()

dev:2202019-09-23 10:19:30.827 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 8201, payload: , isMulticast: false

dev:2202019-09-23 10:19:24.384 [ **info** ](http://hubitat.cococafe.com/device/edit/220)Test switch is on [physical]

dev:2202019-09-23 10:19:24.374 [ **info** ](http://hubitat.cococafe.com/device/edit/220)BasicReport value: 99

dev:2202019-09-23 10:19:24.371 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 2003, payload: 63 63 00 , isMulticast: false

dev:2202019-09-23 10:19:24.169 [ **info** ](http://hubitat.cococafe.com/device/edit/220)Test switch is on [physical]

dev:2202019-09-23 10:19:24.157 [ **info** ](http://hubitat.cococafe.com/device/edit/220)BasicReport value: 99

dev:2202019-09-23 10:19:24.153 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 2003, payload: 63 63 00 , isMulticast: false

dev:2202019-09-23 10:19:23.084 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)skip: Hail()

dev:2202019-09-23 10:19:23.078 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 8201, payload: , isMulticast: false

dev:2202019-09-23 10:19:15.896 [ **info** ](http://hubitat.cococafe.com/device/edit/220)Test switch is on [physical]

dev:2202019-09-23 10:19:15.886 [ **info** ](http://hubitat.cococafe.com/device/edit/220)BasicReport value: 99

dev:2202019-09-23 10:19:15.883 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 2003, payload: 63 63 00 , isMulticast: false

dev:2202019-09-23 10:19:15.470 [ **info** ](http://hubitat.cococafe.com/device/edit/220)Test switch was turned on[physical]

dev:2202019-09-23 10:19:15.459 [ **info** ](http://hubitat.cococafe.com/device/edit/220)BasicReport value: 99

dev:2202019-09-23 10:19:15.455 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 2003, payload: 63 63 00 , isMulticast: false

dev:2202019-09-23 10:19:14.489 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)skip: Hail()

dev:2202019-09-23 10:19:14.483 [ **debug** ](http://hubitat.cococafe.com/device/edit/220)parse description: zw device: 25, command: 8201, payload: , isMulticast: false

--- Live Log Started, waiting for events ---

Thanks Mike

looks like it's not going to be possible with this device without a dedicated driver.
Using the driver you did the testing with, the three on presses would have registered a total of 5 pushed button events (two more that expected)
off would have registered 2 pushed events which is the correct amount (one for each press)

Thank you for looking Mike.