Subscription to double tapped buttons

this one does not seem to be subscribing to double tapped events. i dont have a double tapped button yet so @doug verified that it does not subscribe to the button.

what as i doing wrong?

thank you.

 definition	(
    name: "rooms test app",
    namespace: "bangali",
    author: "bangali",
    description: "rooms test app",
    category: "My Apps",
    iconUrl: "https://cdn.rawgit.com/adey/bangali/master/resources/icons/roomOccupancy.png",
    iconX2Url: "https://cdn.rawgit.com/adey/bangali/master/resources/icons/roomOccupancy@2x.png",
    iconX3Url: "https://cdn.rawgit.com/adey/bangali/master/resources/icons/roomOccupancy@3x.png"
)

preferences {
	page(name: "roomsTest", title: "Rooms Test")
}

def roomsTest()     {
	dynamicPage(name: "roomsTest", title: "Rooms Test", install: true, uninstall: true)      {
        section("")      {
            input "roomButton", "capability.doubleTapableButton", title: "Button?", required: true, multiple: false
        }
    }
}

def installed()     { initialize() }

def updated()       {
    initialize()
    subscribe(roomButton, "doubleTapped", buttonEvent)
    subscribe(roomButton, "doubleTapped.1", buttonOnlyEvent)
}

def	initialize()    {
    unsubscribe()
    unschedule()
}

def buttonEvent(evt)        {
}

def buttonOnlyEvent(evt)    {
}

If he's tapping the same button again, it won't show up because the value hasn't changed. You might have to disable filtering on the event subscription so that if it's pushed again it will still come through to your app.

Example below
subscribe(device, "switch", "virtualHandler", [filterEvents : false])

i thought of that but its using HE double tapped capability:

thought that should work without requesting no event filtering?

i will make the change and request that @doug give that a try though.

buttonController events must force state change for this very reason.

sendEvent(blablabla, isStateChange: true)
If the controller driver is implemented correctly there's no need to change the app subscription

1 Like

@doug which driver does this device use?

Generic Z-Wave CentralScene Dimmer

thanks doug.

@mike.maxwell did you write that one? :wink:

sorry couldnt pass up on that one @mike.maxwell. just kidding though. :smiley:

subscribe(roomButton, "doubleTapped", buttonEvent, [filterEvents : false])
subscribe(roomButton, "doubleTapped.1", buttonOnlyEvent, [filterEvents : false])

I change the filterEvents as you requested, with the same results.
No event is found in room test app, but the button 1 was logged as doubleTapped.

rooms test appUser Created App

Name Type Value
roomButton capability.doubleTapableButton Foyer Chandelier

Event Subscriptions

none

Application State

Name Value

Scheduled Jobs

None

1 Like

have we verified in live logging that the actual device is producing double tap events?

Yes

1 Like

just added this to a test app:

input(name: "button",title: "button",type: "capability.doubleTapableButton",multiple: true)
subscribe(button,"doubleTapped.2",buttonHandler)
def buttonHandler(evt){
    log.debug "buttonHandler event:${evt.name},${evt.value}"   
}    

which produced this:
app:352018-08-11 13:47:46.324:debug buttonHandler event:doubleTapped,2

@doug found that as well a bit earlier … but the app shows no subscription to the device when you check under i

few other things to look into, the built in virtual button controller supports all button features and can be used to generate any events you want.
I would have doug add one of those and see if it works.

Will do, stay tuned

thanks @mike.maxwell i will check that myself. should have thought of that.

@doug please post the updated code you tried with logging and the subscriptions that you are either seeing or not seeing for the test app.

definition	(
    name: "rooms test app",
    namespace: "bangali",
    author: "bangali",
    description: "rooms test app",
    category: "My Apps",
    iconUrl: "https://cdn.rawgit.com/adey/bangali/master/resources/icons/roomOccupancy.png",
    iconX2Url: "https://cdn.rawgit.com/adey/bangali/master/resources/icons/roomOccupancy@2x.png",
    iconX3Url: "https://cdn.rawgit.com/adey/bangali/master/resources/icons/roomOccupancy@3x.png"
)

preferences {
	page(name: "roomsTest", title: "Rooms Test")
}

def roomsTest()     {
	dynamicPage(name: "roomsTest", title: "Rooms Test", install: true, uninstall: true)      {
        section("")      {
            input "roomButton", "capability.doubleTapableButton", title: "Button?", required: true, multiple: false
        }
    }
}

def installed()     { 
	log.debug "installed"    
    initialize() 
}

def updated()       {
    log.debug "updated"
    initialize()
    subscribe(roomButton, "doubleTapped", buttonEvent, [filterEvents : false])
	subscribe(roomButton, "doubleTapped.1", buttonOnlyEvent, [filterEvents : false])
}

def	initialize()    {
    log.debug "intialized"
    unsubscribe()
    unschedule()
}

def buttonEvent(evt)        {
    log.debug "buttonEvent ${evt}"
}

def buttonOnlyEvent(evt)    {
    log.debug "buttonOnlyEvent ${evt}"
}

Virtual Button Results, went through doubleTap on all 5 default buttons.

[app:534](http://10.0.0.53/logs#app534)2018-08-11 16:08:38.503:debugbuttonEvent com.hubitat.hub.domain.Event@1b2dcf2

[app:534](http://10.0.0.53/logs#app534)2018-08-11 16:08:36.831:debugbuttonEvent com.hubitat.hub.domain.Event@293e33e9

[app:534](http://10.0.0.53/logs#app534)2018-08-11 16:08:33.625:debugbuttonEvent com.hubitat.hub.domain.Event@6a802c24

[app:534](http://10.0.0.53/logs#app534)2018-08-11 16:08:30.177:debugbuttonEvent com.hubitat.hub.domain.Event@487b5796

[app:534](http://10.0.0.53/logs#app534)2018-08-11 16:08:24.125:debugbuttonOnlyEvent com.hubitat.hub.domain.Event@5d137a68

[app:534](http://10.0.0.53/logs#app534)2018-08-11 16:08:24.123:debugbuttonEvent com.hubitat.hub.domain.Event@5d137a68

[app:534](http://10.0.0.53/logs#app534)2018-08-11 16:08:08.122:debugintialized

[app:534](http://10.0.0.53/logs#app534)2018-08-11 16:08:08.119:debugupdated

[dev:675](http://10.0.0.53/logs#dev675)2018-08-11 16:08:38.477:infoTestVirtualButton button 5 was doubleTapped

[dev:675](http://10.0.0.53/logs#dev675)2018-08-11 16:08:36.745:infoTestVirtualButton button 4 was doubleTapped

[dev:675](http://10.0.0.53/logs#dev675)2018-08-11 16:08:33.600:infoTestVirtualButton button 3 was doubleTapped

[dev:675](http://10.0.0.53/logs#dev675)2018-08-11 16:08:30.138:infoTestVirtualButton button 2 was doubleTapped

[dev:675](http://10.0.0.53/logs#dev675)2018-08-11 16:08:24.043:infoTestVirtualButton button 1 was doubleTapped
1 Like

ahh you are faster than me. cool.

if you use the virtual button double tap to trigger the same in rooms does that work?

It does not.

so the subscription shows up which is different from what we saw for the other device.

checking functionality ...