Nobody has really commented on their impression of this bulb… opinions?
I don’t have one yet but my problem with the GE Link bulbs is that the light is totally undiffused. My dumb cree bulbs have a much nicer diffused light and I am hoping that smart Cree looks the same.
I don’t have a GE Link bulb to compare to, but I like them. They are a nice soft light. I don’t hear anything when their dimmed, even with my head a foot away.
In an ideal world, I would have a zigbee switch I could replace my physical one with, but until those come out, I need to have polling, even if it is only every few minutes it would do the trick. Can someone point me to some example code to see if I can get it working? I saw some threads talking about something called Pollster, but I don’t know if it is related or not.
SmartenIT has a zigbee wall switch that some people have used with ST, but I’m still waiting to hear if it’s functioning with ST as a true smart switch and reporting the state change.
Pollster is what you want then. It’s a great SmartApp that allows you to create groups of devices with different polling intervals (down to 1 minute). I use it for other purposes now for some devices that don’t auto-report their status. I did use it briefly for my GE Links, but for the reasons mentioned, I decided to stop.
Make sure that it is:
Used the on off 2, on off 2, on off 2, on blink, off, start connection and wait 2-3 seconds, on
I’ve noticed that the bulb can be picky as to the timing.
The cree connected’s light is identical to my dumb cree bulbs.
Thanks for the confirmation - definitely picking some of these up soon!
Well, I tried Pollster but it isn’t updating the status of the bulb even though I see the polling happening in the logs
Was this in the live logs? It should show the incoming messages from the bulb.
If not, does the state need updating? Does pressing refresh change the status? ST only posts logs where an attribute changes, so if the bulb status was “on” at level 99% and it polled to find the same status, you won’t see anything in the event logs.
I saw the poll in the Events for the bulb. It looked like this (every 5 minutes, which was the polling rate I set):
2015-02-03 3:05:06.297 AM PST COMMAND poll poll command was sent to Dining Table Light
2015-02-03 3:05:06.140 AM PST APP_COMMAND poll Polling sent poll command to Dining Table Light
Yes, manual refresh from the Smarthings App works…so I found a thread on modifying Pollster to do a refresh and tried it. That did the trick, and now the status updates!
With the change to the refresh code, now I only see COMMAND poll in the device events log, not the APP_COMMAND poll.
I also tried the refresh command and I’m seeing the same events - device is on, device is off almost instantly. Something with device handler, just not sure what…
fe110aa7-01d6-46c4-9ea2-7a9814f1d793
7:46:59 PM:
debug
Living Room Console Lamp Window switch is off
Similar type of events for the bulbs setup into a light group:
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
Getting solution event data for switchState:off
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
debug
EVENT: Living Room is off
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
setSolutionEvent()
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
info
SUMMARY EVENT data: [[icon:indicator-dot-orange, iconColor:#49a201, default:true, value:Some lights are on]]
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
state data of Lights & Switches: {"icon":"st.Appliances.appliances17","backgroundColor":"#79b821"}
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
state data of Lights & Switches:
{“devices”:[{“id”:“1e0e529e-db36-492b-8351-89b28404762c”,“value”:“on”},{“id”:“f02f6bcc-6e9c-4f89-b54e-638fb5c52ac2”,“value”:“on”}],“name”:“on”,“value”:"all
on",“backgroundColor”:"#79b821",“icon”:“st.Home.home8”,“unixTime”:1423000851846}
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
Getting solution event data for switchState:off
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
states of Lights & Switches: [state: all on, summary: on]
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
debug
EVENT: Living Room is off
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
state data of Lights & Switches: {"icon":"st.Lighting.light13-icn","backgroundColor":"#79b821"}
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
setSolutionEvent()
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
state data of Lights & Switches:
{“devices”:[{“id”:“d2fbfbbd-f928-4edc-94a6-06da209e4c15”,“value”:“on”}],“name”:“on”,“value”:“on”,“backgroundColor”:"#79b821",“icon”:“st.Lighting.light13-icn”,“unixTime”:1423001438174}
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
info
SUMMARY EVENT data: [[icon:indicator-dot-orange, iconColor:#49a201, default:true, value:Some lights are on]]
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
states of Lights & Switches: [state: on, summary: on]
45ef93ba-546a-44c7-a8d6-1445aff561c5
7:47:00 PM:
trace
state data of Lights & Switches: {"icon":"st.Appliances.appliances17","backgroundColor":"#79b821"}
fe110aa7-01d6-46c4-9ea2-7a9814f1d793
7:46:59 PM:
trace
catchall: 0104 0008 0A 01 0140 00 BDE7 00 00 0000 04 01 861000
fe110aa7-01d6-46c4-9ea2-7a9814f1d793
7:46:59 PM:
trace
read attr - raw: BDE70A00080A000000201A, dni: BDE7,
endpoint: 0A, cluster: 0008, size: 0A, attrId: 0000, result: success,
encoding: 20, value: 1a
fe110aa7-01d6-46c4-9ea2-7a9814f1d793
7:46:59 PM:
debug
Living Room Console Lamp Window switch is on
fe110aa7-01d6-46c4-9ea2-7a9814f1d793
7:46:59 PM:
trace
catchall: 0104 0006 0A 01 0140 00 BDE7 00 00 0000 01 01 0000001001
Okay I’m more or less a technology idiot but I’ve got the Smartthings and several switches. I’d like to pick up these bulbs but can’t possibly manage this code things (where on earth do you put the code?). Is it working yet to link these Cree to Smartthings? And I’ve read that all I need to do to update my Firmware is send an email to support. (Actually they sent an email last week that they were pushing out a new Firmware update).
Anyone have any advice here?
@mason here are the directions for adding a custom device type like the code in this thread. ST hasn’t published their Cree device type yet, so the bulb won’t auto-recognize. It’s pretty straightforward to take code provided by others and incorporate it.
Good luck!
Thanks for posting the logs! I see the issue with the device type I posted. The Cree messages for level change are in the same format (catchall:) as the on/off messages (for some reason GE Links send back a different message type); so the device handler is mistaking a level change message for an on/off and reacting to it.
I’ll try to fix this tonight or tomorrow and post updated code with better parsing.
I would generally agree with this, but i am using the smart bulbs fo lamps. They still work with the switch on the lamps (just turn the switch one extra click) and I can automate them as well.
Here’s an updated version of the My Cree Bulb device type. It should prevent the multiple on/off events users were seeing, by checking the clusterId of the incoming message and handling the on/off and level clusters differently. As always, I still don’t have this bulb to test, so please let me know if you see strange behavior like that.
/**
* 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
* Change 9: 2015-02-06 (Sticks18)
* Modified parse() to check clusterId of catchall messages. When clusterId is not on/off (0x0006), then we read the message for the level and send appropriate events.
*
*/
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"
if (msg.clusterId == 0x0006) {
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
}
}
else {
log.debug "Level message"
def i = Math.round(convertHexToInt(description[-6..-5]) / 256 * 100 )
sendEvent( name: "level", value: i )
sendEvent( name: "switch.setLevel", value: i) //added to help subscribers
}
}
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
}
Wow fantastic! Looks like this new device type did the trick for me, I’m not getting the constant on and off messages any longer.
Thanks so much for the help - It’s this community that makes me think SmartThings has a bright future.
Great to hear! Let me know if you have issues with the on/off status updating correctly or see the level go to zero unexpectedly. Without testing, those are the two most likely issues if I got the clusterId logic wrong.