Magnetic Switch is not stable
Moderators: grovkillen, Stuntteam, TD-er
Magnetic Switch is not stable
I have a magnetic switch on the door, which I have connected via GPIO as a "normal switch". 1st problem: When the switch is open, it constantly sends alternating 0 and 1 signals. When closed, however, it reliably transmits the signal 1 (reversed logic). I have already put in a resistor in between, but that brings no improvement. 2nd question: Does such a normal switch actually constantly send its status? Is not it possible for it to send only state changes to the controller? If that works, what do I have to do? Is there possibly a solution over rules? I hope someone can help.
Re: Magnetic Switch is not stable
Please monitor the voltage on the gpio input pin to see if it is stable
Please check if the used gpio input has a pull up resistor if not put one around 10 k
Your switch should be connected between gpio input and gnd
You can add a capacitor of about 10 mf between input and gnd
On the input configuration you can add a digital filter by programming a debounce time 100 ... 200 msec
Hope this can help
Please check if the used gpio input has a pull up resistor if not put one around 10 k
Your switch should be connected between gpio input and gnd
You can add a capacitor of about 10 mf between input and gnd
On the input configuration you can add a digital filter by programming a debounce time 100 ... 200 msec
Hope this can help
Re: Magnetic Switch is not stable
What is the configuration of the sensor plugin?
Does it have an interval set? Is that interval equal to the message interval?
Do you have a long cable between switch and ESP?
Does the reed switch (I assume you're using one of those) also trigger on vibrations?
If it is reacting to vibrations, you could add a small capacitor over it, to dampen the very short pulses. (also suggested by Patou)
Also what Patou suggests, enable filtering in the plugin settings.
Does it have an interval set? Is that interval equal to the message interval?
Do you have a long cable between switch and ESP?
Does the reed switch (I assume you're using one of those) also trigger on vibrations?
If it is reacting to vibrations, you could add a small capacitor over it, to dampen the very short pulses. (also suggested by Patou)
Also what Patou suggests, enable filtering in the plugin settings.
Re: Magnetic Switch is not stable
What is the configuration of the sensor plugin? -> Enclosed
Does it have an interval set? Is that interval equal to the message interval? -> The interval is 10 sec., but the messages are changing much more often
Do you have a long cable between switch and ESP? -> 2 meters
Does the reed switch (I assume you're using one of those) also trigger on vibrations? -> Officially not, but it's a cheap chinese reed switch. Perhaps this is the reason.
If it is reacting to vibrations, you could add a small capacitor over it, to dampen the very short pulses. (also suggested by Patou) -> i will try, thank you!
Also what Patou suggests, enable filtering in the plugin settings. -> where can I enable filtering?
Thank you in advance!
Does it have an interval set? Is that interval equal to the message interval? -> The interval is 10 sec., but the messages are changing much more often
Do you have a long cable between switch and ESP? -> 2 meters
Does the reed switch (I assume you're using one of those) also trigger on vibrations? -> Officially not, but it's a cheap chinese reed switch. Perhaps this is the reason.
If it is reacting to vibrations, you could add a small capacitor over it, to dampen the very short pulses. (also suggested by Patou) -> i will try, thank you!
Also what Patou suggests, enable filtering in the plugin settings. -> where can I enable filtering?
Thank you in advance!
- Attachments
-
- IMG_761269FD3BFF-1.jpeg (547.75 KiB) Viewed 6738 times
Re: Magnetic Switch is not stable
Thank you! I will check it!
Re: Magnetic Switch is not stable
, enable filtering in the plugin settings. -> where can I enable filtering?
Answer : it is the denounce variable in the plugin
Answer : it is the denounce variable in the plugin
Re: Magnetic Switch is not stable
A 2 meter long cable is quite long. It could act as an antenna.
You may want to experiment also with the pull-up resistor settings for that pin.
Sometimes twisting the cable may help reducing interference, but only if some source of noise is near.
You may want to experiment also with the pull-up resistor settings for that pin.
Sometimes twisting the cable may help reducing interference, but only if some source of noise is near.
Who is online
Users browsing this forum: No registered users and 53 guests