[RELEASE] Day Lights - an iteration of Circadian Daylight

hey, thanks for coming back to me. they're the options i recall, but this is what i have now: (app shows it's not been updated since 2022. am running latest version of hub software)

Go into the development section and apps code, then into the daylight driver. You’ll see an import option.

Paste this URL in:

https://raw.githubusercontent.com/OldChicagoPete/Hubitat/main/Apps/Day%20Lights/DayLights.groovy

Then click import. And then save.

You should noww have the latest and best version by @OldChicagoPete

done that and the page looks pretty identical to the last version. i'm sure there used to be an option that just disabled the whole app from running when the hub was in a given mode (in my case night mode). that way when i come downstairs at night all my lights go red, and stay red, so i can see where i'm going. with the circadian app running, they get reset to the last colour temp as soon as they come on.

As I remember from using Adam's app, at the end of the daylight hours it would "reset" the bulbs and I ended up using the mode overrides to keep the bulbs at a lower brightness after sunset and/or as the bulbs turned off and back on. In fact that was the driving factor for me to take a look at the code in the first place which led to me developing this version of it.

Having said all that, both apps have the option to disable via a switch. In your screenshot the Disable Circadian Daylight Options button will lead to another page with a section named "Disable Circadian Daylight when the following switches are on:" where you can choose a switch (or switches) that will stop the app from messing with your manual updates. All you'd need to do is turn the switch on in Night mode when you set the bulbs to red.

1 Like

aha, yes, of course, it's that simple. i can toggle an override to disable the flow at Night and toggle it off when the mode changes away from Night. that'll do it!

thanks for all your help, both

2 Likes

I'm new to all this so I don't really know the best way to address this. I have this app running on all my smart can lights on my living room but I realized that if I just turn a couple of them off, they are turned back on by the app during the next adjustment. Is it possible to have an option for the app to ignore lights that are turned off?

One option I figured was to set up every light on a separate instance of the app and add the override but I'm sure there's an easier way. Thought?

The app does check if the device is on before applying the adjustment. I wonder if you might have all those lights in a group, and you have specified that group as a single device in Day Lights? Groups can be set up to either report as "on" if any of the devices are on or to report as "off" if any of the devices are off. But either way if the group is the device you specify in Day Lights the whole group will be treated based on the status of the group.

The other option is to use the individual devices in one instance of Day Lights and each will have its own on/off status. You can still use the group for other applications like a dashboard tile, but Day Lights will respect each individual device's status while it updates.

Adding the lights individually did the trick. Thank you!

Hi - I may have created a bug - I recently wanted to adjust the start and stop by changing my sunrise/sunset times + 2hrs. I am now getting this error:

my setting change is:

Guidance?

Just wanted to let you know that I can recreate the error and will be taking a look at it. It's strange, I'm almost sure that this functionality was tested and worked before.

I'll let you know once I get a fix for it. And just so you know, those offset values are in minutes, so for your 2-hour offset you'll want to use 120.

1 Like

I wondering (and about to test) is it the +/- sign I'm pre-pending?
edit nope. maybe double vs int? nope

I've updated the code on github, thanks for finding that!

There's a couple of other changes that I've made for myself over the last couple of months in there as well. The one that is user-facing is the option to specify switches that will turn on when Day Lights becomes active in the morning and turn off after the defined sunset.

2 Likes

thanks OCP. I'm testing now. I did stumble a bit - I overlaid your github file in my HE. Went into the app and drilled to the SR/SS location. I already had values from previous test of -120 and +120.
The +120 was now showing as 120, but the SR field still showed -120.
I clicked done but got an error about required field:

I cleared the fields, and turned off the 'Use ...' switch and was able to get out. Re-Entered, and added a value and had no issues. I'll watch the trigger tonite at the +120 mark. :slight_smile:

I did change those fields from being decimal to a general number, so that might have been some internal Hubitat stuff going on there. I'm glad you were able to work around it.

hey @OldChicagoPete - can you look at something? Not sure if my expectation is set wrong or i'm bumping my head.
Looking at Sunrise-sunset.org there is a nice little pic of the twilight space.

My desire was to have a CT bulb reflect Day light color and brightness and thats working nicely. I just lost my graph data (i botched an influxdb upgrade) so I've nothing to easily demonstrate to you but my intent has been to have the bulb come on based on the morning civil twilight provided by the Sr-ss.org api (I pull this with a Telegraf into my influxdb since the Influxdb doesn't allow me to pull SR/SS date field from HE... )
image
I"m simulating that with the +/- override you just fixed. (just using a rough +/- 30min).
My expectation was the bulb would be off until the SR Override time was met, then begin its ramp up and down, then turn off at the 30 min after SS (per the override).
Whats happening is the App switch goes off, but no command to the bulb(s) is occurring to turn it on or off. I've manually monitored it for 3 days and its consistent and I've double checked no other apps or rules are touching this test bulb.
The question - is the app intent to control the bulb on / off as well as manage the ramping?
Here's a snip of my dashboard for fun - it's missing the grafana embed tile i've added since the data was lost and will require a full day before I can demonstrate..

The app's intent is not to turn the bulb on/off, however one of the changes that I put in along with the recent fix is an option to specify a switch to turn on/off when Day Lights is active. I use that to control a virtual switch that I can use in other automations to determine if the bulb is currently under control by the app.

I haven't tested it, but I don't see why you wouldn't be able to use that to control the on/off status of the bulb itself. That new option is on the main app page under Select Devices/Other switches to turn on while Day Lights is active.

okay.. added rules to compensate! thanks.