|
7 | 7 |
|
8 | 8 | The ``ZigbeeBinary`` class provides an endpoint for binary input/output sensors in Zigbee networks. This endpoint implements the Zigbee Home Automation (HA) standard for binary sensors, supporting various application types for HVAC, security, and general binary sensing.
|
9 | 9 | Binary Input (BI) is meant to be used for sensors that provide a binary signal, such as door/window sensors, motion detectors, etc. to be sent to the network.
|
10 | | - |
11 | | -.. note:: |
12 | | - |
13 | | - Binary Output (BO) is not supported yet. |
| 10 | +Binary Output (BO) is used for controlling binary devices such as relays, switches, or actuators that can be turned on/off remotely. |
14 | 11 |
|
15 | 12 | API Reference
|
16 | 13 | -------------
|
@@ -63,6 +60,33 @@ Security Application Types
|
63 | 60 | #define BINARY_INPUT_APPLICATION_TYPE_SECURITY_HEAT_DETECTION 0x01000008
|
64 | 61 | #define BINARY_INPUT_APPLICATION_TYPE_SECURITY_OTHER 0x0100FFFF
|
65 | 62 |
|
| 63 | +Binary Output Application Types |
| 64 | +******************************* |
| 65 | + |
| 66 | +HVAC Application Types |
| 67 | +^^^^^^^^^^^^^^^^^^^^^^ |
| 68 | + |
| 69 | +.. code-block:: arduino |
| 70 | + |
| 71 | + #define BINARY_OUTPUT_APPLICATION_TYPE_HVAC_BOILER 0x00000003 |
| 72 | + #define BINARY_OUTPUT_APPLICATION_TYPE_HVAC_CHILLER 0x0000000D |
| 73 | + #define BINARY_OUTPUT_APPLICATION_TYPE_HVAC_FAN 0x00000022 |
| 74 | + #define BINARY_OUTPUT_APPLICATION_TYPE_HVAC_HEATING_VALVE 0x0000002C |
| 75 | + #define BINARY_OUTPUT_APPLICATION_TYPE_HVAC_HUMIDIFIER 0x00000033 |
| 76 | + #define BINARY_OUTPUT_APPLICATION_TYPE_HVAC_PREHEAT 0x00000034 |
| 77 | + #define BINARY_OUTPUT_APPLICATION_TYPE_HVAC_OTHER 0x0000FFFF |
| 78 | + |
| 79 | +Security Application Types |
| 80 | +^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 81 | + |
| 82 | +.. code-block:: arduino |
| 83 | + |
| 84 | + #define BINARY_OUTPUT_APPLICATION_TYPE_SECURITY_ARM_DISARM_COMMAND 0x01000000 |
| 85 | + #define BINARY_OUTPUT_APPLICATION_TYPE_SECURITY_OCCUPANCY_CONTROL 0x01000001 |
| 86 | + #define BINARY_OUTPUT_APPLICATION_TYPE_SECURITY_ENABLE_CONTROL 0x01000002 |
| 87 | + #define BINARY_OUTPUT_APPLICATION_TYPE_SECURITY_ACCESS_CONTROL 0x01000003 |
| 88 | + #define BINARY_OUTPUT_APPLICATION_TYPE_SECURITY_OTHER 0x0100FFFF |
| 89 | + |
66 | 90 | API Methods
|
67 | 91 | ***********
|
68 | 92 |
|
@@ -127,11 +151,94 @@ Manually reports the current binary input value.
|
127 | 151 |
|
128 | 152 | This function will return ``true`` if successful, ``false`` otherwise.
|
129 | 153 |
|
| 154 | +addBinaryOutput |
| 155 | +^^^^^^^^^^^^^^^ |
| 156 | + |
| 157 | +Adds a binary output cluster to the endpoint. |
| 158 | + |
| 159 | +.. code-block:: arduino |
| 160 | + |
| 161 | + bool addBinaryOutput(); |
| 162 | + |
| 163 | +This function will return ``true`` if successful, ``false`` otherwise. |
| 164 | + |
| 165 | +setBinaryOutputApplication |
| 166 | +^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 167 | + |
| 168 | +Sets the application type for the binary output. |
| 169 | + |
| 170 | +.. code-block:: arduino |
| 171 | + |
| 172 | + bool setBinaryOutputApplication(uint32_t application_type); |
| 173 | + |
| 174 | +* ``application_type`` - Application type constant (see Binary Output Application Types above) |
| 175 | + |
| 176 | +This function will return ``true`` if successful, ``false`` otherwise. |
| 177 | + |
| 178 | +setBinaryOutputDescription |
| 179 | +^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 180 | + |
| 181 | +Sets a custom description for the binary output. |
| 182 | + |
| 183 | +.. code-block:: arduino |
| 184 | + |
| 185 | + bool setBinaryOutputDescription(const char *description); |
| 186 | + |
| 187 | +* ``description`` - Description string |
| 188 | + |
| 189 | +This function will return ``true`` if successful, ``false`` otherwise. |
| 190 | + |
| 191 | +onBinaryOutputChange |
| 192 | +^^^^^^^^^^^^^^^^^^^^^ |
| 193 | + |
| 194 | +Sets a callback function to be called when the binary output value changes. |
| 195 | + |
| 196 | +.. code-block:: arduino |
| 197 | + |
| 198 | + void onBinaryOutputChange(void (*callback)(bool binary_output)); |
| 199 | + |
| 200 | +* ``callback`` - Function pointer to callback that receives the new binary output value |
| 201 | + |
| 202 | +setBinaryOutput |
| 203 | +^^^^^^^^^^^^^^^ |
| 204 | + |
| 205 | +Sets the binary output value. |
| 206 | + |
| 207 | +.. code-block:: arduino |
| 208 | + |
| 209 | + bool setBinaryOutput(bool output); |
| 210 | + |
| 211 | +* ``output`` - Binary value (true/false) |
| 212 | + |
| 213 | +This function will return ``true`` if successful, ``false`` otherwise. |
| 214 | + |
| 215 | +getBinaryOutput |
| 216 | +^^^^^^^^^^^^^^^ |
| 217 | + |
| 218 | +Gets the current binary output value. |
| 219 | + |
| 220 | +.. code-block:: arduino |
| 221 | + |
| 222 | + bool getBinaryOutput(); |
| 223 | + |
| 224 | +This function returns the current binary output state. |
| 225 | + |
| 226 | +reportBinaryOutput |
| 227 | +^^^^^^^^^^^^^^^^^^ |
| 228 | + |
| 229 | +Manually reports the current binary output value. |
| 230 | + |
| 231 | +.. code-block:: arduino |
| 232 | + |
| 233 | + bool reportBinaryOutput(); |
| 234 | + |
| 235 | +This function will return ``true`` if successful, ``false`` otherwise. |
| 236 | + |
130 | 237 | Example
|
131 | 238 | -------
|
132 | 239 |
|
133 | | -Binary Input Implementation |
134 | | -**************************** |
| 240 | +Binary Input and Output Implementation |
| 241 | +************************************** |
135 | 242 |
|
136 | | -.. literalinclude:: ../../../libraries/Zigbee/examples/Zigbee_Binary_Input/Zigbee_Binary_Input.ino |
| 243 | +.. literalinclude:: ../../../libraries/Zigbee/examples/Zigbee_Binary_Input_Output/Zigbee_Binary_Input_Output.ino |
137 | 244 | :language: arduino
|
0 commit comments