I raise chickens and quail. Their egg laying ability is light dependent. They need a minimum of 14 hours of day light a day to produce eggs. What I would like to do is automate the coop light to turn on 14 hours before sunset and the turn off at sunrise. That way my birds get enough light to trigger laying and can go to roost naturally as the sun sets. They get stressed out and will not move or roost if the light suddenly turns of and it is dark which is why I can’t just set the light to turn off after sunset they need the natural reduction in light caused buy the sun setting to go to roost. This is why I need to add the light to go on before sunrise. So they still get 14 hours of light and can naturally go to roost with the setting sun. Please help me to find a solution.
There should definitely be a way to do it, but I’m confused by this description. You say “turn off at sunrise“. That would mean that the lights stayed on all night long, but that doesn’t sound like what do you want to have happen. It sounds like you want to have them turn off at sunset. But maybe with a gradual fade for another hour or so.
Could you check your post again and make sure that you have described what you want to have happen? They are actually several community members who keep chickens and I’ve done various kinds of automation, and some of them may chime in. But in any case, you should be able to get whatever schedule you want with smartthings. I just want to make sure that we are providing answers for the specific use case you are working with.
We will need to know the brand and model of the lights in the chicken coop, or of the light switch which is controlling them. Some have the ability to do a gradual fade and some don’t.
@JDRoberts, the OP asks for to turn on the light 14 hours before sunset, to have 14 hours of light. But to turn off the light at sunrise, because he doesn’t want to waste electricity when there is natural light available.
The only issue here is, if the daylight hours longer than 14 hours, from Sunrise to Sunset. But that could be handled by an exception maybe by WebCore or Sharptools.io, I believe the current Automations builder would not work with this, maybe if a Location Mode is defined as Daytime and Night time.
Anyhow, the point is, if daylight hours are less than 14, then provide extra light by automation before sunrise to make it 14.
Something like this
IF Sunset-Sunrise < 14 hours, THEN turn on light at Sunrise -(14 - (Sunset - Sunrise)) hours AND turn off light at Sunrise.
I see. I agree, it’s probably going to take one of the more powerful rules builders. Because we have two different situations.
A) The time between sunrise and sunset is less than 14 hours. In that case it’s easy, you just set a second rule that always turns the light off at Sunrise. So one rule turns them on 14 hours before sunrise and the second rule turns them off at sunrise.
B) The time between sunrise and sunset is more than 14 hours. Then you have a problem because the “turn off at sunrise“ rule would work, but then the lights will turn on again an hour or two later when it’s 14 hours before sunset. Which would leave them on all day, not what you want.
So, yeah, you need to be able to evaluate how long it is between sunset and sunrise and only turn on if that value is less than 14.
Again, you can just have a separate rule that always turns the light off at sunrise, that shouldn’t hurt anything. But it’s the not having the light turn on again if it’s a day when there is 16 hours of sunlight that is going to be trickier.
You could use Smart Lighting or multiple Automations to turn on the lights 14 hours before Sunset, only if Location Mode is Night time.
Another rule to turn off the light at Sunrise.
And two Automations to change Location mode to Night time at Sunset, and Daytime at Sunrise.
Maybe you can do the light off and change of Location mode to Daytime at Sunrise in one Automation.
So total 3 rule/Automation would do the job.
(Considering that no other Location modes are in use, otherwise a virtual switch could do the same, if no other option to define Day and Night time.)