definition (name: "Holmes Smart Air Purifier With WeMo", namespace: "dbarney", author: "Darryl Barney") {
capability "Actuator"
capability "Polling"
capability "Refresh"
capability "Switch"
attribute "Mode", "number"
attribute "Ionizer", "number"
attribute "previousMode", "number"
attribute "filterLife", "string"
attribute "expiredFilterTime", "number"
command "ModeAuto"
command "ModeHigh"
command "ModeMed"
command "ModeLow"
command "ModeOff"
command "IonizerOn"
command "IonizerOff"
command "resetFilterLife"
}
simulator {
// TODO: define status and reply messages here
}
tiles (scale: 2){
standardTile("off", "device.Mode",label:"Off", width: 2, height: 2) {
state "default", label: 'OFF', action: "ModeOff", icon:"st.Appliances.appliances11",backgroundColor:"#ffffff"
state "1", label: 'ON', action: "ModeOff", icon:"st.Appliances.appliances11",backgroundColor:"#888888"
state "2", label: 'ON', action: "ModeOff", icon:"st.Appliances.appliances11",backgroundColor:"#888888"
state "3", label: 'ON', action: "ModeOff", icon:"st.Appliances.appliances11",backgroundColor:"#888888"
state "4", label: 'ON', action: "ModeOff", icon:"st.Appliances.appliances11",backgroundColor:"#888888"
}
standardTile("low", "device.Mode",label:"Low") {
state "default", label: 'LOW', action: "ModeLow", icon:"st.Appliances.appliances11",backgroundColor:"#ffffff"
state "1", label: 'LOW', action: "ModeLow", icon:"st.Appliances.appliances11",backgroundColor:"#95B6F8"
}
standardTile("med", "device.Mode", label:"Med") {
state "default", label: 'MED', action: "ModeMed", icon:"st.Appliances.appliances11",backgroundColor:"#ffffff"
state "2", label: 'MED', action: "ModeMed", icon:"st.Appliances.appliances11",backgroundColor:"#75A0F7"
}
standardTile("high", "device.Mode", label:"High") {
state "default", label: 'HIGH', action: "ModeHigh", icon:"st.Appliances.appliances11",backgroundColor:"#ffffff"
state "3", label: 'HIGH', action: "ModeHigh", icon:"st.Appliances.appliances11",backgroundColor:"#548AF6"
}
standardTile("auto", "device.Mode",label:"Auto") {
state "default", label: 'AUTO', action: "ModeAuto", icon:"st.Appliances.appliances11",backgroundColor:"#ffffff"
state "4", label: 'AUTO', action: "ModeAuto", icon:"st.Appliances.appliances11",backgroundColor:"#3474F5"
}
standardTile("IonOff", "device.Ionizer", label:"Med") {
state "default", label: 'Off', action: "IonizerOff", icon:"st.Appliances.appliances11",backgroundColor:"#ffffff"
state "0", label: 'Off', action: "IonizerOff", icon:"st.Appliances.appliances11",backgroundColor:"#75A0F7"
}
standardTile("IonOn", "device.Ionizer", label:"On") {
state "default", label: 'On', action: "IonizerOn", icon:"st.Appliances.appliances11",backgroundColor:"#ffffff"
state "1", label: 'On', action: "IonizerOn", icon:"st.Appliances.appliances11",backgroundColor:"#548AF6"
}
valueTile("ModeLevel", "device.Mode", decoration: "flat") {
state "level", label:'Mode Level: ${currentValue}'
}
controlTile("ModeSliderControl", "device.Mode", "slider", height: 1, width: 2) {
state "level", action:"setMode"
}
controlTile("IonizerSliderControl", "device.Ionizer", "slider", height: 1, width: 2) {
state "level", action:"setIonizer"
}
valueTile("filterLife", "device.filterLife", width: 2, height: 2, decoration: "flat") {
state "filterLife", label:'Filter: ${currentValue}%'
}
valueTile("AirQuality", "device.AirQuality", width: 1, height: 1, decoration: "flat") {
state "AirQuality", label:'Quality: ${currentValue}%'
}
valueTile("FilterPresent", "device.FilterPresent", width: 1, height: 1, decoration: "flat") {
state "FilterPresent", label:'FilterPresent: ${currentValue}'
}
standardTile("resetFilterLife", "device.resetFilterLife", width:1, height: 1, decoration: "flat") {
state "defaut", label:'Reset Filter Life', action:"resetFilterLife", icon:"st.Health & Wellness.health7"
}
standardTile("refresh", "device.refresh", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
}
main "mainTile"
details (["off", "low", "med", "high", "auto", "IonOff", "IonOn", "refresh", "filterLife", "resetFilterLife", "AirQuality"])
}
}