// Licht um 6 Uhr ein schedule("0 6 * * *", function () { if (compareTime('06:00', null, ">", getAstroDate("sunrise", undefined, 0))) { console.log('Haustür : Schalte das Licht ein (06:00)'); setState("hm-rpc.0.NEQ1504413.1.STATE"/*OD_SW_Haustue_Licht:1.STATE*/, true); } else { console.log('Haustür : Licht bleibt aus (Sonnenaufgang < 06:00)'); } }); // Licht um X Uhr aus nach Sonnenstand schedule({astro: "sunriseEnd", shift: 30}, function () { console.log((['Haustür : Schalte das Licht aus um : ',formatDate(new Date(), "hh:mm:ss"),' (Sunrise End : ',getAstroDate("sunriseEnd", undefined, 0),')'].join(''))); setState("hm-rpc.0.NEQ1504413.1.STATE"/*OD_SW_Haustue_Licht:1.STATE*/, false); }); // Licht Abends um X Uhr an nach Sonnenstand schedule({astro: "sunsetStart", shift: -20}, function () { if (compareTime('23:00', null, "<", getAstroDate("sunsetStart", undefined, -20))) { console.log((['Haustür : Schalte das Licht ein um : ',formatDate(new Date(), "hh:mm:ss"),' (Sunset Start : ',getAstroDate("sunsetStart", undefined, 0),')'].join(''))); setState("hm-rpc.0.NEQ1504413.1.STATE"/*OD_SW_Haustue_Licht:1.STATE*/, true); } else { console.log('Haustür : Licht bleibt aus (Sonnenuntergang > 23:00)'); } }); // Licht um 23 Uhr aus schedule("0 23 * * *", function () { console.log('Haustür : Schalte das Licht aus (22:00)'); setState("hm-rpc.0.NEQ1504413.1.STATE"/*OD_SW_Haustue_Licht:1.STATE*/, false); }); schedule({astro: "sunrise", shift: 0}, function () { console.debug(('Astro : Sunrise : ' + String(formatDate(new Date(), "hh:mm:ss")))); }); schedule({astro: "sunsetStart", shift: 0}, function () { console.debug(('Astro : Sunset Start : ' + String(formatDate(new Date(), "hh:mm:ss")))); }); schedule({astro: "sunriseEnd", shift: 0}, function () { console.debug(('Astro : Sunrise End : ' + String(formatDate(new Date(), "hh:mm:ss")))); }); schedule({astro: "sunset", shift: 0}, function () { console.debug(('Astro : Sunset : ' + String(formatDate(new Date(), "hh:mm:ss")))); });