Блокировка сухих контактов или реле

var topicIn = "wb-mr3_36/Input 1 counter";
var topicBlock = "wb-mr3_36/Input 2";
var outRelay = "wb-mr3_36/K1";

defineRule(topicIn + '-trigger', {
    whenChanged: topicIn,
    then: function(newValue, device, control) {
      if (topicBlock){
       dev[outRelay] = !dev[outRelay]
      }
    }
});