[SOLVED] button switches light off but then it turns right back on

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
jschwalbe
Normal user
Posts: 14
Joined: 21 Jan 2017, 22:03

[SOLVED] button switches light off but then it turns right back on

#1 Post by jschwalbe » 21 Mar 2019, 03:15

I have one of these: https://www.walmart.com/ip/ECO-ID-Wi-Fi ... /164169458 and it's been working great. In fact I have about 10 of them. All with the same settings.

Typically you can walk up to one, click the button, and it'll switch states. But lately it switches states, and then SWITCHES BACK to the previous state! I've got it connected to my mqtt server running via hassio (Home Assistant). These are the settings (and I've verified that ALL the settings aside from Name and Unit nr are the same between my other plugs).

Code: Select all

on button#buttonstate do
if [relay#relaystate]=1
Delay 3000
gpio,15,0
publish /%sysname%/relay/relaystate,0
else
Delay 3000
gpio,15,1
publish /%sysname%/relay/relaystate,1
endif
endon
I added the 3 second delay to see what would happen. When I switch the switch via software (hass control panel) it switches immediately and doesn't switch back. When I push the physical button it switches after 3 seconds, and then 3 seconds later it will flip back.

Does this mean the physical button is "bouncing" (I think I'm using the word correctly) - i.e. one push registers as two pushes? If that's the case, any way to smooth that out with code?

Build: 147
Core Version: 2_3_0

Thanks!
Last edited by jschwalbe on 24 Mar 2019, 20:22, edited 1 time in total.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: button switches light off but then it turns right back on

#2 Post by grovkillen » 21 Mar 2019, 05:32

Settings if that switch please.
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:

jschwalbe
Normal user
Posts: 14
Joined: 21 Jan 2017, 22:03

Re: button switches light off but then it turns right back on

#3 Post by jschwalbe » 21 Mar 2019, 22:32

I'm sorry - but which settings are you referring to? Thanks

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: button switches light off but then it turns right back on

#4 Post by grovkillen » 22 Mar 2019, 05:38

For the switch. Screen dump of the settings. Inside the device page.
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:

jschwalbe
Normal user
Posts: 14
Joined: 21 Jan 2017, 22:03

Re: button switches light off but then it turns right back on

#5 Post by jschwalbe » 24 Mar 2019, 04:37

Sorry for the delay.

See attached.

The thing that gets me is that the other switches are configured exactly the same, but operate differently.

Thanks!
Attachments
settings.png
settings.png (56.6 KiB) Viewed 4239 times

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: button switches light off but then it turns right back on

#6 Post by grovkillen » 24 Mar 2019, 07:52

Settings please. This is only the list of devices.
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:

jschwalbe
Normal user
Posts: 14
Joined: 21 Jan 2017, 22:03

Re: button switches light off but then it turns right back on

#7 Post by jschwalbe » 24 Mar 2019, 19:36

Ok - let's try again. Thanks
Attachments
settings1.png
settings1.png (320.11 KiB) Viewed 4207 times

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: button switches light off but then it turns right back on

#8 Post by grovkillen » 24 Mar 2019, 20:12

You're using the pull-up on the button, why?
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:

jschwalbe
Normal user
Posts: 14
Joined: 21 Jan 2017, 22:03

Re: button switches light off but then it turns right back on

#9 Post by jschwalbe » 24 Mar 2019, 20:20

I don't know the answer to your question (I just followed an online tutorial a couple years ago and it told me to do that), BUT I realized I hadn't compared *those* settings to the other plugs I have, and sure enough, it's different.

I fixed it by checking Inversed and changed Switch Button Type to Push Button Active High.

Now it works as expected. I must have never used that push button in the past. I was convinced it was a button issue.

Thanks for your help in getting me to dig into the settings I had forgotten about!

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests