I have a reed switch connected and when my garage door closes is see a quick CLOSED, OPENED, CLOSED in quick succession.
Does anyone have any pointers on how I would ignore any updates within 1 second of the first one?
I think the term is a "de bounce"?
De-Bounce for reed switch?
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: De-Bounce for reed switch?
You could use rules for that... on change wait for 1-2 seconds... check again. If the value is still OPEN report open. Etc.
But that might not be a good solution for you? Please report back if you have tried it and it's not working.
But that might not be a good solution for you? Please report back if you have tried it and it's not working.
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
-
- Normal user
- Posts: 19
- Joined: 20 Oct 2017, 14:30
Re: De-Bounce for reed switch?
Would be great to be able to do this without rules....
Surely this is a common issue with reed switches and a fix could be baked in?
I've never written a rule though so if you could help me with a working example I could give it a try.....
Surely this is a common issue with reed switches and a fix could be baked in?
I've never written a rule though so if you could help me with a working example I could give it a try.....
Re: De-Bounce for reed switch?
Exactly as what @grovkillen said,
I have not tested it but maybe along the lines of (have to press it longer than 1sec, I am not sure if TimerSet works for 0.5):
On ReedSwitch#Open do
TimerSet,1,1
EndOn
On Rules#Timer=1 do
If [ReedSwitch#Open]=0 // 0 or 1 depends on what state you are looking for.
// .....whatever
EndIf
EndOn
Check out great tutorial on rules n give it a go.
Ken
I have not tested it but maybe along the lines of (have to press it longer than 1sec, I am not sure if TimerSet works for 0.5):
On ReedSwitch#Open do
TimerSet,1,1
EndOn
On Rules#Timer=1 do
If [ReedSwitch#Open]=0 // 0 or 1 depends on what state you are looking for.
// .....whatever
EndIf
EndOn
Check out great tutorial on rules n give it a go.
Ken
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: De-Bounce for reed switch?
Thanks for stepping in! I love how the community grow and how we start to take care of each other.kenkoknz wrote: ↑12 Sep 2018, 04:21 Exactly as what @grovkillen said,
I have not tested it but maybe along the lines of (have to press it longer than 1sec, I am not sure if TimerSet works for 0.5):
On ReedSwitch#Open do
TimerSet,1,1
EndOn
On Rules#Timer=1 do
If [ReedSwitch#Open]=0 // 0 or 1 depends on what state you are looking for.
// .....whatever
EndIf
EndOn
Check out great tutorial on rules n give it a go.
Ken
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: De-Bounce for reed switch?
When I take on the GPIO issues, one of the things I want to do is to merge functionality of P001_switch and P003_pulsecount.
That last one already has some code to filter de-bounce effects.
That last one already has some code to filter de-bounce effects.
-
- Normal user
- Posts: 19
- Joined: 20 Oct 2017, 14:30
Re: De-Bounce for reed switch?
I think doing this with a rule is actually a little more complicated than I can manage right now.
Will have to wait till debouncing is built in for reed switches...
Will have to wait till debouncing is built in for reed switches...
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 19 guests