Read the statement by Michael Teeuw here.
Hide modules when display goes off through PIR (power saving)
-
Thanks for the link.
Then let’s see what will happen :) -
@thedk Hi ,
I finally manage to find a solution that works quite good.
I do not deserve the credit for the solutions, only for the implementation as it merges multiple sources.
First : PIR need a first trigger to work .
Workaround : Make the HDMI OFF when the mirror start ( so your screen doesn’t stay ON always until someone pass in front of the miror )For this Edit :
in the MMM-PIR-SENSOR folder
node_helper.js
around line 139this.started = true; self.deactivateMonitor(); // add this to turn off monitor at startup .
Then to deactivate the idle / sleep mode of the modules due to MMM-Assistant
Still in the node_helper.js modify line 34 like :
exec(“/usr/bin/vcgencmd display_power 1 && xdotool key ctrl+r”, null); // add here xdotool key ctrl+r
You need to install xdotool for this. That will allow to simulate the ctrl+r from keybaord that refresh the module therefore bring them back on screen .
I set in the config.js file the pir module to put the screen off after 15 mins
“powerSavingDelay”: “900”,
I applied the same setting in MMM-AssistantMk2.js
onIdle: {
timer: 10006015, // if you don’t want to use this feature, just set timer as0
or command as “”
command: “HIDEMODULES”Summary When I start my mirror the screen is off. The PIR detect my presence and turn it ON .
After 15 mins the screen goes off and the modules goes in sleep .As soon as the user presence is detected again , the screen goes on and modules are refreshed and come back .
Hope this helps .
EJ
-
Maybe I don’t understand your question… but
Hiding modules only with css (i.e hiding them on screen) does nothing for the power saving.
You need the monitor to go in to sleep for any power to be saved.The Pi still runs when you hide the modules, not much power to save there, And I don’t really think the modules reload when hiding/showing them. But I can be wrong haven’t looked in to the code on the Hide/show part.
-
modules do not reload… their content is not shown when hidden
-
But it would save CPU Power if the Modules would be hide or not?
-
@thedk unlikely… or so small as to be unmeasurable
-
@broberg
Indeed you don’t save power but when placing the module “on sleep” you stop them for making them network request with API calls . -
@ejay-ibm yes, a well written module will suspend operations while hidden or suspended.
-
@sdetweil I’d be willing to bet the majority don’t … I don’t have any provisions in mine to stop polling but since you brought it up it is something I will most certainly want to do!! It’s a VERY good idea!
-
@sdetweil said in Hide modules when display goes off through PIR (power saving):
a well written module will suspend operations while hidden or suspended.
That leaves me out. :-)