# Date and Time - Before Sunset

**URL:** <https://community.homey.app/t/date-and-time-before-sunset/10138>\
**Category:** Flows\
**Created:** [March 5, 2019, 4:59pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138 "2019-03-05T16:59:17Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Family\_KK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/family_kk/32/8901_2.png) [@Family\_KK](https://community.homey.app/u/Family_KK)\
**Post date:** [March 5, 2019, 4:59pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/1 "2019-03-05T16:59:17Z")

</div>

Hi  
I’d like to crete a flow that says something like  
When - “45 minutes before sunset”  
Action - “Turn on that light”.  
Is this possible?  
Thanks  
Kaj

---

<div class="post-metadata">

**Author:** ![Bjorn\_Andersson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bjorn_andersson/32/13731_2.png) [@Bjorn\_Andersson](https://community.homey.app/u/Bjorn_Andersson)\
**Post date:** [March 5, 2019, 5:02pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/2 "2019-03-05T17:02:23Z")

</div>

![sunset-45](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/9/9dd8d3bd70012e0bee245f39cc37e96d7f01b78d.jpeg)  
This should work, methinks…

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [March 5, 2019, 5:05pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/3 "2019-03-05T17:05:00Z")

</div>

And also with the build in time cards:

 ![chrome_2019-03-05_18-04-19](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/3/36e971fdb505f74b0d12701f327dddd2934907c9.png)

---

<div class="post-metadata">

**Author:** ![Family\_KK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/family_kk/32/8901_2.png) [@Family\_KK](https://community.homey.app/u/Family_KK)\
**Post date:** [March 5, 2019, 5:28pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/4 "2019-03-05T17:28:19Z")

</div>

Thank you Bjorn\_Andersson  
I don’t have that option in the When’s though.  
Do I need to add a feature or something like that?

---

<div class="post-metadata">

**Author:** ![Family\_KK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/family_kk/32/8901_2.png) [@Family\_KK](https://community.homey.app/u/Family_KK)\
**Post date:** [March 5, 2019, 5:29pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/5 "2019-03-05T17:29:44Z")

</div>

Thank you Rocodamelshe.  
Is that to be read as, when it is 45 minutes to sunset?  
I thought it meant, when the sun sets, wait 45 minutes?

---

<div class="post-metadata">

**Author:** ![Bjorn\_Andersson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bjorn_andersson/32/13731_2.png) [@Bjorn\_Andersson](https://community.homey.app/u/Bjorn_Andersson)\
**Post date:** [March 5, 2019, 5:39pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/6 "2019-03-05T17:39:06Z")

</div>

It’s an app called “Sun Events” that you download as any other app. It has more states, like “golden hour” etc.

---

<div class="post-metadata">

**Author:** ![Family\_KK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/family_kk/32/8901_2.png) [@Family\_KK](https://community.homey.app/u/Family_KK)\
**Post date:** [March 5, 2019, 5:50pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/7 "2019-03-05T17:50:29Z")

</div>

Ahhhh, ok, thank you. Still familiarising with the system.  
Thanks, I think it is what i am looking for.

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [March 5, 2019, 5:57pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/8 "2019-03-05T17:57:44Z")

</div>

> [@Family\_KK](#):
>
> Is that to be read as, when it is 45 minutes to sunset?

That will be correct. And this card is not from an app u have to download, it’s a standard card already build in .

---

<div class="post-metadata">

**Author:** ![ktd](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ktd/32/11761_2.png) [@ktd](https://community.homey.app/u/ktd)\
**Post date:** [June 6, 2019, 7:54pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/9 "2019-06-06T19:54:09Z")

</div>

Is there an easy way to have that card but after sunset? Using delay in the {then} card is ok if you have one or two actions but if I make a flow with lights that have brightness, color, temp etc. it would be more convenient to have it in the {when} card imo.  
I would like to use the built in cards as much as possible.

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [June 6, 2019, 8:17pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/10 "2019-06-06T20:17:47Z")

</div>

> [@ktd](#):
>
> … is ok if you have one or two actions …

Split it in two flows, SunSet Trigger - Delay: Trigger a Flow2 …  
The other flow can have all objects… makes it imho easier to manage… and no extra App!

---

<div class="post-metadata">

**Author:** ![ktd](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ktd/32/11761_2.png) [@ktd](https://community.homey.app/u/ktd)\
**Post date:** [June 6, 2019, 8:25pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/11 "2019-06-06T20:25:49Z")

</div>

Of course. Did not think of that. 🙂

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Marc\_Bakermans](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marc_bakermans/32/12554_2.png) [@Marc\_Bakermans](https://community.homey.app/u/Marc_Bakermans)\
**Post date:** [July 18, 2019, 9:05pm UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/12 "2019-07-18T21:05:36Z")

</div>

For some reason this card is only in the when section available, and not in the AND section of the flow. Does any one know the reason?

I want to use this in combination with a lux sensor. But I do not want the lights to go on, when there is a havey rain on the day time. But if i am forced to use the sunset card only in the when rule, than the rule does not get triggered by the lux sensor.  
So how could I best use this combination to achieve:

- if lux sensor alarms on low light AND time is 45 minutes before sunset, then turn lights on.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/a/ad6af4c3e4960b1beb50520ca8283b7ccb683959.jpeg)

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [July 19, 2019, 6:08am UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/13 "2019-07-19T06:08:25Z")

</div>

> [@Marc\_Bakermans](#):
>
> if lux sensor alarms on low light AND time is 45 minutes before sunset, then turn lights on

U need another way of thinking. Today the sun sets at 21:50. So ur flow says when lux is low AND it is 21:05 THEN turn on the lights. This will never happen and is not the good way to go. Not saying this is easy because the light/darkness and the sunset is different every day. I want the lights to go on when it’s getting dark, not when the sun goes down. So I have a flow that starts at 1600 and checks every 15 minutes if the sensor is on. When it’s on I put on the lights and disable the flow.  
It’s not perfect but it comes close. U cannot get it perfect, just try something u like the most.

---

<div class="post-metadata">

**Author:** ![Gruijter](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gruijter/32/1973_2.png) [@Gruijter](https://community.homey.app/u/Gruijter)\
**Post date:** [July 19, 2019, 6:46am UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/14 "2019-07-19T06:46:20Z")

</div>

I use my solar panels as light detector. When solar power is very low \> switch on lights. The power is checked every 10s, so response is fast. Only problem is that the solar power output not only depends on light, but also on temperature. So when it is very cold, the light switches on later then when it is warm.

---

<div class="post-metadata">

**Author:** ![FKey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fkey/32/14793_2.png) [@FKey](https://community.homey.app/u/FKey)\
**Post date:** [July 19, 2019, 7:51am UTC](https://community.homey.app/t/date-and-time-before-sunset/10138/15 "2019-07-19T07:51:16Z")

</div>

> [@Marc\_Bakermans](#):
>
> But I do not want the lights to go on, when there is a havey rain on the day time. But if i am forced to use the sunset card only in the when rule, than the rule does not get triggered by the lux sensor.

Like @Dijker mentioned, splitting up flows makes it easier to manage and understand. (Many flows is not bad!)  
So in this case I would suggest create a flow that enables the other flow at sunset. This way it will not trigger when its raining.  
(Make sure to also disable the flow at some time otherwise it only works one day…)
