The rule how to do it

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
janpas
Normal user
Posts: 2
Joined: 10 May 2018, 21:23

The rule how to do it

#1 Post by janpas » 10 May 2018, 21:33

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

User avatar
budman1758
Normal user
Posts: 253
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: The rule how to do it

#2 Post by budman1758 » 10 May 2018, 22:15

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.
"The glass is twice as big as it needs to be".

janpas
Normal user
Posts: 2
Joined: 10 May 2018, 21:23

Re: The rule how to do it

#3 Post by janpas » 11 May 2018, 18:34

I read but I did not manage to master it.

xury
Normal user
Posts: 44
Joined: 02 Apr 2018, 12:54

Re: The rule how to do it

#4 Post by xury » 11 May 2018, 19:31

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

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests