ZUNO_SENSOR_BINARY()

This macro is a generic macro to be used to setup binary sensor channel for Z-Uno board using ZUNO_SETUP_CHANNELS. Instead we suggest to use one of the specific macro ZUNO_SENSOR_BINARY_* from the list below. This type (and 3 other) affects only the display on the controller. Z-Uno understands two ways to define a channel: using getter function and using a variable.
  • With getter definition the getter function is called each time a value is requested. This allows to do some calculus before returning a value.
  • With variable definition Z-Uno will automatically return the variable status. This allows to minimize your code.
ZUNO_SENSOR_BINARY(type, getter) type type of channel like ZUNO_SENSOR_BINARY_TYPE_DOOR, ZUNO_SENSOR_BINARY_TYPE_SMOKE,.. etc. Used to correctly display the sensor in the Z-Wave controller. Full list is defined in ZUNO_Definitions.h and starts with ZUNO_SENSOR_BINARY_TYPE_ getter pointer to a user defined function, which is supposed to return current value for this channel. Functions getter should return 0 for non-triggered state and any non-zero for triggered state. BYTE getter(void)
           ZUNO_SETUP_CHANNELS(ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_SMOKE, getterFunction));
           
void setup() {
    ...
}

void loop() {
    ...
}

byte getterFunction() {
    return currentValue;
}
        
    
ZUNO_SENSOR_BINARY(type, variable) type type of channel like ZUNO_SENSOR_BINARY_TYPE_DOOR, ZUNO_SENSOR_BINARY_TYPE_SMOKE,.. etc. Used to correctly display the sensor in the Z-Wave controller. Full list is defined in ZUNO_Definitions.h and starts with ZUNO_SENSOR_BINARY_TYPE_ variable variable that contains the current value for this channel. Should be 0 for non-triggered state and any non-zero for triggered state.
           ZUNO_SETUP_CHANNELS(ZUNO_SENSOR_BINARY(ZUNO_SENSOR_BINARY_TYPE_SMOKE, variableSmoke));
       
byte variableSmoke = 0;

void setup() {
    ...
}

void loop() {
    ...
    variableSmoke = ...;
    ...
}
        
    
Channel generated using this macro will have Z-Wave Device Class GENERIC_TYPE_SENSOR_NOTIFICATION / SPECIFIC_TYPE_NOTIFICATION_SENSOR with Notification and Sensor Binary (for legacy suport) Command Classes. Use ZUNO_DISABLE(WITH_CC_SENSOR_BINARY or WITH_CC_NOTIFICATION) to disable Notification or Sensor Binary on the channel. Popular sensor types have pre-defined macro. Few are listed below. Full list is defined in ZUNO_Definitions.h file and starts with ZUNO_SENSOR_BINARY_ ZUNO_SENSOR_BINARY_GENERAL_PURPOSE(getter or variable)
ZUNO_SENSOR_BINARY_SMOKE(getter or variable)
ZUNO_SENSOR_BINARY_CO(getter or variable)
ZUNO_SENSOR_BINARY_CO2(getter or variable)
ZUNO_SENSOR_BINARY_HEAT(getter or variable)
ZUNO_SENSOR_BINARY_WATER(getter or variable)
ZUNO_SENSOR_BINARY_FREEZE(getter or variable)
ZUNO_SENSOR_BINARY_TAMPER(getter or variable)
ZUNO_SENSOR_BINARY_DOOR_WINDOW(getter or variable)
ZUNO_SENSOR_BINARY_MOTION(getter or variable)
ZUNO_SENSOR_BINARY_GLASSBREAK(getter or variable)