I'm using a push button switch connected to ESPEasy in order to send HTTP commands with two combinations, in my case now I have:
1. push button switch -> close rolling shutter.
2. push (again) button switch -> open rolling shutter
and this combinations is in loop (1,2 1,2 1,2....).
This is the Rule:
Code: Select all
On System#Boot do
TimerSet,1,3 //set timer #1 to 3 seconds
Endon
On Rules#Timer=1 Do
Let,1,1 //set variable 1 to 1 after the 3 seconds of the timer
Endon
On Sw#State Do //on push button press
If %eventvalue%=0 And [var#1]=1
SendToHTTP 192.168.1.12,80,/roller/0?go=close //command to close rolling shutter as example
Endif
If %eventvalue%=1 And [var#1]=1
SendToHTTP 192.168.1.12,80,/roller/0?go=open //command to open rolling shutter as example
Endif
Endon
1. push button switch -> close rolling shutter
2. push (again) button switch -> stop closing rolling shutter
3. push (again) button switch -> open rolling shutter
4. push (again) button switch -> stop opening rolling shutter
and this combinations (of 4 push) in loop, so after arriving to combination 4 next is to return to combination 1 (1,2,3,4 1,2,3,4 1,2,3,4...).
Is it possible?
Thanks.