[2014-12-31 05:09:17.623] [core] --- Starting module Load custom JavaScript code
[2014-12-31 05:09:17.640] [core] Executing script: this.bindFunc1 = function(zwayName) { ...
and below is my code (this same exact code was working before my power outage):
Code: Select all
this.bindFunc1 = function(zwayName) {
if (zwayName != "zway") return;
var devices = global.ZWave[zwayName].zway.devices;
devices[16].SensorBinary.data[1].level.bind(function() {
debugPrint( 'CHANGED\n ');
if (this.value == true)
http.request({
url: "myurlhere",
method: "POST",
async: true
});
});
devices[17].SensorBinary.data[1].level.bind(function() {
debugPrint( 'CHANGED\n ');
if (this.value == true)
http.request({
url: "http://myurlhere",
method: "POST",
async: true
});
});
devices[20].SensorBinary.data[1].level.bind(function() {
debugPrint( 'CHANGED\n ');
if (this.value == true)
http.request({
url: "http://myurlhere",
method: "POST",
async: true
});
});
devices[21].SensorBinary.data[1].level.bind(function() {
debugPrint( 'CHANGED\n ');
if (this.value == true)
http.request({
url: "http://myurlhere",
method: "POST",
async: true
});
});
};
global.controller.on("ZWave.register", this.bindFunc1);
Code: Select all
[2014-12-31 05:05:55.150] [D] [zway] SETDATA devices.17.instances.0.commandClasses.48.data.1.level = True
[2014-12-31 05:05:55.151] [D] [zway] SETDATA devices.17.instances.0.commandClasses.48.data.1 = Empty
[2014-12-31 05:06:48.563] [D] [zway] RECEIVED: ( 01 09 00 04 00 11 03 30 03 00 D3 )
[2014-12-31 05:06:48.564] [D] [zway] SENT ACK
[2014-12-31 05:06:48.564] [D] [zway] SETDATA devices.17.data.lastReceived = 0 (0x00000000)
[2014-12-31 05:06:48.564] [D] [zway] SETDATA devices.17.instances.0.commandClasses.48.data.1.level = False
[2014-12-31 05:06:48.565] [D] [zway] SETDATA devices.17.instances.0.commandClasses.48.data.1 = Empty