I’m playing around with the SmartThings Arduino shield and I’ve been having some trouble extending the basic examples with new controls. (I know this gets said a lot, but it would be so helpful if there were SOME organized developer API documentation!)
I just tried to add a color picker, but the method I’m calling doesn’t get actually used! What am I doing wrong here?
metadata {
// Automatically generated. Make future change here.
definition (name: "On/Off Shield2", namespace: "smartthings", author: "SmartThings") {
capability "Switch Level"
capability "Actuator"
capability "Color Control"
capability "Switch"
capability "Polling"
capability "Refresh"
capability "Sensor"
command "setAdjustedColor"
attribute "color", "string"
}
// UI tile definitions
tiles {
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true, canChangeBackground: true) {
state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821"
state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
}
controlTile("rgbSelector", "device.color", "color", height: 2, width: 2, inactiveLabel: false) {
state "color", action:"setAdjustedColor"
}
main(["switch"])
details(["switch","rgbSelector"])
}
}
// Parse incoming device messages to generate events
def parse(String description) {
def value = zigbee.parse(description)?.text
def name = value in ["on","off"] ? "switch" : null
def result = createEvent(name: name, value: value)
log.debug "Parse returned ${result?.descriptionText}"
return result
}
// Commands sent to the device
def on() {
log.debug "on()"
zigbee.smartShield(text: "on").format()
}
def off() {
log.debug "off()"
zigbee.smartShield(text: "off").format()
}
def setAdjustedColor(value) {
log.debug "setAdjustedColor"
zigbee.smartShield(text: "setAdjustedColor").format()
}
I’m just trying to get “setAdjustedColor” to show up at all in my log, but it’s not even doing that. On and off work just fine.