исправил, не помогло(
function light_control(name, device_in, control_in, device_out, control_out) {
defineVirtualDevice(name, {
title: name,
cells: {
TOGGLE_switch : {
type : "pushbutton",
value : false
},
switch_fb : {
type : "switch",
value : false
},
}
});
defineRule(name + "_switch_control", {
whenChanged: device_in + "/" + control_in,
then: function (newValue, devName, cellName) {
if (dev[device_out][control_out] == false) {
dev[device_out][control_out] = true;
dev[name]["switch_fb"] = true;
} else {
dev[device_out][control_out] = false;
dev[name]["switch_fb"] = false;
}
}
});
defineRule(name + "_switch_control_iridium", {
whenChanged: name + "/TOGGLE_switch",
then: function (newValue, devName, cellName) {
if (dev[device_out][control_out] == false) {
dev[device_out][control_out] = true;
dev[name]["switch_fb"] = true;
} else {
dev[device_out][control_out] = false;
dev[name]["switch_fb"] = false;
}
}
});
defineRule(device_out + "/" + control_out + "_fb", {
whenChanged: device_out + "/" + control_out,
then: function (newValue, devName, cellName) {
if (dev[device_out][control_out] == true) {
dev[name]["switch_fb"] = true;
} else {
dev[name]["switch_fb"] = false;
}
}
});
}
setTimeout(function() { light_control("room11_light_gr1_1_v1_1", "wb-gpio", "EXT1_DR1", "wb-mr6с_43", "K2"); }, 10000);
setTimeout(function() { light_control("room12_light_gr1_2_1_v2_1", "wb-gpio", "EXT1_DR2", "ddm84r_20", "channel1_on_off"); }, 11000);
setTimeout(function() { light_control("room12_light_gr1_2_2_v2_2", "wb-gpio", "EXT1_DR3", "wb-mr6с_43", "K1"); }, 12000);
setTimeout(function() { light_control("room13_light_gr1_3_v4_1", "wb-gpio", "EXT1_DR6", "wb-mr6с_43", "K3"); }, 15000);
setTimeout(function() { light_control("room14_light_gr1_4_v5_1", "wb-gpio", "EXT1_DR7", "wb-mr6с_43", "K4"); }, 16000);
setTimeout(function() { light_control("room15_light_gr1_5_2_v13_1", "wb-gpio", "EXT2_DR3", "wb-mr6с_43", "K6"); }, 17000);
setTimeout(function() { light_control("room16_light_gr1_6_v16_1", "wb-gpio", "EXT2_DR7", "wb-mr6с_42", "K2"); }, 22000);
setTimeout(function() { light_control("room111_light_gr1_11_2_v8", "wb-gpio", "EXT1_DR10", "wb-mr6с_42", "K6"); }, 30000);
setTimeout(function() { light_control("room12_light_gr1_12_v6", "wb-gpio", "EXT1_DR8", "wb-mr6с_30", "K1"); }, 31000);
setTimeout(function() { light_control("room22_light_gr2_2_v23_1", "wb-gpio", "EXT2_DR13", "ddm84r_21", "channel1_on_off"); }, 34000);
setTimeout(function() { light_control("room22_light_gr2_2_v28_1", "wb-gpio", "EXT3_DR3", "ddm84r_21", "channel1_on_off"); }, 35000);
setTimeout(function() { light_control("room25_light_gr2_3_v25_1", "wb-gpio", "EXT2_DR16", "wb-mr6с_30", "K3"); }, 36000);
setTimeout(function() { light_control("room24_light_gr2_4_2_v27", "wb-gpio", "EXT3_DR2", "wb-mr6с_30", "K5"); }, 37000);
setTimeout(function() { light_control("room26_light_gr2_6_2v31_1", "wb-gpio", "EXT3_DR7", "wb-mr6с_64", "K3"); }, 40000);
/* setTimeout(function() { light_control("at_home_scene_caller_control_v3_1", "wb-gpio", "EXT1_DR4", "at_home_scene_controller", "scene1_call"); }, 13000);
setTimeout(function() { light_control("master_off_scene_caller_control_v3_2", "wb-gpio", "EXT1_DR5", "master_off_control", "master_off_ON_switch"); }, 14000);
setTimeout(function() { light_control("room15_scene_caller_control_v11_1", "wb-gpio", "EXT1_DR15", "room15_scene_controller", "scene1_call"); }, 18000);
setTimeout(function() { light_control("room15_scene_caller_control_v11_2", "wb-gpio", "EXT1_DR16", "room15_scene_controller", "scene2_call"); }, 19000);
setTimeout(function() { light_control("room15_scene_caller_control_v12_1", "wb-gpio", "EXT2_DR1", "room15_scene_controller", "scene3_call"); }, 20000);
setTimeout(function() { light_control("room15_scene_caller_control_v12_2", "wb-gpio", "EXT2_DR2", "room15_scene_controller", "scene4_call"); }, 21000);
setTimeout(function() { light_control("room17_scene_caller_control_v9_1", "wb-gpio", "EXT1_DR11", "room17_scene_controller", "scene1_call"); }, 23000);
setTimeout(function() { light_control("room17_scene_caller_control_v9_2", "wb-gpio", "EXT1_DR12", "room17_scene_controller", "scene2_call"); }, 24000);
setTimeout(function() { light_control("room17_scene_caller_control_v10_1", "wb-gpio", "EXT1_DR13", "room17_scene_controller", "scene3_call"); }, 25000);
setTimeout(function() { light_control("room17_scene_caller_control_v10_2", "wb-gpio", "EXT1_DR14", "room17_scene_controller", "scene4_call"); }, 26000);
setTimeout(function() { light_control("room17_scene_caller_control_v14_1", "wb-gpio", "EXT2_DR4", "room17_scene_controller", "scene1_call"); }, 27000);
setTimeout(function() { light_control("room17_scene_caller_control_v14_2", "wb-gpio", "EXT2_DR5", "room17_scene_controller", "scene2_call"); }, 28000);
setTimeout(function() { light_control("room17_scene_caller_control_v15_1", "wb-gpio", "EXT2_DR6", "room17_scene_controller", "scene3_call"); }, 29000);
setTimeout(function() { light_control("room19_scene_caller_control_v19_1", "wb-gpio", "EXT2_DR10", "room19_scene_controller", "scene4_call"); }, 32000);
setTimeout(function() { light_control("room19_scene_caller_control_v21_1", "wb-gpio", "EXT2_DR11", "room19_scene_controller", "scene4_call"); }, 33000);
setTimeout(function() { light_control("room27_scene_caller_control_v33_1", "wb-gpio", "EXT3_DR8", "room27_scene_controller", "scene4_call"); }, 38000);
setTimeout(function() { light_control("room27_scene_caller_control_v35_1", "wb-gpio", "EXT3_DR9", "room27_scene_controller", "scene4_call"); }, 39000); */