[OBSOLETE] Circadian Daylight: SmartThings + Smart Bulbs

@Kristopher thanks for the reply, I just ordered 4 Osrams RGB bulbs. Do you suggest also getting Hue or Osram hub or does this smartapp work equally well with just direct connection with ST?

Hey @sticks18 that is awesome! I’ll merge to my branch.

@LakeEnd I have all of my Osrams connected directly to ST. Most of my Hues are as well, except the ones in my TV room which I have going through the Hub so I can use the Phillips apps

Kristopher

Hi! This looks like it almost does what I need… But not quite! Is it possible to run the color changes on a schedule instead of based on sensors? I don’t have any switches or sensors yet… But I would like to automate my Osram bulbs so when they come on either through a routine or when manually triggered in the SmartThings app they will turn on at an appropriate color based on time of day and then shift over time if left on. Has anybody seen or come up with something that would do that?

1 Like

Well I´m not the developer of this app, but I took a quick look into the code and I believe it uses sunrise and sunset values from your local area to base the color temperature on, NOT any sensor input which wouldn´t make much sense anyway IMO.

Yeah I can give this a shot. Previously scheduled on timers were verbotten but a lot has changed since v2 :slight_smile:

Sorry for the crazy delay, but I spent a lot of time testing the timers. Check out the code I posted on Github, it now uses timers instead of motion sensors :slight_smile:

2 Likes

Thanks, testing now.

By the way, one thing puzzling me, I am using Osram RGB bulbs, should I list them under “Which Color Changing Bulbs”, “Which Temperature Changing Bulbs”, “Which Dimmers” or perhaps list them in all of these categories?

TIA!

Just “Which Temperature Changing Bulbs”. Each bulb should only be in one section with preference being Temp, Color then Dimmer; so since the Osram qualifies for all 3, it should be under Temp.

@LakeEnd this is just a byproduct of how ST sees devices. As @Sticks18 mentioned, the RGB bulbs have an on switch, dimmer and RGB functionality, so they show up in all 3. You don’t want to select all 3 though. I’m optimistic ST will give us finer control on being able to make that cleaner.

(You definitely want to put them under Color Changing Bulbs)

@Kristopher I think the current code dated November 6 has a minor bug in ctbulbHandler. Line 163 reads for(ctbulb in ctbulb) but should be for(ctbulb in ctbulbs). I have only been testing for a few hours but so far I am very grateful for your contribution.

Thank you! I pushed the commit out :slight_smile:

Hello,

I just picked up a couple of the OSRAM Tunable White bulbs, so I installed Circadian Daylight. It’s pretty neat, but there are a few things I’m confused about.

Dynamic Lighting: How does that work? I think above you said it adjusts the dim level based on time of day, but what is the relation between the two?

Setting dim level when a light is turned on: I’ve noticed that now when I turn lights on, they go to full brightness instead of keeping the previous dim level. I think that installing this app is what caused the change. Is that correct and if so, is there any way to stop it?

Hi @tamaracks

Yep - the Dynamic Lighting setting just dims the light throughout the day. So at midday, its at 100%, and at sundown, its at 1%. I use it for accent lights and stuff.

Dimming when turned on: Yeah - if you set the dim to like 50% then the app is going to set it to a different level if you have Dynamic Lighting on. If you turn off the dynamic lighting, this won’t happen (er, shouldn’t at least).

Kristopher

Hmm, I think something may not be quite right then. I didn’t have Dynamic Lighting on for the first day or two after setting it up, and the behavior of the dim level changing on my lights when they turned on has been there since I installed the app.

I just turned Dynamic Lighting on last night. At the time, nothing seemed to change with the lights. But maybe that’s because it will only change on a schedule and it was already past the last scheduled point of the evening? Today it has been changing the dim level. Although at one point this afternoon, it seemed like the lights dimmed, then brightened, then dimmed again. Although, looking at the ST app now, I may have some motion rules in Smart Lighting that were responsible for the level change.

Also, does Circadian Daylight turn lights on or only change the level if they are already on? There are a couple times that lights have turned on when I didn’t expect them to, but I am not totally sure what prompted that. I’ll have to be more vigilant about paying attention to the activity listed in the app when that happens.

I did toggle the Dynamic Lighting setting on, then immediately back off a couple times after installing the app, because I wasn’t sure if I should leave it on. Is it possible that confused something?

Thanks,
Tamara

This doesn’t work with Lifx bulbs does it? I just bought a bunch of the new Color 1000 bulbs and I am loving everything about them except that there is very little dev support for them currently. I am hoping as the prices come down, more people with dev skills will start coding for them. They work really well and can dim much better than the other bulbs I have used, Cree connected and GE Link.

They should work with this app. I’d include them in the Color Temperature bulbs section since they can accept a kelvin color temp directly. You can replace Osram in my comment below with Lifx and it would hold true…

The advantage of ST is that you don’t have to develop SmartApps for specific devices, only the capabilities like Color Temperature, Color, Switch, Switch Level in the case of Lifx. They should work with any SmartApps that accept devices with those capabilities and/or call commands associated with them.

I have seen comments that the Lifx colors don’t match the color wheel selection or other color bulbs, and that would be an issue with deviceType that needs to be sorted out. I have one of the newer A19 versions on my Xmas wish list, and if I get one, I’ll be digging into the Lifx API to see what other features can be added.

1 Like

Hi @Cullen_Patel

It should work with LIFX with the caveats @sticks18 mentioned :smile:

Kristopher

1 Like

I’ve been using this for a few months, and I’ve been running into a couple annoyances that eventually caused me to remove the SmartApp. I’m wondering if others are experiencing the same.

The biggest annoyance is that more often than not, when a bulb is told to turn off it will immediately turn itself back on. It seems to be more common when I manually send an off command then when a SmartApp or routine sends an off command, but it happens in both situations. I’ll loop through an off/on loop for sometimes 5 minutes before I can get my lights to stay off.

Slightly less annoying is that the hue lightstrip plus is always a very green color. I looked at the pending pull request with changes for friends of hue lights, and tried adding that code but it didn’t seem to make a difference.

I have a V2 SmartThings hub, and all of my bulbs are Hue, connected to a V2 Hue hub. It seems most people here connect the bulbs directly to the SmartThings hub, so maybe that’s my issue?

Hey @claytonjn

Sorry to hear about your experience. Since ST is all event based, the way the code works is that I set a timer in the future to trigger an event (modeHandler()). That handler checks the current state of bulbs, and if they are on, sets the brightness and color temp to the appropriate temp. However, if the Hub is not in sync with the bulb, then the app ends up turning the bulb on again.

Getting the bulbs properly in sync with the Hub is a challenge for sure. For example, my Hue bridge has 40 bulbs. When a bulb changes state on the Hue bridge, all Hue bulb states get pushed to the ST Hub. Sometimes, this takes more than 20 seconds, which causes a timeout between ST and Hue. I hackily solve this by using the Pollster app to refresh one Hue bulb (doesn’t matter which one) every minute. It mostly works.

With regard to the lightstrip – I have noticed this on my Hyperion as well. I am not really sure why the green tint on that either. I know @juano2310 wrote some code to tweak the HSV to get a little closer to reality, but it does seem different per device too.

As for your last point: I connect all of my Hues to the Hue bridge, and everything else (Osrams) to the ST V2 Hub. I used to connect my Hues directly to the ST Hub. It does cut down the latency and keeps the bulb state in better sync. The only reason I switched back to the Hue Hub was to update the firmware on the bulbs. As a word of warning though, even though I wrote a Hue device type, detecting if a bulb is “offline” is still pretty hacky and not done as well as it is on the Hue Hub.

Hope that helps,

Kristopher

I tried Pollster for a few days, but it actually seemed to make it worse. With Pollster running, trying to turn off any particular bulb would not only occasionally result in that bulb coming back on but occasionally other random bulbs that were off would also turn on. I’ll keep testing, but I’m surprised other people haven’t run into this issue. Maybe it’s because I have a relatively high number of bulbs/other devices, or because of other SmartApps I have running on my system…