(24.12.2016, 00:08)FatMax Wrote: Is there any way to hide a object from visu when there´s no value? I´m monitoring a 4 byte float kW object, but there´s no point in having it show in visu when it´s 0.00 kW.
This script should work. You must add to this object in visualisation editor text "power" in Additional classes and change the value for nothing(now is '0 kWh', can be empty '''). You can also change the color of this text e.g. black when 0 and yellow when more than 0.
Code:
//Change text to nothing when 0,00 kWh
$(function(){
function power_update(){
// Set values
var nothing = '0 kWh' // value for nothing
power = parseFloat( $('.power').html() )
if ( power == 0 || power == nothing ){
$('.power').html(nothing);
}
}
// Check for changes on value of item with power
$(".power").bind("DOMSubtreeModified",function(){
power_update();
});
// Initial execution
power_update();
});