My first SmartApp and I need help! Cree Bulb to dim when turned on

(Scott) #1

So I have searched the forums and can’t find an example close enough to this to make it work for my needs… And I do not yet have a motion detector or a smart light switch with dimming capability (for which I have found good Apps to do what I would like).

I have three Cree connected lightbulbs screwed into a single fixture in our stairwell and I would like to write a SmartApp that makes them dim between the hours of x and y (say 7PM to 6AM). I tried setting this up with two apps; The first which turns on the bulb at 7 with a dim level of 10% and the second that turns the bulb on again with a dim level of 99%, however I quickly realized that this requires the bulb to physically have power to be updated in this state.

I do not know how good the response time would be for a SmartApp that looks for the bulb to be turned on, evaluates the time of day, and then sets the intensity of the bulb(s) accordingly…

What is the best way to go about this?


First things first…

A smart bulb assumes that it will always have power to draw from. That’s how it’s able to hear the next command to “turn on” (which really means to turn up).

If a smart bulb loses all power, such as being turned off with a dumb switch, the next time the power comes on, the results will vary by manufacturer, but normally they’ll turn on to full power.

From the Cree Connected Bulb User Guide:

What will happen if I turn off a Connected Cree® LED bulb at the wall/lamp switch or power outlet?

If the switch or power source for the bulb is turned off, the bulb can no longer be controlled via the App. In addition, scheduled changes for that bulb while the power is off will not take place. When the switch is turned back on, the bulb will light to full brightness and can then be controlled in the App.

So as long as you leave the bulbs always powered on from the mains, it should be very easy to schedule them however you like.

But these bulbs are not intended to be completely powered off and then report bring powered on again before doing anything else, that’s just not how mesh networks work. You can turn them completely off, but then you start from the beginning each time, in this case full brightness.

So do you have these bulbs always powered on?

(Scott) #3

Thank you JD
Your story is mostly what I expected. I do have these bulbs connected up to a dumb switch, and we are using that switch to turn power on and off from the bulb. What I wasn’t sure about was the second statement, that the bulbs would indeed return to full power when they were switched on and off again by the main switch.

None-the-less, is it still possible for ST to detect the event of the bulb turning on and then dimming the power down based on the time of day? I understand that this would mean the bulb turning on at full brightness and then moving to a lower intensity.



Not directly.

One of the main points of a mesh network is “resilience.” They were designed for set ups where many of the devices would be relatively cheap, relatively dumb devices who might often be offline, either sleeping to preserve battery life or having batteries changed. The controller isn’t supposed to panic if one of the devices hasn’t been heard of for awhile, nor do the devices themselves check in as they come and go. This is part of what keeps mesh networks cheap in terms of both money and energy draw.

You can attach an energy monitoring device to the line and try to guess that way, but this is rarely successful with just a couple of light bulbs, because their energy draw is so low that dim tends to look like off.

A far easier way is to either change out the dumb switch for a smart one, or put a switch lock on the dumb switch and add a battery powered smart switch next to it. The first requires electrical wiring, the second does not. Or you can add a cheap tablet control center. For any of these, the cost is typically around $50 -$75. Once you eliminate use of the dumb switch, scheduling is easy again.

some links to forum topics discussing options:


(Scott G) #5

Unfortunately ST cannot handle this well because the bulb doesn’t send a message when it’s shut off at the switch, so ST won’t know that it’s off. The bulb also doesn’t send a reliable message that we can parse and take action on when the bulb is first powered back up. It’s just not in the design of smart bulbs to be manually powered on/off.

You can try to use the Pollster app to “Refresh” the bulb, so that ST would pick up the correct state of the bulb shortly after “turn on”; but that’s dependent on keeping the ST state in sync with actual bulb. For example, if the prior state was on at 99% when it’s manually shut off, it will stay that way until ST is told differently. When it’s next turned on at the switch, ST wouldn’t recognize it as a change in state because it already thinks it’s on at full brightness.