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:
-
Power on the 3A Nue Strip Light Controller
-
Log in to SmartThings Developer Tools https://account.smartthings.com
-
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. -
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
- 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”.
-
Edit the device “Thing” from API
– Name : 3A Strip Light
– Type: 3A Nue ZigBee RGBW Light
– Version: Self-Published -
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.
-
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 …