Execute command every x minutes IF a virtual switch is open


#1

1) Give a description of the problem
Hi there. I am trying to set up a piston to execute a command every 10 minutes whenever a virtual switch is on (or when a virtual presence is not present).

2) What is the expected behaviour?
Whenever the virtual switch is on, the “refresh” command executes every 10 minutes. And stop when virtual switch is off.

3) What is happening/not happening?
The command is firing every 10 minutes regardless of status of switch. The timer command “Every” seem to ignore any conditions.


#2

I think you want

Every 10 mins
if switch is on


#3

How do you do an “if” statement after an “timer” statement?


#4

inside the every block, put your restrictions to do something or nothing.


#5

Ok thanks… I figured how to do that. I was looking for the Conditional “If” statement while in the “Every” timer statement. My mistake.


#6

a restriction on the every, or the if restriction within the every operates the same way.