Page 1 of 1

Battery powered light toggle

Posted: 20 Nov 2023 14:55
by froggy
Hi,
I'm trying to build a simple battery powered light toggle. I have a light connected to a z-wave smart wall switch. I would like to be able to toggle it on/off from another place with a battery powered switch. I connected the Z-uno to a simple door bell switch and loaded this sketch:

byte buttonPressed = 0;
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_SLEEPING);

ZUNO_SETUP_ASSOCIATIONS(ZUNO_ASSOCIATION_GROUP_SCENE_CONTROL);

void setup() {
pinMode(18, INPUT_PULLUP);

}

void loop() {
if (digitalRead(18) == LOW) {
if (buttonPressed == 0) {
zunoSendToGroupSetValueCommand(CTRL_GROUP_1, 1);
buttonPressed = 1;
}
} else {
buttonPressed = 0;
zunoSendDeviceToSleep();
}
delay(10);
}

I have trouble to make this work in Z-Way hub. Any suggestions how I can use this in the Hub scene automations? Or maybe this approach is not correct?

Re: Battery powered light toggle

Posted: 21 Dec 2023 04:18
by PoltoS
You should use ZUNO_ASSOCIATION_GROUP_SET_VALUE instead. Your switch will certainly not understand Scene Activation commands.

Here is a good example: https://z-uno.z-wave.me/examples/AssociationControl/