Change Item Opacity (Transparency)

If you want to set the transparency of Item when the Light changes, you can do it directly (send Light Value to Item.Opacity) or via the script.
The script would be needed if your light changes from 0 to 100 untill the Opacity changes from 0 to 255.



// items
var Level = IR.GetItem("Main").GetItem("Light Level 1");
var Item = IR.GetItem("Main").GetItem("Light Item 1").GetState(0);
// driver name
var driver = IR.GetDevice("KNX Router (KNXnet/IP)");
//by Start
Item.Opacity = 0;
// change opacity manually (using ScriptCall function)
function OpacityChange ()
{
    Item.Opacity = Level.Value*255/100;
}
// change opacity by Feedback from equipment 
IR.AddListener(IR.EVENT_TAG_CHANGE , driver, function(name,value)
{
   Item.Opacity = Level.Value*255/100;
});
Opacity Change by Value.irpz


If you want to convert the feedback only use this script:

var FeedbackConvert;
IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("KNX"), function(name, value)
{
if (name == "Address 1")
{
FeedbackConvert = (value*255)/100
IR.GetItem("Page 1").GetItem("Item 1").GetState(0).Opacity = FeedbackConvert;
IR.Log("Value = "+ value)
}else{
IR.Log("unknown")
}
});

Is dit artikel nuttig voor u?