Create a scheduler for morning, day, evening and night time

As I have not found any scheduler (besides for heating control) I have made a flow-based scheduler for the purpose of setting different actions in different time ranges depending of the day type week day, weekend and bank holiday. The scheduler is consisting of 9 flows in total.
For week days I have created four flows to determine if it is morning, day, evening or night. The same four flows I have made for weekends/bank holidays but with different time ranges. At least there’s a flow to determine if it is a bank holiday, this is used for overruling if the bank holiday is on a week day and thereby making it possible to use the weekend schedule instead. This flow is triggered every night at 00:02.

So, the flow I have are:
Week day - morning (#1)
Week day - day (#2)
Week day - evening (#3)
Week day - night (#4)
Weekend/Holiday - morning (#5)
Weekend/Holiday - day (#6)
Weekend/Holiday - evening (#7)
Weekend/Holiday - night (#8)
Determine if Holiday (#9)

The principle of the scheduler is as follows:
The “Week day - morning” flow (#1) is triggered every 30 minutes and check if it is a week day and the time is between 5.30 - 9.00, in case it is a text string is set to “Morning”. In case it is not the next flow, “Week day - day” flow (#2) is triggered checking if it is a week day and the time is between 9.00 - 17.00 and so it continues through the evening and night flows.
In the “Week day - night” flow (#4) and if the “THEN” conditions are not fulfilled the “Week day - morning” flow (#1) is disabled and the “Weekend/Holiday - morning” flow is enabled. The weekend/holiday flows work in the same manner as the “Week day” flows but with other time range settings.
In the “Weekend/holiday - Night” flow and if the “THEN” conditions are not fulfilled the “Weekend - morning” flow is disabled and the “Week day - morning” flow is enabled.
I know it can probably be optimized or made simpler but for the time being it fulfills my needs.
Hope this can inspire others or other to show their solutions.


What is the reason for running the flows every 30 minutes?
I would suggest:
WHEN time is 5:30 AND its a weekday THEN set textual variable morgen
WHEN rime is 9:00 AND its a weekday THEN set textual variable dag

You are right why haven’t I, stupid me. Thanks.

Would you be able to run this kind of flows at all if you use absolute times like 5.30 and 9.00 though? I have a hard time seeing that. Then you would need to start lots of flows all the time. The beauty with this flow is that it’s only one flow triggering other flows. Less resources needed, even though it’s hardly a problem in either case I guess.

I like this flow idea. Trying to create something similar now. Thanks for the idea!

I actually changed my flows as per Fkeys comments, it then triggers one flow at an exact time and set the text string according to the time triggered (and weekday). I also fine tuned it a bit as if it is a Friday evening it should use the “Weekend/Holiday - evening” flow, as I usually go to bed a bit later on Fridays and also if it a Sunday it should use the “Weekday - evening” flow as I go a bit earlier to bed on Sundays.

Yea. That sounds like a good idea. Do you mind posting the final flow results/screen shots? For reference for others and me. That way I might not step into all the potential problems when I create my own :smiley: I’m gonna do something very similar my self.

That is indeed a pittfall, should have mentioned that :unamused:, but you found it

I also made an exception for newyears…
Even if I would not stay up I do like the house to look like the owner is home.
So the light stay on untill after 01:00

@MrHaugen I’ll do a post one of the coming days with the final flows. I found a fault in my “Friday” handling but hopefully I now got it right🙂

I did not have the patience to wait, AVP :joy:
I guess it’s better to have more ideas to draw inspiration and hopefully come out with something great in the end, right? I have not tested this enough yet, but I think it should work.

The flow have several features:

  • Treats weekends and holidays differently than workdays, by adding sleep in hours and longer days (adjustable) with the delay feature.
  • Finds Holidays with a new app from Bamli. Hopefully available soon in the store. Handles lots of different countries. You can drop this while waiting, or go with Swedish or Dutch.
  • One flow for each time of the day. Could be expanded or simplified by removing days.
  • Takes into account that Sunday night should be treated as a workday (getting to be earlier) than the rest of the weekend.
  • You can use this variables (vSchedule-Workday true/false and vSchedule-TimeOfDay morning/day/evening/night) for lots of different lighting, heating and what not later on.

I’ll be testing this the next days. The beauty with this, compared to things like Heating Controller app, is that this is more granular control. And you can use it logically for more devices like lights and what not.

1 Like

Did not ddo a thorough check, but the AND and THEN are the same for all flows right?
In that case I would advice: split up in trigger flows and action flows:

  1. action flow: Copy one of the flow and remove the time trigger (IF) from the from and replace it by “When this flow is started”
  2. trigger flows: now change all the other flow by removing the AND and THEN and only put in the “THE “ a “start this flow” command referrign to the flow created in 1

Yes this is one flow extra compared to you solution.
BUT flow managent is much easier, you only have to update one flow
BUT it also gives you more options for triggering, because you have 2 option to put AND function. One in the trigger flow and one in the action flow
BUT if you have multiple action you want to start at the time you can add these.

To make your flows less complex, you can even consider to move the part with the 2hr delay and make that a specific trigger flow. That way its much more clear when flow are triggered
YES, that does add an extra flow, but more flow is not bad! It makes them much easier to understand and debug

Yes. That’s what I’m doing as well.

This was just my initial setup to illustrate for others. I believe this simplifies and makes it easier to understand for some. Also for people new to Homey automation, like me :slight_smile:

I found this thread a little late, but I still wanted to share how I solved this. I wanted to make a system that keeps track of the time of day in accordance to the sun. I’ve tried using predefined times earlier, and it didn’t play nice with Norway’s short winter days and long summer days. I also wanted Homey to keep track of the time of day in the “the background”, and tie several flows into the different modes. I have other flows for figuring out if it’s the weekends or holidays, and they tie into the system displayed here.

Please let me know if you have suggestions for improvements.