Problems after power outage.
Posted: 31 Dec 2014 08:59
Hello, recently the power went out at my house. After getting power back, my custom javascript code is no longer working. Can somebody help me understand what is going on...? The log shows this related to my code:
[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):
The logs will show things like this, but never trigger my bindFunc1 (related to device 17):
I am on version 2.0.0
[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