# Start lamp next coming day at 6am, but just once

hello!

I wish to be able to run a flow at any time, that will start a lamp the next coming time it gets 6am. But I only want it to do it once.

Just to get a better picture.
I have a light that normally turns on at 9am.
But once in a while I want it to turn on 3 hours earlier the next day, but I only want this once every 4-8 days, so it would be perfect the be able to start a flow that enables early turn on just once then the day after that it automatically is back at 9am.

Flow1
WHEN this flow is started
Then enable this flow â€śflow2â€ť

Flow2
WHEN the time is 06:00
THEN
switch light on
Disable this flow â€śflow2â€ť (delay 1sec)
Disable this flow â€śflow3â€ť

Flow3 3 is the flow that currently switches on the lights at 09:00

I bet someone at this forum has even figured out a way to have your agenda appointment trigger thisâ€¦

1 Like

Orâ€¦ use the variable.
One scene/flow/button which one setâ€™s the variable â€śEarlyBirdâ€ť
Then a timer-based flow at 6:00, which one checks the â€śEBâ€ť, and switches, if done.
Another timer-based flow at 9:00, this one checks, if not â€śEBâ€ť, then switches light; otherwise clears â€śEBâ€ť (orâ€¦ the EB clearing in a separate flow - for example @ 10:00 )

PS. In general, the both (variable/flow disable) possibilities are equal But, there may be some local side-effects to prefer one or another solution.

2 Likes

If I didnâ€™t make a logical mistake with the numbers, the following flow should turn on the light at least 4 times at 9:00. It depends on a calculation of a random number between 1 and 4, when the light will be turned on at 6:00. So it can be on the 5th, on the 6th, on the 7th or at the latest on the 8th day. After the light was turned on at 6:00, the next day the light will be switched on at 09:00 again for the next 4 days.

For the flows you need 2 self created numeric variables (More â†’ Logic).
For the first variable CL_RandomLight please enter the value 1.
For the second variable CL_RandomLight1 please enter a value greater than 4.
Of course you can name the variables differently.

These flows will also work with the â€śStandard Flowsâ€ť.
Sorry for German language in the screen shot. If you donâ€™t understand something, just ask.

1 Like

And someone did: tutotial-trigger-a-flow-using-calendar-events

I donâ€™t understand the context between the question in this post and the ICalCalender tutorial.
Could you possibly explain this?