Strobe light controlled by a rule possible?

Moderators: Voyager, BertB, rtenklooster, Stuntteam, grovkillen, TD-er

Post Reply
Message
Author
P406
Normal user
Posts: 9
Joined: 31 Dec 2018, 09:29

Strobe light controlled by a rule possible?

#1 Post by P406 » 11 Jan 2019, 19:49

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

User avatar
iron
Normal user
Posts: 75
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: Strobe light controlled by a rule possible?

#2 Post by iron » 11 Jan 2019, 20:47

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
-D

P406
Normal user
Posts: 9
Joined: 31 Dec 2018, 09:29

Re: Strobe light controlled by a rule possible?

#3 Post by P406 » 12 Jan 2019, 13:16

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

User avatar
iron
Normal user
Posts: 75
Joined: 24 Sep 2016, 08:37
Location: Veria, Greece
Contact:

Re: Strobe light controlled by a rule possible?

#4 Post by iron » 12 Jan 2019, 14:44

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
-D

P406
Normal user
Posts: 9
Joined: 31 Dec 2018, 09:29

Re: Strobe light controlled by a rule possible?

#5 Post by P406 » 13 Jan 2019, 16:31

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

P406
Normal user
Posts: 9
Joined: 31 Dec 2018, 09:29

Re: Strobe light controlled by a rule possible?

#6 Post by P406 » 16 Jan 2019, 17:43

Nobody? Which outputs are recommended for PWM usage (LEDs)?

Kind regards,

P406

User avatar
grovkillen
Normal user
Posts: 2844
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Strobe light controlled by a rule possible?

#7 Post by grovkillen » 16 Jan 2019, 17:54

GPIO 12 13 14 are good pins for PWM.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest