In one of the code samples in the quick-start guide, they show how to setup multiple channels:
Code: Select all
ZUNO_SETUP_CHANNELS(
ZUNO_SWITCH_BINARY(getterLED, setterLED),
ZUNO_SWITCH_MULTILEVEL(getterDimmer, setterDimmer),
ZUNO_SENSOR_BINARY_GENERAL_PURPOSE(getterButton)
);
Is it possible to do something like:
Code: Select all
ZUNO_SETUP_CHANNELS(
ZUNO_SWITCH_BINARY(getter1, setter1),
ZUNO_SWITCH_BINARY(getter2, setter2),
ZUNO_SWITCH_BINARY(getter3, setter3)
);
- how would you select which switch you wanted to control from a Smartthings device-handler? I can't find any mention of a "channel number" in their methods for constructing a Z-wave message.
- Is there a way for the getter/setter to discover the channel number they were activated with? If so, you can have multiple channels share a single getter/setter pair (because they can figure out, from the channel number, which switch is being set/queried). Something like:
If there isn't a way to do this, then it's probably best to have the Zuno pretend to be a dimmer, so that the desired value of all of the relays can be encoded as a bitmap in the dimmer value and you can use a single getter/setter.
Code: Select all
void setter(byte value) { int switch_num = get_channel(); digitalWrite(switch_num, (value==0)?LOW:HIGH); }