1) Give a description of the problem
This piston is designed to notify a visitor to the porch when the sensor activates. To help prevent false notifications, this is suppressed for a few mins if we have arrived home, or walked up to the front door from inside (hall sensor)
2) What is the expected behavior?
The multiple scheduled tasks on the with sensor/presence increment a variable when there is activity. This prevents the notification if the porch sensor is activated. After a wait, the variable is decremented. The same variable is used (with 5 min wait) to prevent multiple notifications, and also if the porch senses movement when the counter is not 0 (i.e we’ve just arrived home or are leaving)
3) What is happening/not happening?
The piston is working well most of the time. However, occasionally, the notify variable has a value of -1. (hence condition =< 0 on line 23) I can’t see how notify can ever get to a value of -1, unless a multi scheduled task is not fully running, or there is a semaphore issue where two tasks try to set the variable at the same time?
Is this a bug, or am I doing something wrong/not understanding?
**4) Post a Green Snapshot of the piston![image|45x37]
5) Attach any logs (From ST IDE and by turning logging level to Full)
nothing in the logs