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
@richardh151 You have a couple of options. You can, as you suggest, run a script in the background independent of MM to manage turning the screen on and off based on input from the PIR sensor. Take a look at this:
You may or may not also want to look at modifying this to use HDMI-CEC commands depending on how you TV/monitor reacts to the way that script controls the HDMI output. See here:
You can also have it incorporated with MM if you like, which is useful if you want to have any custom modules react to events (i.e.: motion detected). In this case, take a look at this:
I hope this helps!
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. 😊