Instruction and Device Handler for SmartThings Hub controlling Nue ZigBee In-Ceiling Light Controller

It’s a formatting error while copying the code in the 1st post. Here, I’ve fixed the formatting and you should be able to copy paste this in the IDE:

/*
Copyright 2015 SmartThings
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at:
 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
for the specific language governing permissions and limitations under the License.
*/

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()
}

Perfect thank you

Neil

Hi

The process went exactly as per your instructions with SmartThings finding a thing, however it appears always “on” (even when de-powered) and when I try to turn it off within the SmartThings app, it does not turn it off and eventually comes up with a network error message.

I note from the code this is a * model: FNB56-ZSW23HG1.1 which is different to the options in the device handler

Thanks
Neil

Hey RBoy,

That code compiled perfectly,

Im getting the following as an error

any chance anyone knows what may be the cause, Im fairly new to the whole thing

Thanks,

Hi Kevin (@3asmarthome(.

I purchased a ZB 3.0 Smart Light dimmer switch (HGZB-4D) and have used the attached code pasted by @RBoy to get it working with smartthings. This device handler only enables the on/off functionality but no dimming. Do you have a device handler which includes dimming? If so could you provide it in the same format as Rboy above as previously when i copy pasted from your website PDFs the code was rejected with formatting issues.

Thanks!

Have you tried using the stock built in DTH for ZigBee Light Dimmers?

@RBoy Yes that worked perfectly. Thanks mate!

1 Like

Hi,

You can just edit the device by selecting Type- ZigBee Dimmer. In addition, the attached file is the device handler.

Regards,

Kevin

(Attachment Nue ZigBee 3.0 Dimmer Device Handler.docx is missing)