It took a little research on how to pass values to setTimeout, but the event definitions below just worked for me. If you try to do back to back sendMessageToNode calls, the second one will fail (moteino/radio busy?). This approach uses setTimeout to schedule action BTN0:1 and BTN0:0 one second after the sendMessageToNode for BTN1. Kind of a hack, but it worked.
switchMoteBothON_PM : { label:'SwitchMote both ON at sunset!', icon:'clock', descr:'Turn both switches ON at sunset', nextSchedule:function(node) { return exports.millisToFutureDate(exports.nextSunriseOrSunset(0), exports.ONEDAY*2); }, scheduledExecute:function(node) { var nID = node._id; setTimeout(function() { sendMessageToNode({nodeId:nID, action:'BTN0:1'}); },1000, nID); sendMessageToNode({nodeId:node._id, action:'BTN1:1'}); } },
switchMoteBothOFF_AM : { label:'SwitchMote both OFF at sunrise!', icon:'clock', descr:'Turn both switches OFF at sunrise', nextSchedule:function(node) { return exports.millisToFutureDate(exports.nextSunriseOrSunset(1), exports.ONEDAY*2); }, scheduledExecute:function(node) {var nID = node._id; setTimeout(function() { sendMessageToNode({nodeId:nID, action:'BTN0:0'}); },1000, nID); sendMessageToNode({nodeId:node._id, action:'BTN1:0'}); } },