How can I use apilio to rotate my fan between two angles? I think this might be a tricky one…
Either:
State A: Active for 2 operations (clockwise when I am at angle 2 but desire angle 1)
fan goes clockwise directly to angle 1 and it takes 4 seconds
fan goes counterclockwise directly to angle 2 and it takes 4 seconds
Fan switches to state B
State B: Active for 2 operation (counterclockwise when I am at angle 2 but desire angle 1)
fan goes counterclockwise to angle 1 and it takes 7 seconds
fan goes clockwise to angle 2 and it takes 7 seconds
Fan switches to state A
How do I use apilio to control this deterministically?
Basically, I could base a logic block on a boolean condition where the positive result is a 4-second delayed action, and the negative result is a 7-second delayed action.
However, the boolean needs to swap states every other time I run the logic block.
So over the course of the day, every time I want to switch the angle, the logic block should behave:
4 (boolean true)
4 (boolean true) -> time to swap the variable value
7 (boolean false)
7 (boolean false) -> time to swap the variable value
4 (boolean true)
4 (boolean true) -> time to swap again
etc.
How do I set this up in apilio?