Error message in New App for custom DTH with "Air Conditioner Mode" capability

I have a custom DTH that uses the Air Conditioner Mode capability. All works fine in the classic app and it does work in the new app as well. But in the new app, I also get a brief popup error message: “[SA] undefined event, screen [undefined], rt [x.com.st.mode.airconditioner], event [default]” whenever I click on one of the mode buttons.

I have tried a fair variety of things to make the message go away without success. Any suggestions? I’m new to the new app UI so it might be something pretty simple I have missed.

Screen grab of the error:

I’ve also pared down the code to this (which includes the classic code). This code generates the error message in the new app). Edited to add installed(), updated() and init().

//  ACTest
metadata {
	definition (name: "ACTest", namespace: "FurballUniverse", author: "Dan") {
    	// tried an assortment of ofcDeviceType, vid and mnmn
		capability "Air Conditioner Mode"
	}

	simulator {
	}

	tiles {
    	// for classic app
        standardTile("ACmode", "device.airConditionerMode") {
            state "cool", action: "airConditionerMode.setAirConditionerMode"
        	state "heat", action: "airConditionerMode.setAirConditionerMode"
        	state "fanOnly", action: "airConditionerMode.setAirConditionerMode"
		}
    }
    main"ACmode"
    details(["ACMode"])
}


def setAirConditionerMode(mode) {
    log.debug "setAirConditionerMode(${mode})"
    if (mode) {
    	String newACMode = mode
    	switch ( mode ) {
    		case "auto":
        	case "dry":
        	case "dryClean":
			case "notSupported":
        		newACMode = "notSupported"
            	break
        	case "cool":
        	case "coolClean":
				newACMode = "cool"
            	break
        	case "heat":
        	case "heatClean":
        		newACMode = "heat"
            	break
			case "fanOnly":
        		newACMode = "fanOnly"
            	break
    	}
   		log.debug "..newAC=${newACMode}"
 	  	sendEvent(name: "airConditionerMode", value: newACMode)
    } else {
    	stepAirConditionerMode()
    }
}

def acModes() {
	["cool", "heat", "fanOnly"]
}

def stepAirConditionerMode() {
	def currentMode = device.currentValue("airConditionerMode")
    log.debug "stepAirConditionerMode() was ${currentMode}"
    
    def modes = acModes()
    def i = modes.indexOf(currentMode)
    def next = i >= 0 && i < modes.size() -1 ? i + 1 : 0
    
    log.debug "  switch to ${modes[next]}"
    sendEvent(name: "airConditionerMode", value: modes[next])
}

def parse(String description) {
}
 // edited and added the following after suggestion by mvevitsis
def installed() {
	log.debug "installed()"
	init()
}

def updated() {
	log.debug "updated()"
	init()
}

def init() {
	log.debug "init()"
    sendEvent(name: "airConditionerMode", value: "cool")
}

Try defining installed and updated to initialize the acmode with some value when the dth loads

Thanks, but no joy.

But no surprise, my original code initialized all the attributes. I just didn’t bother to add them to the snippet - but I did add installed() and updated() to the stub and verified that it really doesn’t fix this. Also updated the stub in the original message.

BTW, the message occurs every time a mode button is pressed, anytime the app runs or is deleted and reinstalled.

Hello @Furball50,

This capability’s current status is “proposed” (capabilities document) which means that the SmartThings development team is working on it; we will be pending on any update, and as soon as we get something, we will reply to you.