You are absolutely right. I double checked with my running code.
A closing bracket has not survived a recent editing operation in the Recipe
viewtopic.php?f=3424&t=20849&p=53205#p53205
Has been corected now. Thanks.
Using UDP datagrams to send status updates
Re: Using UDP datagrams to send status updates
Since 29-12-2016 I am no longer a moderator for this forum
Re: Using UDP datagrams to send status updates
Thanks!
Btw. I appreciate your continous effort for this forum.
Btw. I appreciate your continous effort for this forum.
Z-Way 2.0.0-final on Raspberry Pi
Re: Using UDP datagrams to send status updates
Since my upgrade from rc30 to final v2.0.0 it seems that my javascript code is is no longer working can´t find any trace of the file name in the logs. And of course openremote sensors are no longer updated. The image below shows all selected modules
- Attachments
-
- z-way-log.zip
- (458.34 KiB) Downloaded 425 times
Since 29-12-2016 I am no longer a moderator for this forum
Re: Using UDP datagrams to send status updates
I don't see your code, but it might be that it looks only on creation of zway instance (and not on already running), you you should remove Z-Wave Binding and add it after UDP listener. Your code needs to be updated a bit to work in all cases
-
- Posts: 11
- Joined: 11 Sep 2014 18:53
Re: Using UDP datagrams to send status updates
I use the following code to register my function "registerBinding" during boot up or if the file is loaded while zway is running, so far so good:
Code: Select all
this.regesterBinding = function(zwayName) {
if (zwayName != "zway") return;
debugPrint("Binding enabled");
}
if(typeof global.ZWave == 'undefined'){
global.controller.on("ZWave.register", this.regesterBinding);
} else {
this.regesterBinding("zway");
}
Re: Using UDP datagrams to send status updates
PoltoS wrote:I don't see your code, but it might be that it looks only on creation of zway instance (and not on already running), you you should remove Z-Wave Binding and add it after UDP listener.
I have changed the order of modules in the automation preferences. It seems to function now properly. I've updated the description in the Recipes section. I did not have to change the code.
This is a bit cryptic to me. Does that mean adaptations which makes it independent from the order in which the modules are specified in the -preferences-automation window? (the actual code is on Recipe page as well)Your code needs to be updated a bit to work in all cases
Since 29-12-2016 I am no longer a moderator for this forum
Re: Using UDP datagrams to send status updates
This is a bit inaccurate. The correct way should be:digitaldan wrote:I use the following code to register my function "registerBinding" during boot up or if the file is loaded while zway is running, so far so good:
Code: Select all
this.regesterBinding = function(zwayName) { if (zwayName != "zway") return; debugPrint("Binding enabled"); } if(typeof global.ZWave == 'undefined'){ global.controller.on("ZWave.register", this.regesterBinding); } else { this.regesterBinding("zway"); }
Code: Select all
this.registerBinding = function(zwayName) {
if (zwayName != "zway") return;
debugPrint("Binding enabled");
}
// process all active bindings
if (global.ZWave) {
global.ZWave().forEach(this.registerBinding);
}
// and listen for future ones
global.controller.on("ZWave.register", this.registerBinding);
-
- Posts: 11
- Joined: 11 Sep 2014 18:53
Re: Using UDP datagrams to send status updates
Awesome, thanks for the tip.
pofs wrote:This is a bit inaccurate. The correct way should be:digitaldan wrote:I use the following code to register my function "registerBinding" during boot up or if the file is loaded while zway is running, so far so good:
Code: Select all
this.regesterBinding = function(zwayName) { if (zwayName != "zway") return; debugPrint("Binding enabled"); } if(typeof global.ZWave == 'undefined'){ global.controller.on("ZWave.register", this.regesterBinding); } else { this.regesterBinding("zway"); }
Code: Select all
this.registerBinding = function(zwayName) { if (zwayName != "zway") return; debugPrint("Binding enabled"); } // process all active bindings if (global.ZWave) { global.ZWave().forEach(this.registerBinding); } // and listen for future ones global.controller.on("ZWave.register", this.registerBinding);