Page 2 of 2

Re: Fibaro Dimmer 2 association to control the z uno

Posted: 02 Dec 2020 09:13
by Hillie
Thanks. I tried it without success some time ago. I will try it again. Why isn’t this described in the quick quide and in the examples? It’s confusing.

Re: Fibaro Dimmer 2 association to control the z uno

Posted: 03 Dec 2020 10:28
by PoltoS
It is a bit too technical for QSG

Re: Fibaro Dimmer 2 association to control the z uno

Posted: 16 Dec 2020 14:37
by Plazma
Hello, I still do not understand where to insert this line in the code. help me please.
The way it is done in the code below does not work

// Global variables

byte pin4SwitchBinaryState = 0;

byte pin14SwitchMultilevelState = 0;

ZUNO_DISABLE(NO_MULTIBINARY_SWITCH0);

// Z-Wave channels
ZUNO_SETUP_CHANNELS(
ZUNO_SWITCH_BINARY(pin4SwitchBinaryGetter, pin4SwitchBinarySetter),
ZUNO_SWITCH_MULTILEVEL(pin14SwitchMultilevelGetter, pin14SwitchMultilevelSetter)
);

void setup() {
pinMode(4, OUTPUT);

pinMode(14, OUTPUT);
}

void loop() {
digitalWrite(4, pin4SwitchBinaryState ? HIGH : LOW);

analogWrite(14, (word)pin14SwitchMultilevelState * 255 / 99);

delay(20);
}

// Getters and setters

void pin4SwitchBinarySetter(byte value) {
pin4SwitchBinaryState = value;
}

byte pin4SwitchBinaryGetter() {
return pin4SwitchBinaryState;
}

void pin14SwitchMultilevelSetter(byte value) {
pin14SwitchMultilevelState = value;
}

byte pin14SwitchMultilevelGetter() {
return pin14SwitchMultilevelState;
}

Re: Fibaro Dimmer 2 association to control the z uno

Posted: 08 Jan 2021 07:08
by PoltoS
Should be ok. You can also try to change the order of the two channels to get the desired effect