-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeout behavior has changed #119
Comments
Just my info: |
Another motion detection of a PIR sensor can only happen if no motion was detected before. If there is an ongoing motion the sensor will not send another motion event. At least my sensor behaves this way. My timeout configuration is/was 10s. |
Hi, I'm having trouble understanding your problem. It was programmed like this with PIR or Motion:
Library Notes:
Can you give me your configuration, if you find that the operation described is not the same? |
I've compared version 2.x with version 1.54 (SHA bb0b190) and found the difference. In both versions PIR is set to mode 1. Version 1.x is starting gpioSensor.py which queries presence in a loop once each second. If in this loop no more presence is detected the countdown starts. Version 2.x is starting MotionSensor.py which sends only one presence detection event/message. Right after this message the countdown starts. In version 2.x mode 0 there is also a loop for detecting motion. So maybe this loop is missing in mode 1?! Instead of polling current status the 'when_no_motion' event could be used. You can see the difference also in the logs...
In version 2.x the presence gets detected only once:
|
ha ok pir.mode: 1 ! I don't use this mode in my prod mirror :/ |
I'm having the same issue in mode: 1 as well. |
I finish to lint all my modules and i will take a look |
@kwerner72 can you test current dev version and tell me if better ? |
Unfortunately the dev branch turns off screen after the timeout, regardless if there is still motion detected. You may test the desired behaviour in MotionSensor.py, by deactivating the MotionSensor from gpiozero and just printing "Motion" and "NoMotion". |
In all case there no change v1.x: python code Exec code is the same: Callback is the same when In my case, i can't reproduce it and works as i code it |
It really looks quite similar. Though there is an important change in pirLib.js from 1.x to 2.x In v1.x pirLib is using gpioSensor.py in mode 1 (line 90) So what you really need to compare is gpioSensor.py and MotionSensor.py |
|
In the new version 2.x the behavior of timeout has changed.
In version 1.x the timeout startet when no more motion was detected. Now it starts right after detecting a motion.
That means with version 2.x the screen will always turn off after given timeout, no matter if there is still motion detected.
The text was updated successfully, but these errors were encountered: