title: "VorotaOnOff",
cells: {
pushbutton: {
type: "pushbutton",
value: 0,
}
}
});
defineRule("Ворота", {
whenChanged: "VorotaOnOff/pushbutton",
then: function(newValue, devName, cellName) {
if (newValue) {
publish("zigbee2mqtt/0x842e14fffee3858a/set", JSON.stringify({ state: "ON" }), 2, false);
setTimeout(function offrelay() {
publish("zigbee2mqtt/0x842e14fffee3858a/set", JSON.stringify({ state: "OFF" }), 2, false);
}, 200);
}
}
});
Поправил, все работает