Switch Events Stopped Working, Help?

So I have a number of GE Z-Wave in wall switches. I wrote a simple app so I can have them automatically turn off after a set amount of time when they are turned on manually.

It worked great for a long time, but a few months ago it stopped working. Has there been any API changes to events? Or did something happen to the device handler? Thanks for any help anyone can provide.

Here is the debug output from the event handler. It used to be these outputted more data, but for some reason the event is almost empty now. It used to be that “IsPhysical()” would return true when you turned on the light using the switch, now it is always false. Also, device source is always “Device”, even when you use the SmartThing app to turn on the light.

debug event display name: Pantry Light
debug the name of this event: switch
debug The value of this event is on
debug event raw description: null
debug event description: {{ linkText }} {{ name }} is {{ value }}
debug event from digital actuation? false
debug event from physical actuation? false
debug The source of this event is: DEVICE

Here is my simple code generating the data above:

preferences {
	section {
		input(name: "phySwitch", type: "capability.switch", title: "For these switches...", multiple: true, required: true)
        input(name: "timerDelay", type: "number",title: "Turn off in... (in minutes)", required: true, defaultValue:5)
	}
}

def installed() {
	log.debug "Installed with settings: ${settings}"

	initialize()
}

def updated() {
	log.debug "Updated with settings: ${settings}"

	unsubscribe()
	initialize()
}

def initialize() {
	subscribe(phySwitch,"switch.on",turnOffIn)
}

// TODO: implement event handlers
def turnOffIn(evt){
    log.debug "the name of this event: ${evt.name}"
    log.debug "event display name: ${evt.displayName}"
    log.debug "The value of this event is ${evt.value}"
    log.debug "event raw description: ${evt.description}"
    log.debug "event from digital actuation? ${evt.isDigital()}"
    log.debug "event from physical actuation? ${evt.isPhysical()}"
    log.debug "The source of this event is: ${evt.source}"
    log.debug "Ohh, ${evt.descriptionText} happened, lets see if I can do anything!"
	if (evt.isPhysical()) {
		log.debug "The event was physical, starting off timer!"
        runIn(60*timerDelay,"turnOffSwitch")
	} else {
		log.debug "Aww, the event was digital, I don't get to do anything."
	}
}

def turnOffSwitch(){
  phySwitch*.off()
}

The stock DTHs were changed a few months ago to stop reporting “isphysical” because they found out that just wasn’t reliable. For example, if the message went through a repeater, it would not be reported as a physical change even though it had been. This help explain why the various double tap smartapps worked for some people but not for others. Or even some switches in a home and not others.

There was no announcement of this, it was just quietly deprecated during one of the various firmware changes. But it was discussed in the forms because of the smartapps failing.

Ah, sucky. It was nice having the switches on a timer, but being able to turn them on through the app when the lights needed to stay on.

Oh well, I’ve updated my app to work solely on the “on” event and have stopped checking how the light was turned on.

Thank you for the information.

1 Like

If you create a copy of the stock device handler and assign it to your devices isphysical will work again.