bugsounet / MMM-Pir

Manage your screen with a pir sensor
MIT License
35 stars 10 forks source link

PIR sensor seems to be in reverse. #91

Closed wsasher closed 3 weeks ago

wsasher commented 4 months ago

Hi, I have been trying to debug this off an on for weeks. The problem seems to be that the script is running in reverse of desired. So the countdown timer starts when motion is detected (PIR sensor light comes on). When no motion is detected (PIR light off), the clock resets and does not countdown. The screen does go off if I maintain motion in front of the sensor for the full countdown. The screen also comes back on when motion is no longer detected. So all of this is opposite of the desired behavior.

I've tried switching the monitor.py script where it is sensing high and low (i.e.: GPIO.output(pin, GPIO.LOW) -->GPIO.output(pin, GPIO.HIGH) as well as high to low, monitor.py lines 58 and 61) but that doesn't seem to work.

I'm using a Raspberry Pi 4 Model B. I've reinstalled and updated everything I know of. I've tried using other pins (currently on 4, tried 20, 21) and get the same behavior. This is my first Magic Mirror setup so I am a complete newbie.

While looking to see if others had the same issue, I saw that there was an input for pir_reverseValue. I think this would be the capability I'm looking for. Though that input appears deprecated. I've also tried all sorts of combinations of modes (1, 9, 10), and pir_modes (0 gives error, 1 and 2 give same results above).

Also, just in case this compounds the issue, I am using the RPi 4 as a testing/development platform. The final Magic Mirror will be using a RPi 3 Model A+.

bugsounet commented 3 weeks ago

Module updated to v2.0.0