Simple switch issues

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
hugo11
Normal user
Posts: 17
Joined: 08 Nov 2016, 20:30

Simple switch issues

#1 Post by hugo11 » 07 Jan 2017, 17:09

hi all,

I'm trying to use a simple pushbutton to turn a LED on locally for testing purposes but having hard times achieving it.

I have a LED connected to gpio 12 and a push button on pgio 16. I already tried a lot of combinations of the switch configuration but still struggling. (tried both bringing the pin high, low, pullup on/off).

Could someone help me with this?


Ultimately I'd like to send a http command when the gpio 16 will go high due to PIR activation.

The rules I have now for testing are :

on switchon do
gpio 12,1
endon

on switchoff do
gpio 12,0
endon

on test#Switch do
if [test#Switch]=1
event switchon
else
event switchoff
endif
endon

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

Re: Simple switch issues

#2 Post by iron » 07 Jan 2017, 17:13

Here is your answer :

viewtopic.php?f=6&t=2039&start=10
-D

hugo11
Normal user
Posts: 17
Joined: 08 Nov 2016, 20:30

Re: Simple switch issues

#3 Post by hugo11 » 07 Jan 2017, 17:36

Thanks a lot, I've seen similar topics to that based on which I also built the rules.

I'm still struggling, I think the issue is with triggering the switch on gpio 16. What I have not is a pushbutton soldered to ground, effectively grounding GPIO16 when I push the button, still the switch is still high.

Any ideas?

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

Re: Simple switch issues

#4 Post by iron » 07 Jan 2017, 17:49

What ESP module are you on ?
-D

hugo11
Normal user
Posts: 17
Joined: 08 Nov 2016, 20:30

Re: Simple switch issues

#5 Post by hugo11 » 07 Jan 2017, 20:10

I'm on ESP12E.
ok, eventually got it working.

The rule is as simple as this:

on Lightswitch#value do
SendToHTTP 192.168.2.4,39989,/cmd?a=motion_esp05_1
endon

The Switch is configured as pullup / reversed / push button active high and the gpio is connected to a PIR sensor. working absolutely fine for now.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests