MMM-SleepWake using external motion detection source



  • @sdetweil I noticed a weird issue. sometimes after several sleep&wake cycles, when it goes to sleep only the stock currentweather and weatherforecast modules stays on. there is no error in the motion.log or MM log.

    here is my config, I was using delay: 5 then switched to 0.2 so I can repeat the issue faster.

    {
    			module: "MMM-SleepWake",
    			config:{
    				delay:  0.2,               // default
    				source: "external",
    				mode:  "HIDE"
    			}
    			 // detectionDir: folder containing externally generated file when motion starts
    			 //               will be created if needed
    			 // detectionFile:  filename generated for motion start. default = 'detected'
    },
    

    0_1566395564247_Screen Shot 2019-08-21 at 1.27.52 AM.png



  • @mithatcak very interesting… I use those default modules too and I have never seen that behavior.
    like they didn’t handle the suspend request…

    i have 4 systems running this everyday for months… only see the updatenotification module output on one as it doesn’t handle hide/suspend…

    i will do some additional debugging



  • @mithatcak could you try something for me

    i cannot reproduce this on any of my systems…

    edit the MMM-SleepWake.js file

    		case "SLEEP_HIDE":
    			MM.getModules().enumerate((module) => {
    				// if the module is already hidden
    				if(module.hidden==true)
    					// save it for wake up
    					{v_self1.previously_hidden.push(module.identifier);}
    				else
    					// hide this module
    					{module.hide(1000);}   // < --- change this line , remove the 1000 
    ```
    should look like this
    ```
    		case "SLEEP_HIDE":
    			MM.getModules().enumerate((module) => {
    				// if the module is already hidden
    				if(module.hidden==true)
    					// save it for wake up
    					{v_self1.previously_hidden.push(module.identifier);}
    				else
    					// hide this module
    					{module.hide();}
    ```
    
    let me know


  • @sdetweil Unfortunately same result 😕 I will try to replace currentweather and weatherforecast with weather module and see if it’s going to make any difference.



  • @sdetweil Good news, switching to new weather module fixed the issue.



  • @mithatcak interesting