This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.
Hi there, there is a simple solution when you want to combine motion detection with a schedule:Plug the camera to a time switch. Yeah, I know, it is a bit ridiculous but it works.Hope that helps,F
/*Foward Motion detects if they happen within a given time*/function processInbox() { // A search string to get the thread // Gmail Advanced Search // https://support.google.com/mail/answer/7190?hl=en var threads = GmailApp.search('label:unread label:inbox to:me from:me subject:"Record by Motion Detection E-mail"'); // Stop and start times in hours ( 0-23 ) var startTime = 10; var stopTime = 12+5; // Start and stop days in days ( 0-6 0=sun 6=sat) var startDay = 1; //1=Moday var stopDay = 5; //5=Friday // Address to forward to var address = "[email protected]"; // Log the time var currentTime = todayDate = new Date(); Logger.log("Current Time: "+currentTime); for (var i = 0; i < threads.length; i++) { // get all messages in a given thread var messages = threads[i].getMessages(); // iterate over each message for (var j = 0; j < messages.length; j++) { var message = messages[j]; //Get the date and time of the message var msgDate = message.getDate(); var msgHour = msgDate.getHours() var msgDay = msgDate.getDay(); // log subject date and time of the message Logger.log("Msg Date "+msgDate); Logger.log("Msg Hour "+msgHour); Logger.log("Msg Day "+msgDay); if( msgHour > startTime && msgHour < stopTime && msgDay > startDay && msgDay < stopDay ) { Logger.log("VALID MESSAGE"); forwardMessage(message,address); //message.markRead(); message.getThread().moveToArchive(); } else { Logger.log("INVALID MESSAGE"); message.moveToTrash(); } } } };//Forward the email to another accountfunction forwardMessage(message, address) { Logger.log("FORWARDED to "+address); message.forward(address); }