I have a number of devices that sent out temperature updates/sets - that I'd like to run some code on (a PID controller and a calendar based override).
What is the proper way to get the zDeviceID et.al. ? The naive code below is obviously not working ?
Thanks,
Dw.
PS: Also wondering if there is a way to trigger z-way to reload a *.js file (and give line numbers for errors) on the fly.
// File: /opt/z-way-server/automation/test.js
//
for(var i =2; i < 10; i++) {
console.log("registering "+i);
zway.devices.instances[0].ThermostatSetPoint.data[1].val.bind(function () {
console.log("Device ?? got set to " + this);
});
zway.devices.instances[0].SensorMultilevel.data[1].val.bind(function (somearg) {
console.log("Device "+somearg+" read value " + this);
});
}
// Does not yet exit this early?
// zway.dataUpdate.bind(function(a,b,c,d) { console.log("Some dataUpate "+a+"/"+b+"/"+c+"/"+d+" = "+this); });
source of a bind() information push
New 1.4.1 release provides
New 1.4.1 release provides lines and stack trace for errors.
You need to add one more param to the second bind() that will be passed as somearg in your function.
Also make sure that all devices from 2 to 9 contains ThermostatSetPoint and SensorMutilevel, otherwise the code will fail.
You need to add one more param to the second bind() that will be passed as somearg in your function.
Also make sure that all devices from 2 to 9 contains ThermostatSetPoint and SensorMutilevel, otherwise the code will fail.
No, it is type of change (see
No, it is type of change (see C headers to find them out - search for "Phantom" word)