ioBroker/script.js.Shelly.HeatProtec...

19 lines
762 B
JavaScript

//Put all Shutters towards south down to 22%
const position = 22;
const allShutters = $('shelly.0.*.Shutter.Position');
const shuttersOnSouth = ["SHSW-25#84CCA8B0D29B#1", "SHSW-25#84CCA8B11690#1", "SHSW-25#84CCA8B15259#1", "SHSW-25#84CCA8B16945#1"];
heatProtection();
stopScript("script.js.Shelly.HeatProtection");
function heatProtection() {
allShutters.each(function (shutter, i) {
var name = shutter.split('.')[2];
if (shuttersOnSouth.includes(name)) {
log("Setting position of " + name + " to " + position + "% for heat protection.");
sendTo("telegram", "send", { text: "Setting position of " + name + " to " + position + "% for heat protection." });
setState(shutter, position);
}
});
}