# \[Flow\] Start flows at beginning of a period, last day of this period and last day + 1

**URL:** <https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947>\
**Category:** Apps\
**Created:** [October 17, 2018, 6:32pm UTC](https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947 "2018-10-17T18:32:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien\_Moors](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/julien_moors/32/26538_2.png) [@Julien\_Moors](https://community.homey.app/u/Julien_Moors)\
**Post date:** [October 17, 2018, 6:32pm UTC](https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947/1 "2018-10-17T18:32:00Z")

</div>

Hello,

I want to define a period of time (start date and end date) in only one card (easier to modify) like:

**periodCard** :

- start date: 8h00 - 17/10/18
- end date: 20h00 - 20/10/18

**firstDayPeriodCard** :

- If motion sensor started then lights on

**lastDayPeriodCard:**

- If doorlock is locked, no motion for 3 hours then lights off

**+1DayPeriodCard:**

- If no motion for 10 hours then start cleaning

At this point, I’ve got something like this (with the help of [Maikel](https://community.homey.app/u/Maikel)):

 ![19](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/6/6f81ae65f8bab4d8ce110cd79f850a95db95c2fc.jpeg)

But I don’t know how to trigger things at the end and end +1 of this period ☹

Any ideas for me ?

Have a nice evening !

Julien

---

<div class="post-metadata">

**Author:** ![Julien\_Moors](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/julien_moors/32/26538_2.png) [@Julien\_Moors](https://community.homey.app/u/Julien_Moors)\
**Post date:** [October 19, 2018, 11:29am UTC](https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947/2 "2018-10-19T11:29:30Z")

</div>

Any ideas ? 😀

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [October 19, 2018, 2:22pm UTC](https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947/3 "2018-10-19T14:22:23Z")

</div>

Yes.

> [@Julien\_Moors](#):
>
> I want to define a period of time (start date and end date) in only one card (easier to modify)

Unpossible.

U can make flows with the trigger “This flow is started”.  
Then u can make the flow like above and instead of “Enable a flow” u could use “Start a flow”  
Then u have ur trigger.

---

<div class="post-metadata">

**Author:** ![Julien\_Moors](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/julien_moors/32/26538_2.png) [@Julien\_Moors](https://community.homey.app/u/Julien_Moors)\
**Post date:** [October 19, 2018, 3:18pm UTC](https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947/4 "2018-10-19T15:18:47Z")

</div>

Hello !

Thank You for feedbak !

Is it possible to calculate thé différence between two dates (in seconds) and use this as a delay to start a flow ? (I don’t know if I’m clear enough)

Enjoy your weekend !

Julien

---

<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:** [October 19, 2018, 9:55pm UTC](https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947/5 "2018-10-19T21:55:13Z")

</div>

3.5 days = 84 hours in seconds still 84 hours delay? What do you want to start delayed with 84h?  
Pls describe what you want to accomplish for a scenario not the way you thought but didn’t finish.

Edit:  
your Period Card is a condition, either date between or time between, but not date&time between other date&time. if you use both cards it will have impact it wont run any night.  
If you want to enable / disable something over a long time you need two flows / two triggers each with a date/time one start to enable and one end to disable. or a schedule (2 x an alarm) or one of the 3rd party apps (maybe possible with Homedall? or… I don’t know.).

The enable/disable can be a Tag or Virtual Switch. (HouseIsRented = true)

Flow 1: Enable When Time (or an Alarm Start) , then HouseIsRented = true  
Flow 2: Enable When Time (or an Alarm Stop) , then HouseIsRented = False,

Other Flow: When Motion detected, and HouseIsRented=True and between xxh - yyh, then Lights On and Start CountDown Light 3h and Start CountDown Cleaning 10h

Other Flow: if CountDown Light = 0 and Door is Locked, Lights Out, (? Why 2h59 after locking the door? but Ok.)

Other Flow if CountDown Light = 0 and HouseIsRented=False then Start Cleaning (this can trigger more often if there is motion, but add a counter to stop triggering if you want.)

This last one will not trigger if there is last motion more than 10 h before end period. but you can fix that…

---

<div class="post-metadata">

**Author:** ![Julien\_Moors](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/julien_moors/32/26538_2.png) [@Julien\_Moors](https://community.homey.app/u/Julien_Moors)\
**Post date:** [October 20, 2018, 12:01pm UTC](https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947/6 "2018-10-20T12:01:28Z")

</div>

Hey Dijker,

I’m searching the easiest way to start flows at the begining of a period, start flows at the end of that period and start flows at the end of the period + 1 day 🙂

thank you,

Julien

---

<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:** [October 20, 2018, 12:40pm UTC](https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947/7 "2018-10-20T12:40:39Z")

</div>

Flows don’t run continuously, they start on an event.  
That could be a change in a value (fe Temperature, energy, light), an alarm (Motion, fire, a set Alarm Time/Day) or an other state change (Presence) or at a certain time (a date, a time each day, sun up/down, every xx seconds/minutes/hours…)

There is no easy way to put your request in one flow at the moment.

The only way to trigger from the start of one flow on a 2nd and 3rd time is to start something (fe Countdown) that creates new events (CountDown Timer reaches 0 ) where other flows trigger on.

---

<div class="post-metadata">

**Author:** ![Julien\_Moors](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/julien_moors/32/26538_2.png) [@Julien\_Moors](https://community.homey.app/u/Julien_Moors)\
**Post date:** [October 20, 2018, 2:50pm UTC](https://community.homey.app/t/flow-start-flows-at-beginning-of-a-period-last-day-of-this-period-and-last-day-1/2947/8 "2018-10-20T14:50:49Z")

</div>

Thank you a lot for information Dijker !  
 ![07](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/3/321082c0c0a2fa9419dcaf63dde69dfa57ecc765.png)  
I’ve done something like that and I’ve just to change ‘Date check-in’ and ‘Date check-out’ 🙂

Maybe I’ll find a solution to trigger whit iCal directly !

Have a nice weekend,

Julien
