# How Homey implements SUNSET and SUNRISE?

**URL:** <https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358>\
**Category:** Flows\
**Tags:** flow, homey-pro, advancedflow\
**Created:** [February 19, 2026, 4:28pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358 "2026-02-19T16:28:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tequila\_sunrise](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tequila_sunrise/32/121430_2.png) [@tequila\_sunrise](https://community.homey.app/u/tequila_sunrise)\
**Post date:** [February 19, 2026, 4:28pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/1 "2026-02-19T16:28:33Z")

</div>

There exists a need for documentation on the Homey flow cards because, sometimes, the flow card name alone is not sufficient and doesn’t convey all the needed details for users to create successful automation flows.

# Problem at hand

I created two flows involving a motion sensor and two light bulbs.

One flow, named evening flow, to turn on the light at cooler color temp and higher brightness between _ **SUNSET** _ and midnight.  
One flow, named morning flow, to turn on the light at much warmer color temp and dimmer brightness between midnight and _ **SUNRISE** _.

## Evening flow details

When…  
the motion alarm turned on  
And…  
“Date & Time - It’s after sunset”  
“Date & Time - The time is earlier than 11:59 PM”  
Then…  
set a temperature 20%  
dim to 70%  
turn on light

## Morning flow details

When…  
the motion alarm turned on  
And…  
“Date & Time - The time is later than 00:00 AM”  
“Date & Time - It’s before sunrise”  
Then…  
set a temperature 90%  
dim to 10%  
turn on light

What I want to achieve is two different brightness/color temp at two different times from SUNSET to SUNRISE.

However, the _ **evening** _ flow is triggered even between midnight and SUNRISE. What I found from Homey web interface is that both “Date & Time” conditions in the _ **evening** _ flow are evaluated to true. Upon thinking about this, it makes sense that “The time is earlier than 11:59 PM” is evaluated to true because any time between midnight and SUNRISE is indeed earlier than 11:59 PM. But how is SUNSET (and SUNRISE too) implemented by Homey??? Since “after sunset” is still true minutes past 12 AM, I can only ASSUME that (1) “after sunset” is true from SUNSET to SUNRISE and (2) “after sunrise” is true from SUNRISE to SUNSET.

I haven’t tested/confirmed the condition evaluation of the morning flow in Homey web interface yet. Another question I have is the sequence of flows executed by Homey. Is it possible that the 4 conditions from both the flows are evaluated to true and that the morning flow is executed before the evening flow such that I see the result of the evening flow?

Having said all these, how should the flows be configured to achieve what I want? Please help.

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [February 19, 2026, 4:39pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/2 "2026-02-19T16:39:51Z")

</div>

I assume that “after sunset” means between sunset and midnight, but I haven’t tested it myself yet.  
And because the flows you describe are correct in principle, I suspect that you may have made a mistake in the “real” flow. It would be better if you could post a screenshot of your flow.

---

<div class="post-metadata">

**Author:** ![s73nm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/s73nm/32/110438_2.png) [@s73nm](https://community.homey.app/u/s73nm)\
**Post date:** [February 19, 2026, 4:51pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/3 "2026-02-19T16:51:33Z")

</div>

Something like this?

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

The card “Het is ‘s nachts” (It’s nighttime ?) is created by reversing the “Het is overdag” (It’s daytime ?) Carré, which is the last in the Date & Time section.

The start (16:00 / 4pm) and end times (08:00 / 8am) of the time slots can be adjusted according to your location. These should be before the earliest possible sunset and after latest possible sunrise in your location.

EDIT: Of course you can also use the before / after sunset cards in combination with the “it’s between … and …” cards.

EDIT2: Another option is the Sun Events app, which has dedicated cards for testing between a sun event and a time.

> **[Sun Events | Homey](https://homey.app/en-us/app/com.cyclone-software.sunevents/Sun-Events/)**
>
> Triggers you at certain positions of the sun.

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [February 19, 2026, 7:00pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/4 "2026-02-19T19:00:00Z")

</div>

At my location the sun sets at 18:01 (6:01 PM)  
So 1:00 ( 1:00AM) is before sunset.

The sun rises at 7:49. So 23:00 (11:00PM) is after sunrise.

To proof my point I build this testflow and ran it at 22:45

 ![IMG_2090](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/e/fe122d479e8e2ab38891ac3f91f1db2964a07253.jpeg)

It turns out I was wrong.

---

<div class="post-metadata">

**Author:** ![Oyvind\_Lilleberg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oyvind_lilleberg/32/140892_2.png) [@Oyvind\_Lilleberg](https://community.homey.app/u/Oyvind_Lilleberg)\
**Post date:** [February 20, 2026, 7:53am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/5 "2026-02-20T07:53:06Z")

</div>

I think it depends on how you build your flow with your “and” cards. You should but it so that both should be true before triggering the action card.

I think you have right about the assumption of the sunrise/sunset cards.

Before sunrise is between sunset and sunrise.  
Before sunset is between sunrise and sunset.

The first flow in my example will trigger all night since one of the “and” cards is true.  
The second flow will only trigger when both “and” cards are true.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/9/29e2f2f19fa54ee704006e9078c197251a83919e.png)

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [February 20, 2026, 9:54am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/6 "2026-02-20T09:54:19Z")

</div>

> [@How Homey implements SUNSET and SUNRISE?](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/4):
>
> At my location the sun sets at 18:01 (6:01 PM) So 1:00 ( 1:00AM) is before sunset. The sun rises at 7:49. So 23:00 (11:00PM) is after sunrise. To proof how it really works I build this testflow and ran it at 22:45 It turns out I was wrong.

It turns out I was wrong.

---

<div class="post-metadata">

**Author:** ![tequila\_sunrise](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tequila_sunrise/32/121430_2.png) [@tequila\_sunrise](https://community.homey.app/u/tequila_sunrise)\
**Post date:** [February 21, 2026, 3:08am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/7 "2026-02-21T03:08:40Z")

</div>

Thank you, @DirkG. I tested the conditions today and can confirm that what you said is correct.

“After sunset” is the duration from sunset to sunrise.  
”After sunrise” is the duration from sunrise to sunset.

It is _ **at** _ the exact moment of sunset or sunrise when the evaluation/state changes. In other words, “after sunset” remains true from sunset to sunrise and changes to false _ **at** _ sunrise while “after sunrise” remains true from sunrise to sunset and changes to false _ **at** _ sunset.

Below is the evening flow that _didn’t_ work the way I wanted in that it _also_ ran between 12:00 AM and sunrise when I wanted it to run only between sunset and 12:00 AM.

Now that I know how “after sunset’“ and “after sunrise” are defined, I can proceed to make the correction.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/1/91c7e17fed2eb3ca6eb6a884ee7d10a1becc290e.png)

---

<div class="post-metadata">

**Author:** ![tequila\_sunrise](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tequila_sunrise/32/121430_2.png) [@tequila\_sunrise](https://community.homey.app/u/tequila_sunrise)\
**Post date:** [February 21, 2026, 3:49am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/8 "2026-02-21T03:49:25Z")

</div>

I completely missed the “It’s nighttime” card, and I have been wondering why there is not a “from sunset to sunrise” card instead of two separate “It’s after sunset” and “It’s after sunrise” cards. Thanks for bringing that to my attention, @s73nm. I’ll give it a try before resorting to the Sun Events app.

---

<div class="post-metadata">

**Author:** ![tequila\_sunrise](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tequila_sunrise/32/121430_2.png) [@tequila\_sunrise](https://community.homey.app/u/tequila_sunrise)\
**Post date:** [February 21, 2026, 3:55am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/9 "2026-02-21T03:55:47Z")

</div>

No problem at all, @Wim_Post. Thank you for trying! I appreciate your help.

---

<div class="post-metadata">

**Author:** ![tequila\_sunrise](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tequila_sunrise/32/121430_2.png) [@tequila\_sunrise](https://community.homey.app/u/tequila_sunrise)\
**Post date:** [February 21, 2026, 4:15am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/10 "2026-02-21T04:15:52Z")

</div>

Hello @Oyvind_Lilleberg, I am still very new to Homey Pro. As far as I see from the advanced flows provided, the only difference between the two flows is that the bottom flow has the “ALL” entity. The “ALL” entity is also in @s73nm‘s reply. I still need to read more on advanced flow creation. What does this “ALL” entity represent/do? It doesn’t seem to have a category like “Date & Time”, “Logic”, etc.

---

<div class="post-metadata">

**Author:** ![s73nm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/s73nm/32/110438_2.png) [@s73nm](https://community.homey.app/u/s73nm)\
**Post date:** [February 21, 2026, 7:32am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/11 "2026-02-21T07:32:17Z")

</div>

> [@tequila\_sunrise](#):
>
> What does this “ALL” entity represent/do?

When looking at advanced flows, try to imagine tokens moving across the lines of the flow:

- When a trigger condition occurs (WHEN card), a token is placed on the line.
- When the line splits, the token splits and moves across all the paths
- When checking a condition (AND card), the conditions are evaluated. If the condition is met (TRUE,) the token continues along the upped output (blue line) of the AND card. If the condition is not met (FALSE), the token will move along the lower output (yellow line) of the AND card. If not line is connected to the output along which the token should progress, the token vanishes.
- Whenever a token reaches the input of a card, that card is executed immediately, except for an ALL card. The ALL card waits until it receives a token on each of the input lines. When a token is received on each line, the ALL card will let a single token continue on its output line.

Also good to know: when multiple tokens reach the input of a card during a flow, only the first token that reaches the card will be allowed to continue.

Using the partial flow I posted earlier, this would mean that:

- When the flow is started, 3 tokens are moving across the lines, and reach the 3 condition cards.
- When it’s after 4pm, but before midnight, the token will be allowed to moved along the TRUE output line of the top AND card, otherwise it will cease to exist.
- The same is true from the bottom and card, when the time is between midnight and 8AM.
- The middle condition card will allow the token to pass only between sunset and sunrise.

This means that:

- The first ALL card will only receive tokens on all its input when it is after sunset (and before sunrise), and after 4pm, but before midnight. Once, after midnight, the ALL card will not allow the token to pass.
- The bottom ALL card will only receive tokens on all its inputs when it’s before sunrise (and after sunset), and when it is after midnight and before 8AM. Before midnight, it will never receive a token from the time check and so it will not allow the token to pass.

---

<div class="post-metadata">

**Author:** ![Oyvind\_Lilleberg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oyvind_lilleberg/32/140892_2.png) [@Oyvind\_Lilleberg](https://community.homey.app/u/Oyvind_Lilleberg)\
**Post date:** [February 21, 2026, 7:44am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/12 "2026-02-21T07:44:50Z")

</div>

> [@tequila\_sunrise](#):
>
> It doesn’t seem to have a category like “Date & Time”, “Logic”, etc.

You find the card by right clicking on the canvas in advanced flows. There you should find the card.

Also a great tips to understand flows better is to test the flows when you are in the canvas. For example click on the icon for the WHEN card to start the flow, or right click on the card you want to test from. Then you can visually see what happens when the flow is validating each card and you can track the progress of the flow, seeing if the state of the card is true or false (blue or yellow).

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [February 21, 2026, 10:50am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/13 "2026-02-21T10:50:32Z")

</div>

Hi @Doekse, maybe you can help us get some clarity on this.  
Does Athom have a specific definition for the following two “And…” flow cards?  
– It’s after sunset  
– It’s after sunrise

Or conversely, if you reverse the cards.

---

<div class="post-metadata">

**Author:** ![Doekse](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/doekse/32/109415_2.png) [@Doekse](https://community.homey.app/u/Doekse)\
**Post date:** [February 21, 2026, 11:06am UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/14 "2026-02-21T11:06:18Z")

</div>

I’d need to confirm the exact logic to be certain, but based on my understanding _(and experience using it)_:

“It’s after sunset” becomes true once the sun has set and remains true until the next sunrise, essentially when it’s dark outside.

“It’s after sunrise” becomes true once the sun has risen and remains true until the next sunset, in other words; when it’s light outside.

Reverting the card would essentially turn it into the other card.

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [February 21, 2026, 12:11pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/15 "2026-02-21T12:11:07Z")

</div>

> [@Doekse](#):
>
> “It’s after sunset” becomes true once the sun has set and remains true until the next sunrise, essentially when it’s dark outside.

So there no difference in behavior between the ‘it’s after sunset’-card and the ‘it’s dark’-card. Why have both cards available?

---

<div class="post-metadata">

**Author:** ![Doekse](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/doekse/32/109415_2.png) [@Doekse](https://community.homey.app/u/Doekse)\
**Post date:** [February 21, 2026, 1:13pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/16 "2026-02-21T13:13:33Z")

</div>

> [@Wim\_Post](#):
>
> the ‘it’s dark’-card

Which exact card do you mean here?

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [February 21, 2026, 1:46pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/17 "2026-02-21T13:46:15Z")

</div>

![IMG_2092](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/0/9089000193fdf3467735b9c9f443fcb810b81822.jpeg)

I thought that the dutch ‘het is overdag’ is called ‘it’s light’ in english. So ‘het is ‘s nachts’ is translated as ‘it’s dark’. But maybe it’s ‘daytime’/‘nighttime’

I assumed that ‘het is overdag’ is between sunrise and sunset. And ‘het is ‘s nachts’ is between sunset and sunrise.

Apparently I was wrong all the time so now I am curious when ‘het is overdag’ is true

---

<div class="post-metadata">

**Author:** ![Doekse](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/doekse/32/109415_2.png) [@Doekse](https://community.homey.app/u/Doekse)\
**Post date:** [February 21, 2026, 2:05pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/18 "2026-02-21T14:05:58Z")

</div>

Good question, the difference is between dawn/dusk and sunset/sunrise. Let me explain;

After sunrise and after sunset are based on the exact moment the sun crosses the horizon.  
So:

- After sunrise = from the moment the sun rises until it sets
- After sunset = from the moment the sun sets until it rises again

That’s purely based on the sun being above or below the horizon, being 0°.

Daytime is slightly different. That one is based on civil twilight _(civiele schemering in Dutch 😉 )_. Homey defines daytime as the period between dawn and dusk, where dawn is when the sun is 6° below the horizon in the morning, and dusk is when it’s 6° below the horizon in the evening.

That means:

- Daytime starts a bit before the actual sunrise
- Daytime ends a bit after the actual sunset

So “_daytime_” is always slightly longer than the period between sunrise and sunset.

In practice:  
If you want something to follow the exact sun-up / sun-down moment, use sunrise/sunset.  
If you want it to follow when there’s already _(or still)_ natural light outside, daytime is usually the better choice.

I hope that explains it!

---

<div class="post-metadata">

**Author:** ![SunBeech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sunbeech/32/111391_2.png) [@SunBeech](https://community.homey.app/u/SunBeech)\
**Post date:** [February 21, 2026, 6:53pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/19 "2026-02-21T18:53:59Z")

</div>

@Doekse: This kind of clarifications is very useful, in my opinion. Maybe your colleagues that maintain Homey’s Knowledge Base, can add it to that repository.

---

<div class="post-metadata">

**Author:** ![Doekse](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/doekse/32/109415_2.png) [@Doekse](https://community.homey.app/u/Doekse)\
**Post date:** [February 21, 2026, 7:06pm UTC](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358/20 "2026-02-21T19:06:27Z")

</div>

For the “It’s daytime” Flow card it has a hint with the information on how the card works 😉

I’ll ask the team if it can be added for the other two cards as well.

[Next page](https://community.homey.app/t/how-homey-implements-sunset-and-sunrise/151358.md?page=2)
