How to vary 1 action in a series of many based on time of day?


(Robin) #1

I’m using webcore to activate a series of processes for different modes (e.g. when mode changes to “home” activate Lifx scene #1, set temp to 22 degrees, turn on cabinet lights, etc.). I’d like it to activate a different Lifx Scene depending on time of day.

Right now, I have it set up so that “if mode changes to home and time is between A and B, activate scene #1, and do everything else” and “if mode changes to home and time is between B and C, activate scene #2 and do everything else”, and “if mode changes to home and time is between C and D, activate scene #3 and do everything else”.

It seems so redundant, is there a way to isolate the LIFX Scene part of the piston, and have it be conditional on the time instead of having to repeat the whole thing multiple times?


(Robin) #2

Couple of ways to streamline this:

At the top of the piston editor, you’ll see a button with a filter symbol… this will bring up a restriction option for each action so you can do something like:

If mode changes to home
Then
Only when time is x
Do stuff
Only when time is y
Do other stuff

The other way would be to use a switch case… when in the editor, drop down the settings list at the top and turn on advanced features.

Then, you get more options when adding new conditions:

If Mode changes to home
Then
switch (time)
case 1 (x)
do stuff
Case 2 (y)
do other stuff