# How to start a flow at a spesific time stored in variabel, with built in functions (Solution - Check every 60 minutes or use the app "Timey")

**URL:** <https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853>\
**Category:** Flows\
**Tags:** flow\
**Created:** [May 14, 2024, 5:18pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853 "2024-05-14T17:18:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [May 14, 2024, 5:18pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/1 "2024-05-14T17:18:27Z")

</div>

Hello,

Does anybody have a suggestion on how to start a flow based on a time stored in a Variable, without the use of “SunEvents” app or any other apps besides the built in functions? I also do not want to have a flow running “every 5 minutes” or so, to check if variabel match the system time.

My case is, my outside lighting is going on/off based on median-lux or using the built in “Sunset/Sunrise function”, but i wish to turn off the lights some hours in the middle of the night. My thought was to add a time to the Sunset time, and the Sunrise time that Homey stores, if the times overlap each other, then i will not turn of the lights.

I am using “SunEvents” for only two trigger-cards today, and that is the “Moon set” and “Nautical Dawn”, but i wish to reduce the Memory consumption and uninstall the app, but the built in “Time” card, does not support a variabel.  
I might got a App that can suite my needs, but not aware of it:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/d/6de62891bf9f6ccf88bc7066039731a3750598dd.png)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/5/d51c5a00ae02d0cef5f64a50fa77ba4bb18a6728.png)

I also got a running RaspberryPi, if that one can be of some use to post a event of some kind, without the need of installing more apps on the HP.

Regards  
Marius

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [May 14, 2024, 8:43pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/2 "2024-05-14T20:43:54Z")

</div>

> [@Marius\_Stensrod](#):
>
> outside lighting is going on/off based on median-lux or using the built in “Sunset/Sunrise function”,

What is your trigger?  
WHEN there is movement  
or  
WHEN luminance changed

Why not add a card  
AND it is not 00:00-05:00  
or another equivalent card for night time?

Or do the opposite:  
AND it is daytime or 06:00-18:00  
or  
AND it is after sunrise AND before sunset

Can you show your current flow?

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [May 14, 2024, 8:57pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/3 "2024-05-14T20:57:28Z")

</div>

> [@Marius\_Stensrod](#):
>
> My thought was to add a time to the Sunset time, and the Sunrise time that Homey stores, if the times overlap each other, then i will not turn of the lights.

Could you give some examples at which the time the lights shall be switched on and off, in case there is overlap and in case there is no overlap?

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [May 15, 2024, 10:29am UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/4 "2024-05-15T10:29:04Z")

</div>

> [@Marius\_Stensrod](#):
>
> (…)without the (…) apps besides the built in functions? I also do not want to have a flow running “every 5 minutes” or so, to check if variabel match the system time.

Without any of them, it might be difficult. There are potential solutions depending on when will the variable be set and how often it might be changed.  
So you need at least the App _Countdown_, which is not built in but already installed in your system, or something similar.  
Unfortunately _Countdown_ knows only seconds, and I do not know what is the maximum there.  
The idea is that you run  
_When…_ **Every _1_ days**  
_Then…_ **Start countdown timer _VariableTime_ _MySeconds_**  
And another line in your advanced flow or an extra flow:  
_When…_ **Timer reaches zero(0) _VariableTime_**  
_Then…_ Switch your light on/off, etc  
_ **VariableTime** _ is just my choice for the name of the Timer, and _ **MySeconds** _ is the variable keeping the chosen time in seconds.

If _Countdown_ is limited in the seconds used, you might need something like _Chronograph_ or start with every 1 hour and check the the hour before starting the seconds.

And if you want the time calculated or set during the day, you might need _BetterLogicLibraray_ or something which is capable of calculating with time strings.

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [May 15, 2024, 3:48pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/5 "2024-05-15T15:48:33Z")

</div>

@Rrrr, @Rmb and @DirkH , Thanks for the different suggestions. Time is trigger.

Flow example:

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

I am capable of getting the correct time i want, and compare the two different (sunrise with offset and sunset with offset) times to determine if the “night off” function should operate or not. But the Time-trigger is my big case, the CountDown suggestion is not a bad idea.

When = “Time is _string-variable_” , is the option i am missing, and woundered if it was a workaround out there somewhere.

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [May 15, 2024, 4:20pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/6 "2024-05-15T16:20:46Z")

</div>

Time stamp is not the right trigger for sure. You have two sun events as trigger.

Can you do Google translate in your web page so it’s easier to read your cards?

There are various work arounds for you, but it’s better to show you one that fits your flow model

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [May 15, 2024, 4:34pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/7 "2024-05-15T16:34:53Z")

</div>

> [@Rrrr](#):
>
> Can you do Google translate in your web page so it’s easier to read your cards?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/f/6f1613e991c90cf2e596c5ce78326b40c5f6c0c7.jpeg)

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [May 15, 2024, 4:50pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/8 "2024-05-15T16:50:12Z")

</div>

From this technical detailed (and perhaps not yet correct) flowchart, it is too difficult for me to understand your goal. So I give the floor to @Rrrr an @DirkH 😁

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [May 15, 2024, 5:05pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/9 "2024-05-15T17:05:03Z")

</div>

> [@Marius\_Stensrod](#):
>
> compare the two different (sunrise with offset and sunset with offset) times to determine if the “night off” function should operate or not. But the Time-trigger is my big case, the CountDown suggestion is not a bad idea.

Great.  
So taking what has been written before:

Solution A:  
If you want to remove the app, I think that you will find a close compromise if you focus on the native sun cards.

Sunrise and sunset and the average time you have in your country (for more sophistication you can specify an AND with the months):

- before sunrise
- after sunset

| | | | | | | |
| --- | --- | --- | --- | --- | --- | --- |
| Period | Day  
time | Night  
time | Degrees sun below horizon | Period starts at | Period ends at | Amsterdam  
 3 Jun 2019 |
| Astronomical twilight | | V | 12-18 degrees | Astronomical dawn | Nautical dawn | 00:00-03:22 |
| Nautical twilight | | V | 6-12 degrees | Nautical dawn | Civil dawn | 03:22-04:35 |
| Civil twilight | V | | 0-6 degrees | Civil dawn | Sunrise | 04:35-05:23 |
| Daylight | V | | - | Sunrise | Sunset | 05:23-21:54 |
| Civil twilight | V | | 0-6 degrees | Sunset | Civil dusk | 21:54-22:42 |
| Nautical twilight | | V | 6-12 degrees | Civil dusk | Nautical dusk | 22:42:23:56 |
| Astronomical twilight | | V | 12-18 degrees | Nautical dusk | Astronomical dusk | 23:56-00:00 |
| Nightlight | | V | \>18 degrees | Astronomical dusk | Astronomical dawn | 00:00-   
 4 jun 2019 |
| | | | | | | |

For example:

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

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [May 15, 2024, 5:12pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/10 "2024-05-15T17:12:40Z")

</div>

Thanks for the suggestion, the timer solution might be the best solution, with different timers depending on the Month of the year.

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [May 15, 2024, 8:31pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/11 "2024-05-15T20:31:14Z")

</div>

The alternative is a simple (Philips Hue) outdoor motion/luminance sensor on your roof.

Works great too on dark, rainy days

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [May 15, 2024, 8:44pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/12 "2024-05-15T20:44:58Z")

</div>

What good would that do? I already got Median-lux reading (as mentioned before) from two different sensors.

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [May 15, 2024, 8:51pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/13 "2024-05-15T20:51:51Z")

</div>

I lost you there. Maybe I misunderstood your issue. If you have exact sensors that trigger a flow, why work with Sun Events?

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [May 15, 2024, 8:59pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/14 "2024-05-15T20:59:32Z")

</div>

@Rrrr , yes, i tried to describe it as good as possible, but something maybe godt lost in “translation”.

> [@Marius\_Stensrod](#):
>
> ”, but i wish to turn off the lights some hours in the middle of the night

Who needs lights outside when the house are sleeping?

My previous snip was only a small part of the “outside light flows”. It was a snip of my reason to make the topic, to get some more ideas.

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [May 15, 2024, 9:54pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/15 "2024-05-15T21:54:18Z")

</div>

I had the idea that in summer nights you want to have lights on during the short night. But in wintertime only at the beginning of the evening and early in the morning. And switch them of in the middle of the night.

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [May 15, 2024, 9:58pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/16 "2024-05-15T21:58:01Z")

</div>

Sounds about right 👍👌

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [May 15, 2024, 11:07pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/17 "2024-05-15T23:07:02Z")

</div>

> [@Marius\_Stensrod](#):
>
> Flow example:
> 
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/d/fdf20c78b584f6fb4c033d7c32e897e197af7ee1.png)

I am not really sure, what you want as I do not understand nautical dawn and why it is related to the moon, as the moon can rise or set at any time during day or night.  
But do not combine events, if you have to decide afterwards, which event was started. Just keep the two events separated and duplicate the card that it has to be between Saturday and Monday. Then you can avoid asking again, if it is moon set or nautical dawn.

---

<div class="post-metadata">

**Author:** ![Rrrr](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rrrr/32/629_2.png) [@Rrrr](https://community.homey.app/u/Rrrr)\
**Post date:** [May 16, 2024, 7:26am UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/18 "2024-05-16T07:26:36Z")

</div>

> [@Marius\_Stensrod](#):
>
> yes, i tried to describe it as good as possible, but something maybe godt lost in “translation

No worries, but you did not use sensor readings in your flow anywhere.

I assumed your lux sensors were not sensitive enough to measure twilight.

But in that case (a little beyond the scope of your question) you can create amazing flows that can also be tweaked for when it’s dark in daytime and motion/presence.

I’ll assume you have some of that covered.

Solution B  
Twilight approximation

Generic  
WHEN lux becomes smaller than 50  
Then turn lights on

WHEN lux becomes greater than 55  
Then turn lights off

Part 1 Night twilight  
WHEN lux changed  
AND lux \< 5  
AND it’s after 22:00  
AND lights are on  
THEN turn off

WHEN it’s 23:00  
AND lights are on  
THEN turn off

Part 2 Morning twilight  
WHEN lux changed  
AND lux \> 0 AND \< 55  
AND it’s after 04:00  
AND lights are off  
THEN turn on

According to your region you will have to tweak.

Note:  
“WHEN lux becomes greater/smaller than”  
will fire less often.

The below uses more CPU but you may need to work with it in a limited time period:  
WHEN lux changed  
AND lux \< xx  
AND time between x and y

---

<div class="post-metadata">

**Author:** ![Marius\_Stensrod](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marius_stensrod/32/56540_2.png) [@Marius\_Stensrod](https://community.homey.app/u/Marius_Stensrod)\
**Post date:** [May 16, 2024, 6:02pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/19 "2024-05-16T18:02:20Z")

</div>

> [@DirkH](#):
>
> But do not combine events, if you have to decide afterwards, which event was started. Just keep the two events separated and duplicate the card that it has to be between Saturday and Monday. Then you can avoid asking again, if it is moon set or nautical dawn.

It is actually not combined. The “logic card’s” separates the functions.

> [@Rrrr](#):
>
> No worries, but you did not use sensor readings in your flow anywhere.

That is because i have only shared my issue, and that is not to turn on or off the lights based on LUX/Luminance, Sunrise/Sunset and so on. The flow works good, as it is, it is used to turn off and on the lights in the middle of the night. But i want to replace the “SunEvent” cards with a App i already have or the Native/built in functions Homey offers, to free up memory on the HP.

To clarify with SunEvents Cards:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/e/becc6e193cc4f83c9a176a629a6e0d3de53bf209.png)

WHEN - Sunset = Light ON  
WHEN - Dawn = Light OFF  
WHEN - Moon Set = Light ON  
WHEN - Sunrise = Light OFF

The Times for Dawn and MoonSet, do i wish to replace with a calculated offset on the “Sunset” and “Sunset” that Homey stores. I do still want to use time as a trigger, but the Native/Built in functions does not support a “Variable/Tag” and i am in search for a “workaround”, so i can delete the “SunEvents” app. If Homey supported “Variable/Tag” in the “Time is xxxx” card, the issue would be solved. But because it is a community, and not the Homey development, i am in search of a workaround 🙂

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [May 16, 2024, 7:21pm UTC](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853/20 "2024-05-16T19:21:35Z")

</div>

Maybe this gives you enough flexibility:

 ![IMG_3266](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/e/2e2eecbdce9aa6814896d44322b4330b7968f850.jpeg)  
A variable time to advance and a fixed time to delay.

Or you run a flow every 5 minutes AND calculate if the time is a variable X minutes before or after sunset/sunrise.

PS: it is very confusing to use moon events to switch on or off a lamp, because a moon event is not a sun event. But eventually you will find out yourself.

[Next page](https://community.homey.app/t/how-to-start-a-flow-at-a-spesific-time-stored-in-variabel-with-built-in-functions-solution-check-every-60-minutes-or-use-the-app-timey/109853.md?page=2)
