Read the statement by Michael Teeuw here.
-
I don’t yet have my PIR sensor (soon!), but had a question.
When the mirror is unused, with the monitor off, it doesn’t make sense to do frequent updates on all of the modules. I could tune those way back, if I could force a refresh on all modules when the PIR triggers a monitor wake-up.Is there an easy way to trigger a refresh of some/all modules when the PIR module senses a wake-up event?
-
@FlatPepsi I have implemented this to a few of my own modules, and it is relatively simple to add, depending on which modules you want to adapt. However it will require some fiddling with the code of the modules.
-
@Jopyth OK, I’m game. Can you share how that would work?
I just saw a module to play a sound on events- maybe I could also add a cool sound when the monitor wakes/sleeps. Either a Disney-style magic sound, or a StarTrek computer sound…
-
@FlatPepsi I have made a helper function here. This basically works like a normal
setInterval
, except it stops, when noone is present, and immediately exectues when a someone comes back. The helper functions for this are here, you can probably just copy and paste them. And then you finally need to check incoming notifications like this. -
Thanks for this awesome module, works like a charm!
I have one question though, would it be possible in some way to make the sensor inactive a specific time of the day? So that the screen won’t turn on no matter what.
-
Does the problem has known issues with MMM-Remote? Even if i once edit the powerDelay with MMM-Remote it breaks the config file.
Any other module works with the Remote module.Could you please check this?
-
@paviro
Hi,
I need some help please, because my PIR-Sensor doesn´t work with your module.
I do not know what I did wrong. I wrote my Problem in another category in the MM Forum, but unfortunately until now nobody could help me.My problem is that my monitor does not turn off. I configured the config.js like this
module: 'MMM-PIR-Sensor', config: { sensorPIN: 23, powerSaving: true,
and connect the sensor to the raspberry like this
https://www.tutorials-raspberrypi.de/wp-content/uploads/pir.pngWaiting about one, two minutes, but the monitor does not turn off. I would be really happy if you could help me.
Thanks in advance.
-
@paviro Cheers for making a very useful module.
I have made some modifications to node.js to make it work in my situation. I’ve never really done any javascript programming, so what I did was kind of hacked together from various forums. As you know what you’re doing it would be great if you could include any of these features for future versions (I’ve never used GIT before so not sure how to fork etc).
I had to make the following modifications-
- Use the vcgencmd function to turn on/off screen (I couldn’t get it to wake up using tvservice despite trying many variations found online). I found this option suggested by others on the forum. Perhaps a config option to use this in place of the TV service for those who it doesn’t work for?
- The PIR sensor I used is not the same as that used by nearly everyone else (the ones I bought are Wingoneer… they come on a smaller board & don’t have the sensitivity adjustments)… the outcome of this is that the sensor pin is high (+5V) when there is no detection & pulled low (0V) when you move in front of sensor. I therefore had to invert your motion detected logic by swapping the 1 & 0. Could an option for ‘invert pin’ be included?
- I followed various options online for how to disable the screen saver… but my pi still goes in to screen save mode after 30 mins. This means even if motion is detected, the screen switches on but remains blank. I solved this in a bit of a hacky way by using the xdotool package to simulate pressing “space” and therefore end the screensaver.
- One final issue which I haven’t been able to resolve yet is that after restarting my PI, assuming there is no motion detected, the screen will be ‘On’ even though there is no motion detected. As an event is not generated (i.e the state didn’t change) it will stay on until the sensor has detected someone & then moved away. Although this isn’t really a huge deal (it should only be restarted if I’m using the screen so I can trigger an event by moving in front & away again) I just wondered if there is a way to do an initial poll of the sensor after start up. I’m not sure if this is because my sensor logic is inverted or if this behaviour is seen on those using the normal PIRs.
As I understand I will lose these changes if you upgrade your module next time I do a GIT pull.
My code below if it is of interest to anyone:
switch off
exec("vcgencmd display_power 0"); //Used in favour of tvservice
switch on
exec("vcgencmd display_power 1"); //Used in favour of tvservice exec("xdotool key space"); //simulate spacebar to disable screensaver. Needs xdotool to be installed
-
Hi! I’ve run through the posts - though I haven’t been able to find anybody that’s had the sample problem that I’ve had. To test the hardware, I put a towel over the IR sensor, and I find that the monitor flickers on and off, even when the sensor is covered.
Has anybody had this issue? Or can suggest some solutions?
Thanks!
-
Anyway this can send a signal to openhab to control the lights ive put around my frame?