08.07.2021, 03:09
(05.07.2021, 09:27)admin Wrote: If you want to do a kind of AND/OR gate then you need this. Change group addresses as needed and you can change && (AND) to || (OR).Yes this is what i am after, works well many thanks,
Code:1234567891011121314151617$(function(){ var v1 = false, v2 = false; function set() { $(".hidebyknx").toggleClass("hide", v1 && v2); } grp.listen('1/1/1', function(object, state) { v1 = object.value; set(); }, true); grp.listen('1/1/2', function(object, state) { v2 = object.value; set(); }, true); });
Also how can i request the value for both obj on page load? something like the below? grp.write() works for me but not grp.read() also is there a list of functions that are available in the custom js to interact with objects from the vis etc.
Code:
12345
$(document).ready(function() {
grp.read('1/1/1')
grp.read('1/1/2')
});