fcwilt
Active Member
You are in the correct forum. I tend to read all new posts regardless of the forum and try to help where I can. So I don't always know the specific prodcut but in this case it was some basic electronics and programming which I know very well.
Now you mentioned that before you changed the code the email was being sent once per second. That suggests to me that your bit of code is being called once every second, which is not unusual for certain kinds of automation logic.
The question then becomes is how long does the NO output from the keypad stay closed? If it were to stay closed for, say, 2.5 seconds then you would often get two emails being sent.
If that is the problem then you need insure that the INPUT has gone back to 1 before testing for 0 again.
Now you mentioned that before you changed the code the email was being sent once per second. That suggests to me that your bit of code is being called once every second, which is not unusual for certain kinds of automation logic.
The question then becomes is how long does the NO output from the keypad stay closed? If it were to stay closed for, say, 2.5 seconds then you would often get two emails being sent.
If that is the problem then you need insure that the INPUT has gone back to 1 before testing for 0 again.