Loop an activity?

Working on a Reactor Sensor that changes the colors of my nighttime exterior lights based on the holiday. Red & green for Christmas, etc.

Right now the Activity makes Garage lights red for a few minutes, then change them to green.

What’s the best way for me to loop that activity, so they keep switching from red to green throughout the night?

My brain says “find a way to add a loop into the Activity” but it doesn’t seem possible. Should I be looking at looping/re-triggering the Condition instead?

Thanks!

If it’s just a switch between red and green, here’s how I would do it.

First, I’d make a group just to determine when the lights should be on at all.

Then, I’d make a group that contains a test of the first group, and use “pulse” output mode with the pulse time and repeat set up to toggled back and forth with a 50% duty cycle (equal on/off pulse times). That means you set the pulse time equal to the amount of time you want red on, and the repeat time to double that. Like this:

Then the “Toggle red/green is TRUE” activity would turn on the lights red, and “Toggle red/green is FALSE” would set the lights to green. The way I’ve given the timing in the screen shot, the lights will be red for 2 minutes, then green for 2 minutes (total cycle time 4 minutes), and lather, rinse, repeat as long as “Holiday Lights” remains true.

The “Holiday Lights is FALSE” activity can be used to turn the lights off.

1 Like