Returned createEvent not handled by App

I’m returning a createEvent from my device handler’s parse method:

def parse(String description) {
    log.trace "Creating Event"
    return createEvent(name:"switch", value:"setLevel", data: [value:1])

In my app I have:

def initialize() {
    subscribe(input, "switch.setLevel", updateSetLevel);


def updateSetLevel(evt) {
    log.debug "Receiving Event"

I see a lot of “Creating Event” in my logs but not “Receiving Event”. Any help would be greatly appreciate. Thank you!

You should really look at the “Switch” and “Switch Level” capabilities in the SmartThings documentation because there are examples.

The short answer is, your DTH has to support the “Switch Level” capability and you should be creating an event for “level” and subscribing to “switchLevel.level” instead of using “setLevel”.

Thank you!

1 Like