Page 1 of 1

The rule how to do it

Posted: 10 May 2018, 21:33
by janpas
I have a rule
on Przycisk#Switch do
if [Relay#Switch]=1
gpio,12,0
gpio,13,0
else
gpio,12,1
gpio,13,1
endif
endon

and I would like the relay 1 to turn off immediately
and relay 2 after 10 minutes.
Thank you so much for help.
Sorry for my English.
Regards

Re: The rule how to do it

Posted: 10 May 2018, 22:15
by budman1758
Please study the wiki pages.
https://www.letscontrolit.com/wiki/inde ... rial_Rules
If you still need help with your issue please return here and ask.

Re: The rule how to do it

Posted: 11 May 2018, 18:34
by janpas
I read but I did not manage to master it.

Re: The rule how to do it

Posted: 11 May 2018, 19:31
by xury
Try something like that. Im not tested it.

Code: Select all

on Przycisk#Switch do
if [Relay#Switch]=1
timerSet,1,0   /disable timer just in case
gpio,12,0 // first relay on
gpio,13,0 //second relay on
else
timerSet,1,600   //set timer1 to count 10 minutes
gpio,12,1   //first relay off
endif
endon
On Rules#Timer=1 do  
   gpio,13,1   //second relay off
   timerSet,1,0       // disable timer
 endon