/** * Washer/Dryer Finished Monitor * * Author: jangell@tmproductions.com * Date: 2013-06-30 */ // for the UI metadata { definition (name: "Washer and Dryer Finished Monitor", author: "jangell@tmproductions.com") { capability "Sensor" attribute "washer", "string" attribute "dryer", "string" } tiles { standardTile("washer", "device.washer", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) { state "pending", label: 'Washer', backgroundColor: "#ffffff", icon: "st.Appliances.appliances1" state "done", label: 'Washer Done', backgroundColor: "#69AF1A", icon: "st.Appliances.appliances1" } standardTile("dryer", "device.dryer", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) { state "pending", label: 'Dryer', backgroundColor: "#ffffff", icon: "st.Appliances.appliances8" state "done", label: 'Dryer Done', backgroundColor: "#69AF1A", icon: "st.Appliances.appliances8" } main( ["washer","dryer"]) details(["washer","dryer"]) } } // Parse input and send events. def parse(String description) { // log.debug "Parsing '${description}'" def cmd = zigbee.parse(description) if (!cmd) { log.debug "zigbee.parse() returned NULL: ${description}" return } def parts = cmd.text.split( /:/ ); if(parts[0] != "washer" && parts[0] != "dryer") return def result = createEvent(name:parts[0], value:parts[1]) log.debug "Parse returned ${result?.descriptionText}" return result }