Cree to offer Zigbee LED smart bulb

Firmware Version 000.011.00603, Hardware Version hub v1, US customer
Raw Description 0A C05E 0100 02 07 0000 1000 0004 0003 0005 0006 0008 02 0000 0019
Zigbee Id E20DB9FFFE004FD5
Device Network Id 1B7B

Picked up one of these last night and tried it with no success. Originally I had copied and pasted the non-working code but even after updating I was still unsuccessful at getting the light to work even for simple on/off. Removed the bulb and re-added it without issue and reassigned the device type a second time just to see - still no luck. Near as I can tell the hub is all up to date since I was emailed and said an update was being pushed yesterday and when manually attempting to update the hub it says it is up to date so Im not sure what Im missing but its definitely not working. :frowning:

Both times when I attempted to add my bulb last night I did the add function and it sat at searching and appearing to not find anything when actually it had already located and added the bulb as an unknown thing on the things screen. Also another common issue when adding zigbee devices to the hub initially is distance. Ideally use a lamp that is within 3-6 feet of the hub to initially add and configure the bulb. When I tried with the bulb downstairs and hub upstairs I was unsuccessful. Used a lamp in the same room as the hub and it was found - albeit not clearly found to me as described above - but it was found. Once it is added to the hub you should be able to use it anywhere in normal operating range but for the initial add distance is an issue most of the time.

1 Like

@Tyler
" TYLER LANGE
Support Lead at SmartThings
We’ll hopefully be publishing our official device type soon."

The GE Link bulb has been out for months, I do not see it listed on the ST Compatible Device List. Is the GE Link device type not official yet?

I agree with @pghjosh08 about pairing when close to the hub. I know the GE Link bulbs are notorious for interference during the pairing process and with zigbee on the same 2.4ghz channel as wifi, bluetooth and tons of other wireless devices, so being close to the hub and moving the hub as far away from your router as possible are two good ways to improve performance.

Also @pghjosh08, I’ve had GE Link bulbs that just didn’t work, so maybe try returning it for a new one and you’ll have better luck.

Hi @joe1, copied below is code (hopefully it copied in correctly) borrowed from the newer GE Link device type (linked thread). I’ve modified the fingerprint and endpoints for the Cree bulb, so it should automatically select this device type when paired and work. It has the dim rate features you mention as options in Preferences. Thanks to the great work by @johnconstantelo and @tslagle13!

 /**
 *  Cree Bulb beta from My GE Link Bulb v2
 *
 *  Copyright 2014 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.
 *
 *  Thanks to Chad Monroe @cmonroe and Patrick Stuart @pstuart, and others
 *
 ******************************************************************************
 *                                Changes
 ******************************************************************************
 *
 *  Change 1:    2014-10-10 (wackford)
 *                Added setLevel event so subscriptions to the event will work
 *  Change 2:    2014-12-10 (jscgs350 using Sticks18's code and effort!)
 *                Modified parse section to properly identify bulb status in the app when manually turned on by a physical switch
 *  Change 3:    2014-12-12 (jscgs350, Sticks18's)
 *                Modified to ensure dimming was smoother, and added fix for dimming below 7
 *    Change 4:    2014-12-14 Part 1 (Sticks18)
 *                Modified to ignore unnecessary level change responses to prevent level skips
 *    Change 5:    2014-12-14 Part 2 (Sticks18, jscgs350)
 *                Modified to clean up trace&debug logging, added new code from @sticks18 for parsing "on/off" to determine if the bulb is manually turned on and immediately update the app
 *    Change 6:    2015-01-02    (Sticks18)
 *                Modified to allow dim rate in Preferences. Added ability to dim during On/Off commands and included this option in Preferences. Defaults are "Normal" and no dim for On/Off.
 *    Change 7:    2015-01-09    (tslagle13)
 *                dimOnOff is was boolean, and switched to enum. Properly update "rampOn" and "rampOff" when refreshed or a polled (dim transition for On/Off commands)
 *    Change 8:    2015-01-28    (Sticks18)
 *                Modified My GE Link Bulb v2 for use with Cree Zigbee Bulb - New fingerprint and endpoint changed to 10
 *
 */
metadata {
    definition (name: "My Cree Bulb beta", namespace: "jscgs350", author: "smartthings") {

        capability "Actuator"
        capability "Configuration"
        capability "Refresh"
        capability "Sensor"
        capability "Switch"
        capability "Switch Level"
        capability "Polling"

        fingerprint profileId: "C05E", inClusters: "0000,0003,0004,0005,0006,0008,1000", outClusters: "0000,0019"
    }

    // UI tile definitions
    tiles {
        standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true, canChangeBackground: true) {
            state "off", label: '${name}', action: "switch.on", icon: "st.switches.light.off", backgroundColor: "#ffffff"
            state "on", label: '${name}', action: "switch.off", icon: "st.switches.light.on", backgroundColor: "#79b821"
        }
        standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
            state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
        }
        controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 3, inactiveLabel: false) {
            state "level", action:"switch level.setLevel"
        }
        valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") {
            state "level", label: 'Level ${currentValue}%'
        }

        main(["switch"])
        details(["switch", "level", "levelSliderControl", "refresh"])
    }
    
        preferences {
        
            input("dimRate", "enum", title: "Dim Rate", options: ["Instant", "Normal", "Slow", "Very Slow"], defaultValue: "Normal", required: false, displayDuringSetup: true)
            input("dimOnOff", "enum", title: "Dim transition for On/Off commands?", options: ["Yes", "No"], defaultValue: "No", required: false, displayDuringSetup: true)
            
    }
}

// Parse incoming device messages to generate events
def parse(String description) {
    log.trace description
    
    if (description?.startsWith("on/off:")) {    
        log.debug "The bulb was sent a command to do something just now..."
        if (description[-1] == "1") {
            def result = createEvent(name: "switch", value: "on")
            log.debug "On command was sent maybe from manually turning on? : Parse returned ${result?.descriptionText}"
            return result
        } else if (description[-1] == "0") {
            def result = createEvent(name: "switch", value: "off")
            log.debug "Off command was sent : Parse returned ${result?.descriptionText}"
            return result
        }
    }
    
    def msg = zigbee.parse(description)

    if (description?.startsWith("catchall:")) {
        // log.trace msg
        // log.trace "data: $msg.data"

        def x = description[-4..-1]
        // log.debug x

        switch (x) 
        {

            case "0000":

                def result = createEvent(name: "switch", value: "off")
                log.debug "${result?.descriptionText}"
                   return result
                break

            case "1000":

                def result = createEvent(name: "switch", value: "off")
                log.debug "${result?.descriptionText}"
                   return result
                break

            case "0100":

                def result = createEvent(name: "switch", value: "on")
                log.debug "${result?.descriptionText}"
                   return result
                break

            case "1001":

                def result = createEvent(name: "switch", value: "on")
                log.debug "${result?.descriptionText}"
                   return result
                break
        }
    }

    if (description?.startsWith("read attr")) {

        // log.trace description[27..28]
        // log.trace description[-2..-1]

        if (description[27..28] == "0A") {

            // log.debug description[-2..-1]
            def i = Math.round(convertHexToInt(description[-2..-1]) / 256 * 100 )
            sendEvent( name: "level", value: i )
            sendEvent( name: "switch.setLevel", value: i) //added to help subscribers

        } 

        else {

            if (description[-2..-1] == "00" && state.trigger == "setLevel") {
                // log.debug description[-2..-1]
                def i = Math.round(convertHexToInt(description[-2..-1]) / 256 * 100 )
                sendEvent( name: "level", value: i )
                sendEvent( name: "switch.setLevel", value: i) //added to help subscribers   
            }    

            if (description[-2..-1] == state.lvl) {
                // log.debug description[-2..-1]
                def i = Math.round(convertHexToInt(description[-2..-1]) / 256 * 100 )
                sendEvent( name: "level", value: i )
                sendEvent( name: "switch.setLevel", value: i) //added to help subscribers
            }    

        }
    }

}

def poll() {

    [
    "st rattr 0x${device.deviceNetworkId} 10 6 0", "delay 500",
    "st rattr 0x${device.deviceNetworkId} 10 8 0", "delay 500",
    "st wattr 0x${device.deviceNetworkId} 10 8 0x10 0x21 {${state.dOnOff}}"
    ]
    
}

def updated() {

    state.dOnOff = "0000"
    
    if (dimRate) {

        switch (dimRate) 
            {

                case "Instant":

                    state.rate = "0000"
                    if (dimOnOff) { state.dOnOff = "0000"}
                    break

                case "Normal":

                    state.rate = "1500"
                    if (dimOnOff) { state.dOnOff = "0015"}
                    break

                case "Slow":

                    state.rate = "2500"
                    if (dimOnOff) { state.dOnOff = "0025"}
                       break
                
                case "Very Slow":
            
                    state.rate = "3500"
                    if (dimOnOff) { state.dOnOff = "0035"}
                    break

            }
    
    }
    
    else {
    
        state.rate = "1500"
        state.dOnOff = "0000"
        
    }
    
        if (dimOnOff == "Yes"){
            switch (dimOnOff){
                case "InstantOnOff":

                    state.rate = "0000"
                    if (state.rate == "0000") { state.dOnOff = "0000"}
                    break

                case "NormalOnOff":

                    state.rate = "1500"
                    if (state.rate == "1500") { state.dOnOff = "0015"}
                    break

                case "SlowOnOff":

                    state.rate = "2500"
                    if (state.rate == "2500") { state.dOnOff = "0025"}
                       break
                
                case "Very SlowOnOff":
            
                    state.rate = "3500"
                    if (state.rate == "3500") { state.dOnOff = "0035"}
                    break

            }
            
    }
    else{
        state.dOnOff = "0000"
    }
    
    "st wattr 0x${device.deviceNetworkId} 10 8 0x10 0x21 {${state.dOnOff}}"


}

def on() {
    state.lvl = "00"
    state.trigger = "on/off"

    // log.debug "on()"
    sendEvent(name: "switch", value: "on")
    "st cmd 0x${device.deviceNetworkId} 10 6 1 {}"
}

def off() {
    state.lvl = "00"
    state.trigger = "on/off"

    // log.debug "off()"
    sendEvent(name: "switch", value: "off")
    "st cmd 0x${device.deviceNetworkId} 10 6 0 {}"
}

def refresh() {

    [
    "st rattr 0x${device.deviceNetworkId} 10 6 0", "delay 500",
    "st rattr 0x${device.deviceNetworkId} 10 8 0", "delay 500",
    "st wattr 0x${device.deviceNetworkId} 10 8 0x10 0x21 {${state.dOnOff}}"
    ]
    poll()
    
}

def setLevel(value) {

    def cmds = []

    if (value == 0) {
        sendEvent(name: "switch", value: "off")
        cmds << "st cmd 0x${device.deviceNetworkId} 10 8 0 {0000 ${state.rate}}"
    }
    else if (device.latestValue("switch") == "off") {
        sendEvent(name: "switch", value: "on")
    }

    sendEvent(name: "level", value: value)
    value = (value * 255 / 100)
    def level = hex(value);

    state.trigger = "setLevel"
    state.lvl = "${level}"

    if (dimRate) {
        cmds << "st cmd 0x${device.deviceNetworkId} 10 8 4 {${level} ${state.rate}}"
    }
    else {   
        cmds << "st cmd 0x${device.deviceNetworkId} 10 8 4 {${level} 1500}"
    }

    log.debug cmds
    cmds
}

def configure() {

    String zigbeeId = swapEndianHex(device.hub.zigbeeId)
    log.debug "Confuguring Reporting and Bindings."
    def configCmds = [    

        //Switch Reporting
        "zcl global send-me-a-report 6 0 0x10 0 3600 {01}", "delay 500",
        "send 0x${device.deviceNetworkId} 10 1", "delay 1000",

        //Level Control Reporting
        "zcl global send-me-a-report 8 0 0x20 5 3600 {0010}", "delay 200",
        "send 0x${device.deviceNetworkId} 10 1", "delay 1500",

        "zdo bind 0x${device.deviceNetworkId} 10 1 6 {${device.zigbeeId}} {}", "delay 1000",
        "zdo bind 0x${device.deviceNetworkId} 10 1 8 {${device.zigbeeId}} {}", "delay 500",
    ]
    return configCmds + refresh() // send refresh cmds as part of config
}

private hex(value, width=2) {
    def s = new BigInteger(Math.round(value).toString()).toString(16)
    while (s.size() < width) {
        s = "0" + s
    }
    s
}

private Integer convertHexToInt(hex) {
    Integer.parseInt(hex,16)
}

private String swapEndianHex(String hex) {
    reverseArray(hex.decodeHex()).encodeHex()
}

private byte[] reverseArray(byte[] array) {
    int i = 0;
    int j = array.length - 1;
    byte tmp;
    while (j > i) {
        tmp = array[j];
        array[j] = array[i];
        array[i] = tmp;
        j--;
        i++;
    }
    return array
}
3 Likes

The GE Link bulb device type is official in the sense that it was written by us. The device itself is not “certified” and does not appear on our Works With SmartThings page. The main reason for that is the issues we’ve observed and had reported to us with the bulbs dropping off a ZigBee network. They’ll become completely unresponsive and you have to factory reset them and rejoin them. We’ve seen this issue reported across multiple ZigBee controllers.

We’re still troubleshooting this issue and hope to have the GE Link bulb certified in the coming weeks.

3 Likes

The ST hub is sitting right below a table lamp with the bulb and there is no unknown device on my device list. So I am out of options as to why when the green light flashes on my st hub why it does not pick up the light bulb

@brian_rhoden what channel is ST operating on for zigbee? Should be in your hub info page in the IDE. I wonder if the Cree bulb can only operate on the Zigbee Light Link primary channels. I recall that being an issue with resetting Hue bulbs that join the ST network.

Have you tried factory resetting the Cree bulb? I was able to do it using the same instructions for the GE Link bulb.

Turn it off and wait 3 seconds. Turn it on then wait 3 seconds. Repeat this process until the bulb flashes to confirm that it’s been reset. It took me cycling off/on 6 times.

I look forward to hearing how the Cree bulbs compare to the GE Link and TCP bulbs. Light output and reliability etc.
Thx

2 Likes

So, the process can be a bit tricky. Here is what I do (the timing is pretty important):

You are going to do the following procedure:

on
off
pause 2 seconds (count it out)

So, with the power to the bulb OFF, and SmartThings not searching for a device:

on
(do not pause for more than a half second here, the on/off process is quick)
off
pause 2 seconds (count it out)

on
off
pause 2 seconds (count it out)

on
off
pause 2 seconds (count it out)

on

The bulb should flicker briefly (it has now reset).

Turn the bulb off here (don’t wait more than about a second after the bulb flickers). This is critical, I have found.

Wait about 3 seconds. During this period, tap the ‘+’ on the dashboard, then “Connect New Device”. This will start up the hub in pairing mode.

Turn the bulb on. This is basically like you had just pulled the bulb out of the box, new.

The bulb should show up now.

FWIW, I have had a REALLY hard time with pairing GE Link bulbs. Apparently the timing is random, or I just don’t have it down yet…

5 Likes

I reset the bulb just as you instructed, got 1 blink from the bulb and shut it off immediately. Started ST paring mode and turned the bulb back on. No dice. Same result of “searching” circle forever. I have tried it twice with same results. The hub is sitting right next to the lamp base 1 foot away from the bulb.

The manufacturer’s website has added a FAQ with instructions on how to do a factory reset if the bulb will not pair with a zigbee certified hub. As far as I know ST is not actually zigbee certified, but this might help anyway. Note that it’s a specific pattern that requires cycling power 4 times. The bulb will blink once to indicate the reset has occurred. At that point you turn it off again and do the regular pairing. This information is from the FAQ, not the installation instructions:

http://creebulb.com/products/standard-a-type/connected-60-watt-replacement-soft-white-led-bulb

“If you have successfully set up your compatible hub, but cannot get a Connected Cree® LED bulb to pair with the hub in the applicable app, you can factory reset your bulbs. To do this, install your bulb in a light fixture and turn it on. (For best results we recommend installing the bulb where you can turn the power off at a wall switch.) Turn the light switch on and off at two second intervals until the light blinks once to indicate it has reset. This should happen at the 4th full on-off cycle. You can then turn the light off and pair the bulb with your hub via the mobile App.”

Also, Gigaom says this is a Zigbee Light Link device as initially shipped, so it should work out of the box with a Hue controller, but not necessarily with ST.

https://gigaom.com/2015/01/15/crees-15-connected-leds-work-with-almost-everything/

However, doing the factory reset as described in the FAQ should then make it available to a hub using the Zigbee Home Automation standard. My understanding is that the ST hub is not zigbee certified, but uses a subset of the open Zigbee Home Automation standard, so that probably does mean the factory reset will be required.

Hubs that are not Zigbee Light Link certified will not have the ZLL handshake password, so that’s why they can’t communicate with the device without the reset.

1 Like

Is anyone else getting constant on and off states? I’m using the latest device type “My Cree Bulb Beta” and my logs are showing these on the 3 bulbs I’ve installed. It’s not actually turning on/off the device, perhaps it something in the device type code - maybe the fingerprint?

Date Source Type Name Value User Displayed Text Changed
2015-01-29 5:13:21.935 AM EST
moments ago DEVICE switch off Den Recliner Lamp switch is off true
2015-01-29 5:13:20.858 AM EST
moments ago DEVICE switch on Den Recliner Lamp switch is on true
2015-01-29 5:13:20.708 AM EST
moments ago COMMAND poll poll command was sent to Den Recliner Lamp true
2015-01-29 5:07:36.829 AM EST
9 minutes ago DEVICE switch off Den Recliner Lamp switch is off true
2015-01-29 5:07:36.061 AM EST
9 minutes ago DEVICE switch on Den Recliner Lamp switch is on true
2015-01-29 5:07:30.035 AM EST
9 minutes ago COMMAND poll poll command was sent to Den Recliner Lamp true
2015-01-29 5:01:27.075 AM EST
15 minutes ago DEVICE switch off Den Recliner Lamp switch is off true
2015-01-29 5:01:26.002 AM EST
15 minutes ago DEVICE switch on Den Recliner Lamp switch is on true

Hi Eric, I didn’t have a bulb to test with; so I assumed since this and the GE Link were so similar that the parse section would be ok as is. Is it getting the state of the bulb correct?

If you PM me the live logs of the bulb, I can tweak the device type to better parse the incoming messages.

has anyone found these for mail order on Home Depot’s website? I have looked a couple of times and drawn a blank.

They didn’t put Cree in the SKU name, but it’s on the Home Depot site. However, as of today all you can do is look at the inventory at nearby stores, you can’t order it for shipment. When you try to put it in the cart you get a message that you have to choose a different location. Enter a zip code and it will show in store inventory levels in that area.

http://t.homedepot.com/p/Cree-Connected-60W-Equivalent-Soft-White-2700K-A19-Dimmable-LED-Light-Bulb-BA19-08027OMF-12CE26-1U100/205757730?keyword=BA19-08027OMF-12CE26-1U100

Eric,

I’m using the Joshua Gray code that was fixed for dimming and I don’t see those in my device events.

I main problem I have with the code is that the on/off state doesn’t seem to update e.g. if I manually change the bulb state by toggling the physical switch, it gets out of sync with what ST thinks the state is.