Push button behaviour

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
fredfit
Normal user
Posts: 14
Joined: 31 Mar 2021, 14:59

Push button behaviour

#1 Post by fredfit » 06 Apr 2021, 14:29

Hi all,

I'm still struggling with my little project (see topic viewtopic.php?f=5&t=8450) and found out that the "switch" device, when set to "Push Button Active Low" has a strange behaviour, which is most probably the root cause of my issues.
I performed some tests on GPIO-14 (D5) (pin whithout exclamation point to avoid any unexpected behaviour) of an ESP8266 board.
I ticked "Internal pullup" and set the GPIO boot state to "Input pullup" and placed a push button from D5 to the GND.
When I press the push button, I see the state of the switch ("Devices" tab) going from 1 to 0. But when I stop pressing the push button, it doesn't come back to 1 unless I press the it again.
It looks like what is called a "push button" acts like a "bistable switch" instead.

Same behaviour by desabling the software pullup and replacing it by a hardware one (10K resistor connected to 3V pin).

Any idea how to get a real push button functionality instead of a bistable one ?
Thanks!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Push button behaviour

#2 Post by TD-er » 06 Apr 2021, 14:45

Just set it to "normal" switch to have the task state follow the button state (or invert if you tick to invert the logic).

fredfit
Normal user
Posts: 14
Joined: 31 Mar 2021, 14:59

Re: Push button behaviour

#3 Post by fredfit » 06 Apr 2021, 15:32

Thank you TD-er, tested successfully.
It looks weird that the behaviour in ESPeasy is the opposite of what are called "switch" or "push button" devices in electronics ... I've probably lost a lot of time because of that :roll:

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Push button behaviour

#4 Post by TD-er » 06 Apr 2021, 20:34

Yep, I guess it may need a bit more descriptive text. The word "toggle" is already a good hint.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests