@orayoflighto what you show is exactly what I need, however struggling with MMM pir Sensor module as my MM shows a conf.js error. So can’t get beyond that. I also have the RGB WS2812B led strips which I discovered r more problematic to control. I feel as though I tried many things but still frustrated with non functioning lights.
Read the statement by Michael Teeuw here.
Posts made by richardh151
-
RE: PIR Motion sensor
-
RE: PIR Motion sensor
@Kimzer thanks but as a novice the suggested scripts blew my mind and seems much more complicated to what I’m currently using. I’m sure there is a way to modify it to switch on the led strip at the same time as the monitor jumps to life from the PIR motion sensor. I have a RPi3 and have it connected but struggle with the script which I’m sure is easy for someone else.
-
RE: PIR Motion sensor
Im trying to add a LED strip WS2812B to my python script which switches on and off at the same time as my motion sensor is activated. Whilst there are many scripts out there I struggle to incorporate one into what i have that currently works, can anyone help. My LED GPIO Pin is 17. Any help is appreciated
This is my current script,
from gpiozero import MotionSensor
from subprocess import call
from time import sleepTime to wait until display should turn off after last motion detected
timeUntilDisplayOff = 600
The GPIO data pin to which the PIR sensor is connected
pin = 4
pir = MotionSensor(pin)
timer = timeUntilDisplayOffwhile True:
if pir.motion_detected: timer = timeUntilDisplayOff print ("Motion detected! Setting timer to " + str(timer) + " seconds.") if timer > 0: if timer % 10 == 0: print ("Timer: " + str(timer) + " seconds") timer -= 1 elif timer == 0: call(['vcgencmd', 'display_power', '0']) print ("Timer is 0. Display turned off. Waiting for motion...") # display is now off. we wait for motion and turn it on pir.wait_for_motion() call(['vcgencmd', 'display_power', '1']) timer = timeUntilDisplayOff sleep(1)
-
RE: worldclock - nobody made this, so I did.
@Sean thank you works perfectly and looks great.
-
RE: worldclock - nobody made this, so I did.
I’m a complete novice but successfully managed to get the three additional clocks on my MM and I am able to edit their name. However I am unable to set the correct time for each country, for example I want to set the time for Mumbai India and also Shanghai China, but struggling. Please can you give me some simple instructions as I’ve looked in the various folders and failed so far.
-
RE: PIR Motion sensor
Jeff thank you very much, I tried to first suggestion and it worked perfectly. As I said I’m somewhat of a novice and on a steep and again enjoyable learning curve. 😊
-
PIR Motion sensor
I have spent a considerable amount of time on the MM forum and also searching Raspberry Pi forum for a simple Python script which I can use My Magic mirror together with my PIR motion sensor. There is a lot of great stuff out there which I have tried but as a complete novice I’m struggling. I have a Pi3 and believe I can run a Python script in the background and don’t necessarily have to incorporate into the MM modules. Is that correct? I have tested my PIR sensor and can get it to detect movement but now I simply want to enable this with my monitor and switch on after movement detection and then off after a set time period. I can imagine to all of you this is so easy but after three days of trying I’m losing hope. Your support is appreciated which will remotivate me again. Thanks again