ok ,thank's , I need to understand the logic of espeasy
exemple , i try a slide gate security by watt detection
device > PZEM-004T interval 1s
LongPulse_mS,14,1,600 > impulse sens < -- >
if > 100 watt start detection timer 3s
after 3s if watt > 400 then secu event ( impulse - wait 2s -impulse)
and more pieton button start open - wait 5s - stop with impulse
Code: Select all
On System#Boot Do
Let,1,0
Endon
On gr#Power_W Do
If [gr#Power_W] > 100 and [Var#1]= 0 // si w > 100 pause 3s et var 1 = 0
Timerset,3,3
//Let,1,1
endif
If [gr#Power_W] > 400 and [Var#1]= 1 // si w > 400 et var 1 = 1 securite
Event,secu
endif
If [gr#Power_W] < 5 and [Var#1]= 1 // si w < 5 = arret var1 mis a 0
Let,1,0
resetenergy,0
Endif
Endon
On Rules#Timer=3 Do
Let,1,1
Endon
On secu Do
LongPulse_mS,14,1,600 // impulsion arret
TimerSet,2,1
Endon
On Rules#Timer=2 Do
Let,1,0
LongPulse_mS,14,1,600 // impulsion retour
Endon
On piet#State Do
If [piet#State]=0
Let,1,0
LongPulse_mS,14,1,600 // impulsion pieton 5s
TimerSet,1,5
Endif
Endon
On Rules#Timer=1 Do
LongPulse_mS,14,1,600 // impulsion pieton arret
Let,1,0
resetenergy,0
Endon
what are my mistakes ??
thank