Skip to content

Instantly share code, notes, and snippets.

@aurman
Created September 18, 2014 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aurman/1865341afba93d2ea231 to your computer and use it in GitHub Desktop.
Save aurman/1865341afba93d2ea231 to your computer and use it in GitHub Desktop.
Exhalr Device Type Code
metadata {
// Automatically generated. Make future change here.
definition (name: "Exhalr", namespace: "smartthings", author: "SmartThings") {
capability "Actuator"
capability "Switch"
capability "Sensor"
}
// Simulator metadata
simulator {
status "on": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E"
status "off": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6666"
status "blow": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A626C6F77"
// reply messages
reply "raw 0x0 { 00 00 0a 0a 6f 6e }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E"
reply "raw 0x0 { 00 00 0a 0a 6f 66 66 }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6666"
}
// UI tile definitions
tiles {
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true, canChangeBackground: true) {
state "on", label: 'Great!', action: "switch.off", icon: "st.Health & Wellness.health10", backgroundColor: "#79b821"
state "off", label: 'Uh Oh :(', action: "switch.on", icon: "st.Health & Wellness.health8", backgroundColor: "#ffffff"
state "blow", label: 'Blow', action: "switch.on", icon: "st.Bath.bath1", backgroundColor: "#ffffff"
}
main "switch"
details "switch"
}
}
// Parse incoming device messages to generate events
def parse(String description) {
def value = zigbee.parse(description)?.text
def name = value in ["on","off","blow"] ? "switch" : null
def result = createEvent(name: name, value: value)
log.debug "Parse returned ${result?.descriptionText}"
return result
}
// Commands sent to the device
def on() {
zigbee.smartShield(text: "on").format()
}
def off() {
zigbee.smartShield(text: "off").format()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment