# Time and Sunrise happen on different days

**URL:** https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029
**Category:** Flows
**Created:** [April 20, 2025, 2:07am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029 "2025-04-20T02:07:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 20, 2025, 2:07am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/1 "2025-04-20T02:07:37Z")

</div>

I am trying to setup the following flow:  
when hallway becomes active between 04:00am and sunrise turn in the hall light.  
However the flow activates all day because ‘Sun Events’ considers Sunrise to be the next day.  
So far I cannot workout how to ensure they are the same day.  
Would appreciate any assistance…

---

<div class="post-metadata">

### Author: ![Chris\_nl](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_nl/32/27194_2.png) [@Chris\_nl](https://community.homey.app/u/Chris_nl)
#### Post date: [April 20, 2025, 3:37am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/2 "2025-04-20T03:37:51Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/0/702f23b1f8a89742ea97f72afd299655df352387.png)

Something like that should work

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 20, 2025, 3:52am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/3 "2025-04-20T03:52:48Z")

</div>

Hmmm, thank you for the suggestion… however this definitely does not work.  
e.g. if sunrise is 6:00am then the flow “thinks” that the flow is referring to sunrise tomorrow.  
BUT after much more thought, I think I have solved it…

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/a/da51f935ba0c6df623f3377b91fa09c35e1e70e4.png)

---

<div class="post-metadata">

### Author: ![Chris\_nl](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_nl/32/27194_2.png) [@Chris\_nl](https://community.homey.app/u/Chris_nl)
#### Post date: [April 20, 2025, 3:56am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/4 "2025-04-20T03:56:23Z")

</div>

Thats very weird, will test my flow in a few hours, but I use the sunrise flow in multiple other flows without any issues so far. Your workaround should work, depending on where you live and if 8 AM is not before sunrise.

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 20, 2025, 3:56am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/5 "2025-04-20T03:56:52Z")

</div>

Sorry missed some text…  
e.g. if sunrise is 6:00am and the current time is 10:00am then the flow “thinks” that the sunrise  
is referring to sunrise tomorrow.

---

<div class="post-metadata">

### Author: ![Chris\_nl](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_nl/32/27194_2.png) [@Chris\_nl](https://community.homey.app/u/Chris_nl)
#### Post date: [April 20, 2025, 3:59am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/6 "2025-04-20T03:59:38Z")

</div>

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/9/59b97d3cd5e2cde16af316af34e4b9bdab6586d1.png)

What if you do something like this?

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 20, 2025, 4:00am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/7 "2025-04-20T04:00:32Z")

</div>

i.e. if the current time is later than sunrise, then the sunrise card “must” refer to sunrise tomorrow.  
Definitely some issue with the logic in the ‘Sun Events’ app.

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 20, 2025, 4:01am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/8 "2025-04-20T04:01:36Z")

</div>

Yes I have tried this… in fact I have tried every possible combination of these cards.

---

<div class="post-metadata">

### Author: ![Chris\_nl](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chris_nl/32/27194_2.png) [@Chris\_nl](https://community.homey.app/u/Chris_nl)
#### Post date: [April 20, 2025, 4:02am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/9 "2025-04-20T04:02:34Z")

</div>

thats just so weird, ah well, your workaround works fine too, just make sure that in your location sunrise will never be later than 8 AM (or change that variable)

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 20, 2025, 4:06am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/10 "2025-04-20T04:06:17Z")

</div>

Thanks  
👍

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 20, 2025, 4:08am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/11 "2025-04-20T04:08:12Z")

</div>

Ooops… I guess you mean sunrise will always be earlier than 8am

---

<div class="post-metadata">

### Author: ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)
#### Post date: [April 20, 2025, 12:43pm UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/12 "2025-04-20T12:43:05Z")

</div>

> [@Mark\_Broadhurst](#):
>
> if the current time is later than sunrise, then the sunrise card “must” refer to sunrise tomorrow.  
> Definitely some issue with the logic in the ‘Sun Events’ app.

That’s correct and logic behaviour though.

At this moment it’s mid day, meaning:  
the sunrise event of today is completed/due.  
Now, when I want to check on the “before sunrise” event, it uses the _upcoming_ sunrise (of tomorrow morning), not the _past_ sunrise event of today.  
Because I cannot trigger on “it’s before sunrise” while it’s already _past_ sunrise, is it.

Btw, the Sun Events sunrise conditional card will act just like the onboard sunrise conditional card.

The flow [Chris showed](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/6) just works.  
Just _don’t_ use a “it’s between 4:00h and 8:00h” conditional card if sunset can occur _before_ 8.00h  
Just use “it’s later than 4:00h”.

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 20, 2025, 11:50pm UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/13 "2025-04-20T23:50:45Z")

</div>

Thank you for the detailed reply.  
However I believe the correct logic is - if the current time is after sunrise and before midnight then it is after sunrise so the flow will not trigger. Tomorrows sunrise only becomes true after midnight.  
If the app operated in this way, it would solve so many issues.

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 21, 2025, 12:00am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/14 "2025-04-21T00:00:52Z")

</div>

Note: In my ‘Time & Date’ app I do not have “it’s before sunrise” I can only see “It’s after sunrise”.  
Please advise where to find the “before” card…

---

<div class="post-metadata">

### Author: ![Philip\_Montgomery](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/philip_montgomery/32/12434_2.png) [@Philip\_Montgomery](https://community.homey.app/u/Philip_Montgomery)
#### Post date: [April 21, 2025, 7:32am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/15 "2025-04-21T07:32:27Z")

</div>

![Screenshot 2025-04-21 083047](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/d/3dc6406e7cb1d4e61a0f7b7192e603ab170e6470.png)  
I have been using this for more than a year, works perfectly. If you have advanced flows

---

<div class="post-metadata">

### Author: ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)
#### Post date: [April 21, 2025, 2:46pm UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/16 "2025-04-21T14:46:23Z")

</div>

> [@Mark\_Broadhurst](#):
>
> “it’s before sunrise” I can only see “It’s after sunrise”

Most of these kind of cards have the possibility to invert the function (right-click? )

---

<div class="post-metadata">

### Author: ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)
#### Post date: [April 21, 2025, 10:42pm UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/17 "2025-04-21T22:42:20Z")

</div>

And besides the invert flag, often AND cards of advanced flows have a True (blue) and a False (orange) output.  
With “It’s after sunrise = false” you create a “it’s before sunrise” condition.

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 22, 2025, 1:47am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/18 "2025-04-22T01:47:55Z")

</div>

Thank you so much for this tip… I have never heard of this feature before!  
Very much appreciate everyone’s input… I think I have this flow working now. 😀

---

<div class="post-metadata">

### Author: ![phil](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phil/32/44552_2.png) [@phil](https://community.homey.app/u/phil)
#### Post date: [April 26, 2025, 7:52am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/19 "2025-04-26T07:52:10Z")

</div>

I would invest in a light sensor to put outside or in a window to measure the light outside. Then you can easily set the logic of ”if lux is lower than X”.

Then you get the most accurate trigger.

---

<div class="post-metadata">

### Author: ![Mark\_Broadhurst](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mark_broadhurst/32/80103_2.png) [@Mark\_Broadhurst](https://community.homey.app/u/Mark_Broadhurst)
#### Post date: [April 27, 2025, 1:29am UTC](https://community.homey.app/t/time-and-sunrise-happen-on-different-days/135029/20 "2025-04-27T01:29:08Z")

</div>

Thank you for the suggestion but this would not provide a solution for the issue I had.  
I only want the light to turn on between 4am and sunrise.  
Thanks to [Chris\_nl](https://community.homey.app/u/Chris_nl) my flow is now working perfectly.
