Newbie question

I’m just starting to write device handler for a device and spent days trying figure out why the action never get trigger when I pressed on “raiseSetpoint” and “lowerSetpoint”. I expect to see the print out on debug windows, but nothing happen. Can anyone tell me what’s wrong? TIA!

tiles(scale: 2) {
	// Multi Tile:
	//multiAttributeTile(name:"DeviceTrigger", type: "generic", width: 6, height: 6, canChangeIcon: true) {
	multiAttributeTile(name:"DeviceTrigger", type: "generic", width: 6, height: 6, canChangeIcon: false) {
		tileAttribute ("device.door", key: "PRIMARY_CONTROL", icon: "st.Transportation.transportation14", , backgroundColor:"#33CCFF") {
			attributeState "closeDoor", label:'CLOSE' , action: "open", icon: "https://download.senclo.com/tile_2x2_garage_close_icon.png", backgroundColor:"#55A0FF", labelColor: "000000", nextState: "doorOpening"
			attributeState "openDoor", label: 'OPEN', action: "close", icon: "https://download.senclo.com/tile_2x2_garage_open_icon.png", backgroundColor: "#FF5050", nextState: "doorClosing"
        	attributeState "doorOpening", label: 'OPENING', action: "", icon: "https://download.senclo.com/tile_2x2_garage_halfway_icon.png", backgroundColor: "#FFAA33"
			attributeState "doorClosing", label: 'CLOSING', action: "", icon: "https://download.senclo.com/tile_2x2_garage_halfway_icon.png", backgroundColor: "#79B821"
		}

        tileAttribute("temperature", key: "SECONDARY_CONTROL") {
            //attributeState "temperature", label:'Temperature: ${tempValue}°C'
            attributeState "temperature", label:'Temperature: 70°C'
        }
        
	}
    
           standardTile("raiseSetpoint", "device.thermostatSetpoint", width: 3, height: 1, decoration: "flat") {
		state "setpoint", action:"upDS", icon:"st.thermostat.thermostat-left"
	}
	standardTile("lowerSetpoint", "device.thermostatSetpoint", width: 3, height: 1, decoration: "flat") {
		state "setpoint", action:"downDS", icon:"st.thermostat.thermostat-right"
	}
          
	main (["DeviceTrigger", "temperature"])
	details(["DeviceTrigger", "raiseSetpoint", "lowerSetpoint"])
}

} //end of metadata

def doorSelected = 0

void upDS() {
log.info "======================= upDS CALLED =========================="
log.info “======================= upDS CALLED ==========================”
}

void downDS() {
log.info "======================= downDS CALLED =========================="
log.info “======================= downDS CALLED ==========================”
}

Where is the full code?

You need to have Commands declared for the Actions in your Tile statement… etc.,.

In other words, there’s a lot of places things could be failing.

My recommend for “newbies”:

  1. Start with a simple working DTH (like a Switch). Make sure 100% that it works.
  2. Add debug log statement so you know it works.
  3. Make a small change.
  4. Make sure it still works.
  5. Repeat #3-#4 until it breaks; then undo #3 and then ask for help.
2 Likes

omg, this is embarrassing. I just noticed I didn’t define the custom command under definition LOL. Thank you tgauchat!

2 Likes