26.03.2018, 07:59
(This post was last modified: 26.03.2018, 08:02 by Erwin van der Zwart.)
Hi,
You probably want to change the image source dynamic on a KNX value, you can do that like this:
1) Add a few icons to the icons tab, and name them icon_1.png, icon_2.png, icon_3.png etcetera
2) Add a byte object (40/1/15 in this sample)
3) Add a image element to the visu with a additional class (in the sample it's "icoon" and don't use "icon" as its a default used class)
4) Use this custom JS to make it happen
BR,
Erwin
You probably want to change the image source dynamic on a KNX value, you can do that like this:
1) Add a few icons to the icons tab, and name them icon_1.png, icon_2.png, icon_3.png etcetera
2) Add a byte object (40/1/15 in this sample)
3) Add a image element to the visu with a additional class (in the sample it's "icoon" and don't use "icon" as its a default used class)
4) Use this custom JS to make it happen
Code:
$(function(){
if (typeof grp != 'undefined') {
grp.listen('40/1/15', function(object, state) {
$('.icoon').find('img').attr('src', '/scada/resources/img/icon_' + object.value + '.png')
}, true);
}
});
Erwin