defineVirtualDevice("power_off_kabinet", { title: "ВЫКЛ кабинет", cells: { power_off: { type: "pushbutton" }, } }); var ps = new PersistentStorage("power-storage", { global: true }); var lights = ["wb-led_194/Channel 1","wb-mdm3_18/K1"]; var isPowerOff = true; defineRule({ whenChanged: ["wb-mcm8_211/Input 1 Single Press Counter", "power_off/power_off"], then: function (newValue, devName, cellName) { lights.forEach(function (light) { ps[light] = dev[light]; dev[light] = false; }); } });