Page 1 of 1

Strobe light controlled by a rule possible?

Posted: 11 Jan 2019, 19:49
by P406
Hello folks,
first of all, let me thank you for this awesome work!! :)
ESPeasy is one of the best things for my smarthome !

I need a little help regarding the following:
I would like to create a strobe light (something like 500ms GPIO HIGH, 500ms GPIO LOW) and use the timer inside ESPeasy...
All I want to to is send a command like IPADRESS/?cmd=strobe/1 and strobe/0 .

Anybody an idea how to get this to work?

Kind regards,
P406

Re: Strobe light controlled by a rule possible?

Posted: 11 Jan 2019, 20:47
by iron
Hello,

the best practice is to send an "event" to the device

http://<espeasyip>/control?cmd=event

Then in the Rules catch the event :

On event do
..
Your condition here
...
endon

More in the Rules :

https://espeasy.readthedocs.io/en/lates ... Rules.html

-D

Re: Strobe light controlled by a rule possible?

Posted: 12 Jan 2019, 13:16
by P406
Hi iron,

I tried the example from "best practice", but the led is just flashing 1 time and is not repeated in a loop (like I understood the example?) :

Code: Select all

 //start the warning signal when we receive a start_warning event:
 On start_warning do 
   timerSet,1,2
 endon
 
 //stop the warning signal when we receive a stop_warning event:
 On stop_warning do
   timerSet,1,0
 endon
 
 //create an actual warning signal, every time timer 1 expires:
 On Rules#Timer=1 do 
   //repeat after 2 seconds 
   timerSet,1,2
 
   //pulse some led on pin 15 shortly
   Pulse,15,1,100 
 endon
Kind regards,

P406

Re: Strobe light controlled by a rule possible?

Posted: 12 Jan 2019, 14:44
by iron
gpio 15 is pulled to GND and generally recommended for input only

https://espeasy.readthedocs.io/en/lates ... light=gpio

Try another gpio (preferably 5,6,7)

-D

Re: Strobe light controlled by a rule possible?

Posted: 13 Jan 2019, 16:31
by P406
Okay, but why should this have an impact on the rule or timer...?

EDIT: Whats GPIO 6 and 7 in ESPeasy....?
GPIO5 is SCL in my case... Okay but I can change this.

Kind regards,

P406

Re: Strobe light controlled by a rule possible?

Posted: 16 Jan 2019, 17:43
by P406
Nobody? Which outputs are recommended for PWM usage (LEDs)?

Kind regards,

P406

Re: Strobe light controlled by a rule possible?

Posted: 16 Jan 2019, 17:54
by grovkillen
GPIO 12 13 14 are good pins for PWM.