Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- metadata {
- definition (name: "Nue ZigBee 1 Gang Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.switch") {
- capability "Actuator"
- capability "Configuration"
- capability "Refresh"
- capability "Switch"
- capability "Health Check"
- fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006"
- fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "0003, 0006, 0019, 0406", manufacturer: "Leviton", model: "ZSS-10", deviceJoinName: "Leviton Switch"
- fingerprint profileId: "0104", inClusters: "0000, 0003, 0006", outClusters: "000A", manufacturer: "HAI", model: "65A21-1", deviceJoinName: "Leviton Wireless Load Control Module-30amp"
- fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15A", deviceJoinName: "Leviton Lumina RF Plug-In Appliance Module"
- fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Leviton", model: "DL15S", deviceJoinName: "Leviton Lumina RF Switch"
- fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Feibit Inc co.", model: "FB56+ZSW1GKJ1.7", deviceJoinName: "Nue ZigBee Switch"
- fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006", outClusters: "0003, 0006, 0008, 0019, 0406", manufacturer: "Feibit Inc co.", model: "FB56+ZSW05HG1.2", deviceJoinName: "Nue ZigBee Light Controller"
- }
- // simulator metadata
- simulator {
- // status messages
- status "on": "on/off: 1"
- status "off": "on/off: 0"
- // reply messages
- reply "zcl on-off on": "on/off: 1"
- reply "zcl on-off off": "on/off: 0"
- }
- tiles(scale: 2) {
- multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
- tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
- attributeState "on", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
- attributeState "off", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
- attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.switches.light.on", backgroundColor:"#00A0DC", nextState:"turningOff"
- attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.switches.light.off", backgroundColor:"#ffffff", nextState:"turningOn"
- }
- }
- standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
- state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
- }
- main "switch"
- details(["switch", "refresh"])
- }
- }
- // Parse incoming device messages to generate events
- def parse(String description) {
- log.debug "description is $description"
- def event = zigbee.getEvent(description)
- if (event) {
- sendEvent(event)
- }
- else {
- log.warn "DID NOT PARSE MESSAGE for description : $description"
- log.debug zigbee.parseDescriptionAsMap(description)
- }
- }
- def off() {
- device.endpointId ="10"
- zigbee.off()
- }
- def on() {
- device.endpointId ="10"
- zigbee.on()
- }
- /**
- PING is used by Device-Watch in attempt to reach the Device
- */
- def ping() {
- return refresh()
- }
- def refresh() {
- zigbee.onOffRefresh() + zigbee.onOffConfig()
- }
- def configure() {
- // Device-Watch allows 2 check-in misses from device + ping (plus 2 min lag time)
- sendEvent(name: "checkInterval", value: 2 * 10 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])
- log.debug "Configuring Reporting and Bindings."
- zigbee.onOffRefresh() + zigbee.onOffConfig()
- }
- //Please cope the device handler end this line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement