Z-Wave controller not getting updated
Posted: 29 Aug 2019 19:27
Hi all,
I've a simple program to detect voltage changes on A0 pin.
The serial output works and shows the correct voltage. If it detects a difference to the previous value it sends (well it's supposed to) the updated value to the ZWave controller (AEON Gen 5 USB Controller).
If I do a node refresh on the controller I see the updated value correctly, but the Z-Uno isn't sending it by itself. What am I missing?
float vcc = 3.0; // supply voltage
float vout = 0.0; //
float vin = 0.0;
float vinUpdated = 0.0;
float R1 = 100000.0; // resistance of R1 (100K)
float R2 = 10000.0; // resistance of R2 (10K)
float errorCorrection = 1.027431421446384; // % tolerance correction of resistors - start with 0, use real multimeter value of input voltage divided by value output to "vin" and then enter calculated value here
int value = 0;
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_ALWAYS_AWAKE);
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_MULTILEVEL(
ZUNO_SENSOR_MULTILEVEL_TYPE_VOLTAGE,
SENSOR_MULTILEVEL_SCALE_VOLT,
SENSOR_MULTILEVEL_SIZE_FOUR_BYTES,
SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS,
getter)
);
void setup() {
pinMode(A0, INPUT);
Serial.begin(9600);
Serial.println("DC Voltage");
}
void loop() {
// read the value at analog input
value = analogRead(A0);
vout = (value * vcc) / 1023.0;
vin = vout / ((R2 / (R1 + R2)) / errorCorrection);
if (vin < 0.09) {
vin = 0.0; // zero min undesired value
}
if (value > 900) {
vin = 0.0; // zero max undesired value
}
Serial.println("A0 Value: ");
Serial.println(value);
Serial.println("Voltage on A0: ");
Serial.println(vout);
Serial.println("Actual Voltage: ");
Serial.println(vin);
delay(1000);
if (vin != vinUpdated) {
vinUpdated = vin;
zunoSendReport(1);
delay(35000);
}
}
// send voltage to zwave controller
word getter(void) {
return (vinUpdated * 100);
}
I've a simple program to detect voltage changes on A0 pin.
The serial output works and shows the correct voltage. If it detects a difference to the previous value it sends (well it's supposed to) the updated value to the ZWave controller (AEON Gen 5 USB Controller).
If I do a node refresh on the controller I see the updated value correctly, but the Z-Uno isn't sending it by itself. What am I missing?
float vcc = 3.0; // supply voltage
float vout = 0.0; //
float vin = 0.0;
float vinUpdated = 0.0;
float R1 = 100000.0; // resistance of R1 (100K)
float R2 = 10000.0; // resistance of R2 (10K)
float errorCorrection = 1.027431421446384; // % tolerance correction of resistors - start with 0, use real multimeter value of input voltage divided by value output to "vin" and then enter calculated value here
int value = 0;
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_ALWAYS_AWAKE);
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_MULTILEVEL(
ZUNO_SENSOR_MULTILEVEL_TYPE_VOLTAGE,
SENSOR_MULTILEVEL_SCALE_VOLT,
SENSOR_MULTILEVEL_SIZE_FOUR_BYTES,
SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS,
getter)
);
void setup() {
pinMode(A0, INPUT);
Serial.begin(9600);
Serial.println("DC Voltage");
}
void loop() {
// read the value at analog input
value = analogRead(A0);
vout = (value * vcc) / 1023.0;
vin = vout / ((R2 / (R1 + R2)) / errorCorrection);
if (vin < 0.09) {
vin = 0.0; // zero min undesired value
}
if (value > 900) {
vin = 0.0; // zero max undesired value
}
Serial.println("A0 Value: ");
Serial.println(value);
Serial.println("Voltage on A0: ");
Serial.println(vout);
Serial.println("Actual Voltage: ");
Serial.println(vin);
delay(1000);
if (vin != vinUpdated) {
vinUpdated = vin;
zunoSendReport(1);
delay(35000);
}
}
// send voltage to zwave controller
word getter(void) {
return (vinUpdated * 100);
}