"OR" condition. Turn on the Item if one of feedbacks is not a zero

Use the script attached to work with the list of Feedback or List of Tokens by the OR condition.
You can use it, for example, when you need to activate item or make an action only if one of the feedbacks from the list > 0:

var deviceName = "KNX"; // Driver Name
var ChannelBuff = ['Dimmer', 'f32', 'u32', 's32', 'u16', 's16']; // List of Feedbacks
var projectToken = "MyProjectToken"; // Project Token name
  
function CheckChannels(DeviceID, _ChannelBuff, _Token)
{
  DeviceID = IR.GetDevice(DeviceID);  // Get the device ID

  for (var i = 0; i <= _ChannelBuff.length - 1; i++) // Check the Feedbacks
   
 if(DeviceID.GetFeedback(_ChannelBuff[i]) > 0) // If the Feedback > 0, then write 1 to Project Token
         IR.SetVariable("Global." + projectToken, 1)
}

IR.AddListener(IR.EVENT_TAG_CHANGE , IR.GetDevice(deviceName), function(name,value)
{
   IR.SetVariable("Global." + projectToken, 0);
   CheckChannels(deviceName, ChannelBuff, projectToken);
})
 

ONifOneTokenNotAzero.irpz
ONifOneChannelNotAzero.irpz

Is this article helpful for you?