This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

javascript group read
#1
Hi,

Is there any way to send group read telegrams from javascript? 

Is there any documentation where I can see which knx bus functions are available using javascript?

Thanks.
Reply
#2
Full list of functions: https://forum.logicmachine.net/showthread.php?tid=321
Since read is not available at the moment you can use this:
Code:
var req = { action: 'read', address: '1/1/1' };
localbus.ws.send(JSON.stringify(req));
Reply
#3
(03.02.2022, 14:28)admin Wrote: Full list of functions: https://forum.logicmachine.net/showthread.php?tid=321
Since read is not available at the moment you can use this:
Code:
var req = { action: 'read', address: '1/1/1' };
localbus.ws.send(JSON.stringify(req));

Ok thanks!!
Reply
#4
(03.02.2022, 14:29)jmir Wrote:
(03.02.2022, 14:28)admin Wrote: Full list of functions: https://forum.logicmachine.net/showthread.php?tid=321
Since read is not available at the moment you can use this:
Code:
var req = { action: 'read', address: '1/1/1' };
localbus.ws.send(JSON.stringify(req));

Ok thanks!!

Hi,

I've tested and it says localbus.ws is not defined...
Reply
#5
You are probably calling it before localbus is connected.
Try this:
Code:
$(localbus).on('connect', function() {
  console.log('connected');
  var req = { action: 'read', address: '1/1/1' };
  localbus.ws.send(JSON.stringify(req));
});
Reply
#6
(04.02.2022, 08:42)admin Wrote: You are probably calling it before localbus is connected.
Try this:
Code:
$(localbus).on('connect', function() {
  console.log('connected');
  var req = { action: 'read', address: '1/1/1' };
  localbus.ws.send(JSON.stringify(req));
});

Ok, now it works!
Thanks!
Reply


Forum Jump: