# Do I need 2 flows to switch something off at 11pm and on at 7am?

**URL:** <https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272>\
**Category:** Questions & Help\
**Created:** [January 6, 2024, 10:48pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272 "2024-01-06T22:48:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregory](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gregory/32/81824_2.png) [@Gregory](https://community.homey.app/u/Gregory)\
**Post date:** [January 6, 2024, 10:48pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/1 "2024-01-06T22:48:27Z")

</div>

Hello  
I’d like to switch something off at 11pm and on at 7am via a Fibaro smart plug.  
I could do this easily via 2 different flows (the first flow WHEN it’s 11pm THEN Switch Off, and the second flow WHEN it’s 7am THEN Switch on).  
Is there a more efficient way to do this in one single flow?  
Thanks,

Gregory

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [January 6, 2024, 10:50pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/2 "2024-01-06T22:50:05Z")

</div>

Yes, im Advanced Flows. There you could drag 2 whencards to the Then cards.

---

<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:** [January 6, 2024, 11:14pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/3 "2024-01-06T23:14:55Z")

</div>

It can be done, a little bit error proune:

 ![IMG_3033](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/4/241235cde00449580c6a081c66f984bbb2c59c3c.jpeg)

---

<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:** [January 7, 2024, 12:37am UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/4 "2024-01-07T00:37:52Z")

</div>

Yes @Rmb,  
but only if you ensure that no one is able to switch it by any other means.  
If anybody pushes the switch in between, for example as she or he needs something at 6:57 am and then is happy that it is toggled at 7 am, it would do just the opposite that is wanted.  
But wonderful idea , I just would prefer the more precise variant.

 ![MyToggleTest](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/e/1e6a693acd02f921ea76681f35e2223d6c801226.jpeg)

---

<div class="post-metadata">

**Author:** ![Paul\_Scholte](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/paul_scholte/32/16562_2.png) [@Paul\_Scholte](https://community.homey.app/u/Paul_Scholte)\
**Post date:** [January 7, 2024, 1:43am UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/5 "2024-01-07T01:43:59Z")

</div>

In the App Advanced Scheduler you can define your scheduled switch-times. In a flow you use the triggercard “when schedule NNN is active”. That’ll trigger your flow at the predfined times.

You may also define in Advanced Scheduler tags that you can use to control the actions in your flow.

Kind regards,  
Paul

---

<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:** [January 7, 2024, 9:05am UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/6 "2024-01-07T09:05:27Z")

</div>

Wonderful, this one will not get out of sync! I was looking for this solution, but didn’t find it yet.

---

<div class="post-metadata">

**Author:** ![Gregory](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gregory/32/81824_2.png) [@Gregory](https://community.homey.app/u/Gregory)\
**Post date:** [January 7, 2024, 9:55am UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/7 "2024-01-07T09:55:30Z")

</div>

Thanks everyone!

---

<div class="post-metadata">

**Author:** ![Gregory](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gregory/32/81824_2.png) [@Gregory](https://community.homey.app/u/Gregory)\
**Post date:** [January 7, 2024, 9:59am UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/8 "2024-01-07T09:59:11Z")

</div>

Thanks a lot @DirkH ! Would you mind explaining it to me with plain words as I’m not sure to fully understand everything based on your screenshot.  
Many thanks 🙂

---

<div class="post-metadata">

**Author:** ![Gregory](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gregory/32/81824_2.png) [@Gregory](https://community.homey.app/u/Gregory)\
**Post date:** [January 7, 2024, 10:01am UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/9 "2024-01-07T10:01:15Z")

</div>

Thanks @Paul_Scholte ! I try to avoid using too many “unofficial” apps (fear of bugs) but this looks like an interesting one! I bookmarked it.

---

<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:** [January 7, 2024, 10:17am UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/10 "2024-01-07T10:17:03Z")

</div>

If I may explain 😁

1. The flow runs every hour.
2. It toggles the light only IF
  - it is 7 o’clock AND the light is off  
OR
  - it is 23 o’clock AND the light is on

So even when something gets wrong and the light is already on at 7 o’clock, the light stays on. So the flow is very robust, you might say “self healing” 😁.

The beauty of this solution is that you don’ need a another (nested) IF statement (which is not possible in a normal flow) like:

- IF it is 7 o’clock  
-THEN switch the lamp on
- IF it is 23 o’clock  
-THEN switch the lamp off

---

<div class="post-metadata">

**Author:** ![DrChaos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/drchaos/32/96452_2.png) [@DrChaos](https://community.homey.app/u/DrChaos)\
**Post date:** [January 7, 2024, 12:35pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/11 "2024-01-07T12:35:44Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> Yes, im Advanced Flows.

What’s Advanced Flows? It doesn’t appear to be in the app list.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [January 7, 2024, 1:10pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/12 "2024-01-07T13:10:58Z")

</div>

What do you have? Homey online/subscription?  
No Homey Pro i guess?

---

<div class="post-metadata">

**Author:** ![Gregory](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/gregory/32/81824_2.png) [@Gregory](https://community.homey.app/u/Gregory)\
**Post date:** [January 7, 2024, 2:16pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/13 "2024-01-07T14:16:33Z")

</div>

@Rmb Awesome. Thanks a lot!

---

<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:** [January 7, 2024, 8:40pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/14 "2024-01-07T20:40:39Z")

</div>

Start your own thread, and search this forum.

---

<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:** [January 7, 2024, 8:54pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/15 "2024-01-07T20:54:43Z")

</div>

> First of all, welcome to the Homey Community!
> 
> To make sure you are aware of the forum rules, please read the _ **Welcome to the forum!** _ post [here](https://community.homey.app/t/welcome-to-the-forum/31).

> Please use the Search and start reading before starting new questions, especially do not start NEW questions in other Topics that can be easily found!

> [Search results for 'Advanced Flows order:latest' - Homey Community Forum](https://community.homey.app/search?q=Advanced%20Flows%20order%3Alatest)

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

fe \> [[FAQ][Advanced Flow] Infinite canvas. Infinite creativity](https://community.homey.app/t/faq-advanced-flow-infinite-canvas-infinite-creativity/65145)

---

<div class="post-metadata">

**Author:** ![Joozt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joozt/32/24964_2.png) [@Joozt](https://community.homey.app/u/Joozt)\
**Post date:** [January 10, 2024, 6:25pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/16 "2024-01-10T18:25:49Z")

</div>

You can also trigger at 11PM, immediately turn it off and also turn it on, with a delay of 8 hours.

---

<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:** [January 10, 2024, 10:55pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/17 "2024-01-10T22:55:55Z")

</div>

It seems as if there is a strange effect in Homey with long delays. In my case one minute was too long as it was repeated every 10 minutes.  
So in case you shut down your Homey while a flow is waiting in a delay, the flow will never start until you change something and save the flow again, even if there is no effective difference.  
I have no proof as I do not want to spoil my precious tool, but it was a good explanation for my effect. As some other people told about similar occasions and proposed a timer event instead I just use _delay_ for a few seconds if the order of executing cards is essential.  
So I guess an 8 hour delay is not a good idea. But yes, it would work well, if there were not that Homey _bug_

---

<div class="post-metadata">

**Author:** ![cbeerse](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/cbeerse/32/34307_2.png) [@cbeerse](https://community.homey.app/u/cbeerse)\
**Post date:** [January 13, 2024, 5:13pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/18 "2024-01-13T17:13:20Z")

</div>

To my opinion the 2 different flows are the most efficient ways to do it.

If you have a lot more actions than only switching something of, you can create one flow (the one at 07:00) all the way you want. And create an other flow at 11:00 that just starts the flow at 07:00.

On my own homey, I use a virtual-switch to start an extended flow and 2 or 3 timed small flows that start the extended flow. That is because I also use the virtual switch.

UPDATE: I missed that the 07:00 action was for ON and the 11:00 was 23:00 to switch it off. That definitly asks fo 2 flows: Both the time and the action differs.

My actions are to switch off at night. Different times for different days of the week. And the virtual switch for my self when I go to bed early.

---

<div class="post-metadata">

**Author:** ![Eephje](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eephje/32/34155_2.png) [@Eephje](https://community.homey.app/u/Eephje)\
**Post date:** [January 14, 2024, 11:11am UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/19 "2024-01-14T11:11:27Z")

</div>

WHEN: 23:00 o’clock  
THEN: Switch Off  
THEN: Switch On (with 8x60=480 minutes delay)

---

<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:** [January 14, 2024, 5:40pm UTC](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272/20 "2024-01-14T17:40:45Z")

</div>

Sorry @Gregory I missed your question.  
Is the explanation of @Rmb sufficient? If not, I would try to explain it i different words.  
Best Regards Dirk

[Next page](https://community.homey.app/t/do-i-need-2-flows-to-switch-something-off-at-11pm-and-on-at-7am/100272.md?page=2)
