Battery powered light toggle

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
froggy
Posts: 10
Joined: 02 Jan 2019 22:36

Battery powered light toggle

Post 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?
User avatar
PoltoS
Posts: 7579
Joined: 26 Jan 2011 19:36

Re: Battery powered light toggle

Post 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/
Post Reply