add Shutter
parent
0182f825a1
commit
c970650abd
@ -0,0 +1,27 @@
|
||||
const allShellyWithShutter = $('shelly.0.*.Shutter.Position');
|
||||
const shuttersToAutomate = ["SHSW-25#84CCA8B0489C#1"]; //Küche
|
||||
|
||||
schedule({ astro: "sunset", shift: 60 }, async function () {
|
||||
allShellyWithShutter.each(function (shutter, i) {
|
||||
let shutterName = shutter.split('.')[2];
|
||||
if (shuttersToAutomate.includes(shutterName)) {
|
||||
let textString = '60 min nach Sonnenuntergang, Rollo ' + shutterName + ' runter.';
|
||||
console.log(textString);
|
||||
sendTo("telegram.0", "send", { text: textString });
|
||||
setState(shutter, 0);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
schedule({ astro: "sunrise", shift: -60 }, async function () {
|
||||
|
||||
allShellyWithShutter.each(function (shutter, i) {
|
||||
let shutterName = shutter.split('.')[2];
|
||||
if (shuttersToAutomate.includes(shutterName)) {
|
||||
let textString = '60 min vor Sonnenaufgang, Rollo ' + shutterName + ' hoch.';
|
||||
console.log(textString);
|
||||
sendTo("telegram.0", "send", { text: textString });
|
||||
setState(shutter, 0);
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue