Page 1 of 1

Last Dimmer Bug

Posted: 17 May 2022 04:33
by Zeloz
Perhaps I'm overlooking something in my code but for some reason everything but the last dimmer works correctly. The last dimmer activates "Warm1" rather than "Daylight2". Additionally, when setting it from my Z-Wave controller changing/attempting to change "Daylight2" actually changes "Warm1" as well. Here is my code:

#include "Arduino.h"
#include "ZUNO_NeoPixel.h"

// Last saved LED value
byte currentPowerValue;
byte currentModeValue;

byte warm1 = 0;
byte cool1 = 0;
byte daylight1 = 0;

byte warm2 = 0;
byte cool2 = 0;
byte daylight2 = 0;

//--------------------------------------------------------
void powerSetter (byte value) {
if (value > 0) {
Serial.println("LED On");
} else {
Serial.println("LED Off");
}
currentPowerValue = value;
}

byte powerGetter (){
return currentPowerValue;
}
//--------------------------------------------------------
void modeSetter (byte value) {
if (value > 0) {
Serial.println("Mode 2");
} else {
Serial.println("Mode 1");
}
currentModeValue = value;
}

byte modeGetter (){
return currentModeValue;
}
//--------------------------------------------------------

//--------------------------------------------------------
void warm1Setter(byte newValue) {
warm1 = newValue;
Serial.println("Warm 1:");
Serial.println(newValue);
}

byte warm1Getter() {
return warm1;
}
//--------------------------------------------------------
void cool1Setter(byte newValue) {
cool1 = newValue;
Serial.println("Cool 1:");
Serial.println(newValue);
}

byte cool1Getter() {
return cool1;
}
//--------------------------------------------------------
void daylight1Setter(byte newValue) {
daylight1 = newValue;
Serial.println("Daylight 1:");
Serial.println(newValue);
}

byte daylight1Getter() {
return daylight1;
}
//--------------------------------------------------------

//--------------------------------------------------------
void warm2Setter(byte newValue) {
warm2 = newValue;
Serial.println("Warm 2:");
Serial.println(newValue);
}

byte warm2Getter() {
return warm2;
}
//--------------------------------------------------------
void cool2Setter(byte newValue) {
cool2 = newValue;
Serial.println("Cool 2:");
Serial.println(newValue);
}

byte cool2Getter() {
return cool2;
}
//--------------------------------------------------------
void daylight2Setter(byte newValue) {
daylight2 = newValue;
Serial.println("Daylight 2:");
Serial.println(newValue);
}

byte daylight2Getter() {
return daylight2;
}
//--------------------------------------------------------

ZUNO_SETUP_CHANNELS(ZUNO_SWITCH_BINARY(powerGetter, powerSetter),
ZUNO_SWITCH_BINARY(modeGetter, modeSetter),
ZUNO_SWITCH_MULTILEVEL(warm1Getter, warm1Setter),
ZUNO_SWITCH_MULTILEVEL(cool1Getter, cool1Setter),
ZUNO_SWITCH_MULTILEVEL(daylight1Getter, daylight1Setter),
ZUNO_SWITCH_MULTILEVEL(warm2Getter, warm2Setter),
ZUNO_SWITCH_MULTILEVEL(cool2Getter, cool2Setter),
ZUNO_SWITCH_MULTILEVEL(daylight2Getter, daylight2Setter)
);

/* LED counter */
#define LED_COUNT 4

/* LED pin number */
#define LED_PIN 9

/* the setup function runs once, when you press reset or power the board */
void setup() {
Serial.begin(9600);
//Serial.println("Starting");
//delay(1000);
//Serial.println("Starting");
NeoPixel.addNeo(LED_PIN, LED_COUNT);
}

void loop() {
NeoPixel.fill(LED_PIN, 0, LED_COUNT, NeoPixel.RGB(0, 255, 0));
NeoPixel.show(LED_PIN);
delay(500);
NeoPixel.clear(LED_PIN);
NeoPixel.show(LED_PIN);
delay(500);
}

Re: Last Dimmer Bug

Posted: 17 May 2022 07:18
by Zeloz
There's definitely something odd going on, I re-ordered the devices in the ZUNO_SETUP_CHANNELS call and put the binary switches at the end. This caused all the multilevel switches to work, and the first binary switch to work but not the second. The last switch sets the previous switch output. (using Homeseer version 4.2.7)

Re: Last Dimmer Bug

Posted: 17 May 2022 11:16
by PoltoS
Hi! From the previous version of Z-Uno it was known that Homeseer is doing something very strange with highly multichannel devices. I'd you can check it on other controller, would be nice. I fear you have to contact HS support to let them fix it on their side

Re: Last Dimmer Bug

Posted: 20 May 2022 21:55
by Zeloz
I believe I got it working with support from Homeseer (working for now). Had to update a few things on the Homeseer side and then place the device about a foot away from the Z-Wave base station when adding.

Re: Last Dimmer Bug

Posted: 24 May 2022 04:05
by PoltoS
Maybe you can share more info on how to fix it on HomeSeer. We are curious too ;)