SmartThings Community

3A Nue RGBW strip controller with normal RGBW led strip lights: Manufacturer’s DTH

dth_lighting
project_lighting

#1

The 3A Nue Smart ZigBee RGBW Strip Light controller works with SmartThings Hub to control normal RGBW, RGB or single colour strip lights. People can easily make it as following:

  1. Power on the 3A Nue Strip Light Controller

  2. Log in to SmartThings Developer Tools https://account.smartthings.com

  3. Click Locations. Then in the table select the (hub name). Then click on the “Hubs . (hub name)”
    Ensure Zigbee: “OTA enabled for all non-light devices” and “Unsecure rejoin: true”. If this is not the case click “View Utilities” and edit ZigBee Utilities appropriately.

  4. Create a device handler by clicking on My Device Handlers and on the next page the +Create New Device Handler button. On the next page click on tab From code. Paste the code below. Then click the Save button. Then click the Publish button. Select For me.

/** Please copy the Device Handler from this line

  • Copyright 2016 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.
  • Updated by Kevin X- 3A Smart Home on 1st Jun 2018

*/

metadata {
definition (name: “3A NUE ZigBee RGBW Light”, namespace: “smartthings”, author: “Kevin X- 3A Smart Home”) {

    capability "Actuator"
    capability "Color Control"
    capability "Color Temperature"
    capability "Configuration"
    capability "Polling"
    capability "Refresh"
    capability "Switch"
    capability "Switch Level"

    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300", outClusters: "0019"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 1000", outClusters: "0019"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 1000", outClusters: "0019", "manufacturer":"3A Feibit", "model":"RGBW Light", deviceJoinName: "3A-Feibit RGBW Light"
}

// UI tile definitions
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.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
            attributeState "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
            attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
            attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
        }
       tileAttribute ("device.level", key: "SLIDER_CONTROL") {
       attributeState "level", action:"switch level.setLevel"
       }
        tileAttribute ("device.color", key: "COLOR_CONTROL") {
            attributeState "color", action:"color control.setColor"
        }
    }
    controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2700..6500)") {
        state "colorTemperature", action:"color temperature.setColorTemperature"
    }
    valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
        state "colorTemperature", label: '${currentValue} K'
    }
    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", "colorTempSliderControl", "colorTemp", "refresh"])
}

}

//Globals
private getATTRIBUTE_HUE() { 0x0000 }
private getATTRIBUTE_SATURATION() { 0x0001 }
private getHUE_COMMAND() { 0x00 }
private getSATURATION_COMMAND() { 0x03 }
private getCOLOR_CONTROL_CLUSTER() { 0x0300 }
private getATTRIBUTE_COLOR_TEMPERATURE() { 0x0007 }

// Parse incoming device messages to generate events
def parse(String description) {
log.debug “description is $description”

def finalResult = zigbee.getEvent(description)
if (finalResult) {
    log.debug finalResult
    sendEvent(finalResult)
}
else {
    def zigbeeMap = zigbee.parseDescriptionAsMap(description)
    log.trace "zigbeeMap : $zigbeeMap"

    if (zigbeeMap?.clusterInt == COLOR_CONTROL_CLUSTER) {
        if(zigbeeMap.attrInt == ATTRIBUTE_HUE){  //Hue Attribute
            def hueValue = Math.round(zigbee.convertHexToInt(zigbeeMap.value) / 255 * 360)
            sendEvent(name: "hue", value: hueValue, displayed:false)
        }
        else if(zigbeeMap.attrInt == ATTRIBUTE_SATURATION){ //Saturation Attribute
            def saturationValue = Math.round(zigbee.convertHexToInt(zigbeeMap.value) / 255 * 100)
            sendEvent(name: "saturation", value: saturationValue, displayed:false)
        }
    }
    else {
        log.info "DID NOT PARSE MESSAGE for description : $description"
    }
}

}

def on() {
device.endpointId =“0B”
zigbee.on() // + [“delay 20”] + zigbee.onOffRefresh()
}

def off() {
device.endpointId =“0B”
zigbee.off() // + [“delay 20”] + zigbee.onOffRefresh()
}

def refresh() {
refreshAttributes() + configureAttributes()
}

def poll() {
refreshAttributes()
}

def configure() {
log.debug “Configuring Reporting and Bindings.”
configureAttributes() + refreshAttributes()
}

def configureAttributes() {
zigbee.onOffConfig() + zigbee.levelConfig() + zigbee.colorTemperatureConfig() + zigbee.configureReporting(COLOR_CONTROL_CLUSTER, ATTRIBUTE_HUE, 0x20, 1, 3600, 0x01) + zigbee.configureReporting(COLOR_CONTROL_CLUSTER, ATTRIBUTE_SATURATION, 0x20, 1, 3600, 0x01)
}

def refreshAttributes() {
zigbee.onOffRefresh() + zigbee.levelRefresh() + zigbee.colorTemperatureRefresh() + zigbee.readAttribute(0x0300, 0x00) + zigbee.readAttribute(0x0300, ATTRIBUTE_HUE) + zigbee.readAttribute(0x0300, ATTRIBUTE_SATURATION)
}

def setColorTemperature(value) {
device.endpointId =“0B”
zigbee.setColorTemperature(value) + [“delay 10”] + zigbee.colorTemperatureRefresh()
}

def setLevel(value) {
device.endpointId = “0B”
def additionalCmds =
additionalCmds = refresh()
def hexConvertedValue = zigbee.convertToHexString((value/100) * 255)
zigbee.command(0x0008, 0x00, hexConvertedValue, “0000”) + additionalCmds
}

def setColor(value){
log.trace “setColor($value)”
device.endpointId =“0B”
zigbee.on() + setHue(value.hue) + [“delay 10”] + setSaturation(value.saturation) + [“delay 10”] + refreshAttributes()
}

def setHue(value) {
def scaledHueValue = zigbee.convertToHexString(Math.round(value * 0xfe / 100.0), 2)
device.endpointId =“0B”
zigbee.command(COLOR_CONTROL_CLUSTER, HUE_COMMAND, scaledHueValue, “00”, “0100”)
}

def setSaturation(value) {
def scaledSatValue = zigbee.convertToHexString(Math.round(value * 0xfe / 100.0), 2)
device.endpointId =“0B”
zigbee.command(COLOR_CONTROL_CLUSTER, SATURATION_COMMAND, scaledSatValue, “0100”)
}

// Please copy the device handler end of this line

  1. Open the SmartThings APP and click “Add a Thing” button to start searching New Devices.
    If APP failed to find the smart socket, click the “Add a Thing” to search again, then press the socket Reset button to pair with the SmartThings hub.

From the APP, you will see the smart socket is added in as a “Thing”.

  1. Edit the device “Thing” from API
    – Name : 3A Strip Light
    – Type: 3A Nue ZigBee RGBW Light
    – Version: Self-Published

  2. Go back your mobile phone and open the SmartThings APP to control the smart 3A Strip Light. The initiate default setting is to turn ON the W (white channel) only. If you are using a RGB strip light or some brand of RGBW strip lights, you will not see the lights ON as you click the ON /OFF button until you click the strip light name and open the colour selection panel and choose a colour. Then the ON /OFF button will work normally.

  3. For some reason, if you like to pair the strip light controller with the SmartThings hub again, you can do as following steps:
    a. Remove the device from the SmartThings APP

b. reset the controller by
– pressing the Reset button with a small screwdriver for 10 seconds as the controller is powered on;
or
–using the wall switch to turning ON, OFF, ON, OFF, ON, OFF, ON, OFF, ON , OFF (5 ON and 5 OFF) with interval about 1 second ( make sure you see light is ON, then OFF, after seeing OFF, then ON)

Then you can see the light flashing a few times and turn on in White color (RGBW strip) or OFF (RGB strip)

c. Add a Thing from the APP

d. Edit and update the Thing from API to select the Type - 3A NUE ZigBee RGBW light …


Recommendations for this particular undercounter lighting setup?
(Ben) #2

I have had mostly success with this integration. Two problems I am experiencing though…

The first is that the module doesn’t always turn off when told. It seems to randomly occur but when it does the only way to turn off the module is to unplug it. The other problem I’m having is that the dim setting is stuck at 88%. I can change the slider it in the smartthings app however it does not do anything to the led strips brightness.

Any suggestions?


#3

Hi Ben,

This is my first version of the device handler for the strip lights. I will make some adjustments to make APP working better soon.

As for the slider, it is for white colour light only and use for adjust the light colour from warm white to cool white.

Regards,

Kevin


(Ben) #4

Thank you Kevin!
I do have two sliders in the smartthings app for the module. One which controls “temperature” which does work. The other slider labeled “Dim” doesn’t change from 88% and doesn’t affect the white leds at all.
The strip does ramp on/off, so I know dim must be available in the module.

Anyways, great work so far! I look forward to updates :slight_smile:


#5

I have fixed the issue with Brightness Slider and updated the code. Please copy the Device Handler code and overwrite your existing one to fix the problem.


(Ben) #6

Awesome!
I seem to have somehow fried my module when splicing strips together… So when my replacement arrives tomorrow, I’ll let you know :):sweat_smile:


(Ben) #7

Hi Kevin,

Do you know anything about the ZigBee module itself? My replacement arrived today and it’s doing the same thing as the old one where when I plug it in, It’ll flash the white led’s quickly, then keep them on continuously. It will not respond to any commands.

I plugged each strip color into the white terminal on the controller and can confirm that the strip itself still works.


#8

Hi Ben,

Have you replace the old device handler with the new one? If yes, you can set up the brightness slider to 100% with the new device handler.

About the wiring, you do not connect all wires to the White Channel.

Can you send me a screen shot of the device setting? My email is kevin.xia2@gmail.com .

Regards,

Kevin


#9

Hi Ben,

Can you try as following?

  1. Click the strip light name on the SmartThings APP
  2. Click the color selection and set up a color, wait a few second to see if it change the colour or not.
  3. Go back to turn ON / OFF…

(Ben) #10

Hey Kevin,
I shot a quick video that I’m uploading right now to show what the module is doing. I’ll send that to your email when it’s ready.

I did update the device handler however it has had no affect. I do believe this to be a module issue which started after having cut the RGBW strip at its splice mark. I cut it again at the next splice line hoping it had just been a bad cut however it didn’t solve the problem. Being new to the RGB scene, is it possible the splice somehow has caused this? Is there a length requirement to the load on the module?


(Ben) #11

I take everything back!

I completely removed everything from SmartThings and started over from the beginning. Both modules are now responding and acting appropriately. Even the dim function works! YIPPEE!!

So sorry for wasting your time Kevin, thank you for your help with this!


#12

That is great.


(Steve) #13

@3asmarthome - Thanks a bunch for posting the device driver for these! Working like a charm.


(Ben) #14

Is it possible at a device handler level to add the ability to have the strip rotate through colors?


#15

Yes, it is possible.


(JOEY ESTRELLA) #16

Good day Sir

If you don’t mind can I have a copy of your DEVICE HANDLERS for 3A Nue Strip RGBW
I’m trying to make copy and paste on my device Handler not working … Thanks my email:

joey_estrella@yahoo.com. BRGD: JOEY


(JOEY ESTRELLA) #17

here my device handles: they showing error

Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script_dth_metadata_17b3ea79_dd6b_4533_b5e6_c348b971ccc4: 14: unexpected token: NUE @ line 14, column 23. definition (name: “3A NUE ZigBee RGBW Light”, namespace: “smartthings”, author: “Kevin X- 3A Smart Home”) { ^ 1 error


(JOEY ESTRELLA) #18

:frowning_face::sob:


#19

/** Please copy the Device Handler from this line

  • Copyright 2016 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.
  • Updated by Kevin X- 3A Smart Home on 1st Jun 2018

*/

metadata {
definition (name: “3A NUE ZigBee RGBW Light”, namespace: “smartthings”, author: “Kevin X- 3A Smart Home”) {

    capability "Actuator"
    capability "Color Control"
    capability "Color Temperature"
    capability "Configuration"
    capability "Polling"
    capability "Refresh"
    capability "Switch"
    capability "Switch Level"

    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300", outClusters: "0019"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 1000", outClusters: "0019"
    fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 1000", outClusters: "0019", "manufacturer":"3A Feibit", "model":"RGBW Light", deviceJoinName: "3A-Feibit RGBW Light"
}

// UI tile definitions
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.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
            attributeState "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
            attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
            attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
        }
       tileAttribute ("device.level", key: "SLIDER_CONTROL") {
       attributeState "level", action:"switch level.setLevel"
       }
        tileAttribute ("device.color", key: "COLOR_CONTROL") {
            attributeState "color", action:"color control.setColor"
        }
    }
    controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2700..6500)") {
        state "colorTemperature", action:"color temperature.setColorTemperature"
    }
    valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
        state "colorTemperature", label: '${currentValue} K'
    }
    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", "colorTempSliderControl", "colorTemp", "refresh"])
}

}

//Globals
private getATTRIBUTE_HUE() { 0x0000 }
private getATTRIBUTE_SATURATION() { 0x0001 }
private getHUE_COMMAND() { 0x00 }
private getSATURATION_COMMAND() { 0x03 }
private getCOLOR_CONTROL_CLUSTER() { 0x0300 }
private getATTRIBUTE_COLOR_TEMPERATURE() { 0x0007 }

// Parse incoming device messages to generate events
def parse(String description) {
log.debug “description is $description”

def finalResult = zigbee.getEvent(description)
if (finalResult) {
    log.debug finalResult
    sendEvent(finalResult)
}
else {
    def zigbeeMap = zigbee.parseDescriptionAsMap(description)
    log.trace "zigbeeMap : $zigbeeMap"

    if (zigbeeMap?.clusterInt == COLOR_CONTROL_CLUSTER) {
        if(zigbeeMap.attrInt == ATTRIBUTE_HUE){  //Hue Attribute
            def hueValue = Math.round(zigbee.convertHexToInt(zigbeeMap.value) / 255 * 360)
            sendEvent(name: "hue", value: hueValue, displayed:false)
        }
        else if(zigbeeMap.attrInt == ATTRIBUTE_SATURATION){ //Saturation Attribute
            def saturationValue = Math.round(zigbee.convertHexToInt(zigbeeMap.value) / 255 * 100)
            sendEvent(name: "saturation", value: saturationValue, displayed:false)
        }
    }
    else {
        log.info "DID NOT PARSE MESSAGE for description : $description"
    }
}

}

def on() {
device.endpointId =“0B”
zigbee.on()
}

def off() {
device.endpointId =“0B”
zigbee.off() //+ [“delay 20”] + zigbee.onOffRefresh()
}

def refresh() {
refreshAttributes() + configureAttributes()
}

def poll() {
refreshAttributes()
}

def configure() {
log.debug “Configuring Reporting and Bindings.”
configureAttributes() + refreshAttributes()
setColor(5000)
}

def configureAttributes() {
zigbee.onOffConfig() + zigbee.levelConfig() + zigbee.colorTemperatureConfig() + zigbee.configureReporting(COLOR_CONTROL_CLUSTER, ATTRIBUTE_HUE, 0x20, 1, 3600, 0x01) + zigbee.configureReporting(COLOR_CONTROL_CLUSTER, ATTRIBUTE_SATURATION, 0x20, 1, 3600, 0x01)
}

def refreshAttributes() {
zigbee.onOffRefresh() + zigbee.levelRefresh() + zigbee.colorTemperatureRefresh() + zigbee.readAttribute(0x0300, 0x00) + zigbee.readAttribute(0x0300, ATTRIBUTE_HUE) + zigbee.readAttribute(0x0300, ATTRIBUTE_SATURATION)
}

def setColorTemperature(value) {
device.endpointId =“0B”
zigbee.setColorTemperature(value) + [“delay 10”] + zigbee.colorTemperatureRefresh()
}

def setLevel(value) {
device.endpointId = “0B”
def additionalCmds = []
additionalCmds = refresh()
def hexConvertedValue = zigbee.convertToHexString((value/100) * 255)
zigbee.command(0x0008, 0x00, hexConvertedValue, “0000”) + additionalCmds
}
/*def setLevel(value) {
device.endpointId =“0B”
zigbee.setLevel(value) + [“delay 100”] + zigbee.levelRefresh()
}
*/
def setColor(value){
log.trace “setColor($value)”
device.endpointId =“0B”
zigbee.on() + setHue(value.hue) + [“delay 100”] + setSaturation(value.saturation) + [“delay 100”]+ refreshAttributes()
}

def setHue(value) {
def scaledHueValue = zigbee.convertToHexString(Math.round(value * 0xfe / 100.0), 2)
device.endpointId =“0B”
zigbee.command(COLOR_CONTROL_CLUSTER, HUE_COMMAND, scaledHueValue, “00”, “0100”)
}

def setSaturation(value) {
def scaledSatValue = zigbee.convertToHexString(Math.round(value * 0xfe / 100.0), 2)
device.endpointId =“0B”
zigbee.command(COLOR_CONTROL_CLUSTER, SATURATION_COMMAND, scaledSatValue, “0100”)
}

// Please copy the device handler end of this line


#20

Please check your email for it.