|
| 1 | +############################### |
| 2 | +ZigbeeTemperatureDimmableLight |
| 3 | +############################### |
| 4 | + |
| 5 | +About |
| 6 | +----- |
| 7 | + |
| 8 | +The ``ZigbeeTemperatureDimmableLight`` class provides an endpoint for tunable white (temperature dimmable) lights in Zigbee networks. This endpoint implements the Zigbee Home Automation (HA) standard for color temperature lighting devices, supporting on/off, dimming, color temperature control, and scene management. |
| 9 | + |
| 10 | +**Features:** |
| 11 | +* On/off control |
| 12 | +* Brightness level control (0-100%) |
| 13 | +* Color temperature control (mireds) |
| 14 | +* Scene and group support |
| 15 | +* Automatic state restoration |
| 16 | +* Min/max color temperature configuration |
| 17 | +* Integration with common endpoint features (binding, OTA, etc.) |
| 18 | +* Zigbee HA standard compliance |
| 19 | + |
| 20 | +**Use Cases:** |
| 21 | +* Smart tunable white bulbs |
| 22 | +* Adjustable white LED panels |
| 23 | +* Human-centric lighting |
| 24 | +* Office and home white lighting |
| 25 | +* Smart home white ambiance lighting |
| 26 | + |
| 27 | +API Reference |
| 28 | +------------- |
| 29 | + |
| 30 | +Constructor |
| 31 | +*********** |
| 32 | + |
| 33 | +ZigbeeTemperatureDimmableLight |
| 34 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 35 | + |
| 36 | +Creates a new Zigbee temperature dimmable light endpoint. |
| 37 | + |
| 38 | +.. code-block:: arduino |
| 39 | +
|
| 40 | + ZigbeeTemperatureDimmableLight(uint8_t endpoint); |
| 41 | +
|
| 42 | +* ``endpoint`` - Endpoint number (1-254) |
| 43 | + |
| 44 | +Callback Functions |
| 45 | +****************** |
| 46 | + |
| 47 | +onLightChange |
| 48 | +^^^^^^^^^^^^^ |
| 49 | + |
| 50 | +Sets the callback function for light state changes. |
| 51 | + |
| 52 | +.. code-block:: arduino |
| 53 | +
|
| 54 | + void onLightChange(void (*callback)(bool, uint8_t, uint16_t)); |
| 55 | +
|
| 56 | +* ``callback`` - Function pointer to the light change callback (state, level, mireds) |
| 57 | + |
| 58 | +Control Methods |
| 59 | +*************** |
| 60 | + |
| 61 | +setLightState |
| 62 | +^^^^^^^^^^^^^ |
| 63 | + |
| 64 | +Sets the light on/off state. |
| 65 | + |
| 66 | +.. code-block:: arduino |
| 67 | +
|
| 68 | + bool setLightState(bool state); |
| 69 | +
|
| 70 | +* ``state`` - Light state (true = on, false = off) |
| 71 | + |
| 72 | +Returns ``true`` if successful, ``false`` otherwise. |
| 73 | + |
| 74 | +setLightLevel |
| 75 | +^^^^^^^^^^^^^ |
| 76 | + |
| 77 | +Sets the light brightness level. |
| 78 | + |
| 79 | +.. code-block:: arduino |
| 80 | +
|
| 81 | + bool setLightLevel(uint8_t level); |
| 82 | +
|
| 83 | +* ``level`` - Brightness level (0-255, where 0 is off, 255 is full brightness) |
| 84 | + |
| 85 | +Returns ``true`` if successful, ``false`` otherwise. |
| 86 | + |
| 87 | +setColorTemperature |
| 88 | +^^^^^^^^^^^^^^^^^^^ |
| 89 | + |
| 90 | +Sets the light color temperature (in mireds). |
| 91 | + |
| 92 | +.. code-block:: arduino |
| 93 | +
|
| 94 | + bool setColorTemperature(uint16_t mireds); |
| 95 | +
|
| 96 | +* ``mireds`` - Color temperature in mireds (153 = 6500K, 500 = 2000K) |
| 97 | + |
| 98 | +Returns ``true`` if successful, ``false`` otherwise. |
| 99 | + |
| 100 | +setLight |
| 101 | +^^^^^^^^ |
| 102 | + |
| 103 | +Sets all light parameters at once. |
| 104 | + |
| 105 | +.. code-block:: arduino |
| 106 | +
|
| 107 | + bool setLight(bool state, uint8_t level, uint16_t mireds); |
| 108 | +
|
| 109 | +* ``state`` - Light state (true/false) |
| 110 | +* ``level`` - Brightness level (0-255) |
| 111 | +* ``mireds`` - Color temperature in mireds |
| 112 | + |
| 113 | +Returns ``true`` if successful, ``false`` otherwise. |
| 114 | + |
| 115 | +setMinMaxTemperature |
| 116 | +^^^^^^^^^^^^^^^^^^^^ |
| 117 | + |
| 118 | +Sets the minimum and maximum allowed color temperature (in mireds). |
| 119 | + |
| 120 | +.. code-block:: arduino |
| 121 | +
|
| 122 | + bool setMinMaxTemperature(uint16_t min_temp, uint16_t max_temp); |
| 123 | +
|
| 124 | +* ``min_temp`` - Minimum color temperature in mireds (e.g., 153 for 6500K) |
| 125 | +* ``max_temp`` - Maximum color temperature in mireds (e.g., 500 for 2000K) |
| 126 | + |
| 127 | +Returns ``true`` if successful, ``false`` otherwise. |
| 128 | + |
| 129 | +State Retrieval Methods |
| 130 | +*********************** |
| 131 | + |
| 132 | +getLightState |
| 133 | +^^^^^^^^^^^^^ |
| 134 | + |
| 135 | +Gets the current light state. |
| 136 | + |
| 137 | +.. code-block:: arduino |
| 138 | +
|
| 139 | + bool getLightState(); |
| 140 | +
|
| 141 | +Returns current light state (true = on, false = off). |
| 142 | + |
| 143 | +getLightLevel |
| 144 | +^^^^^^^^^^^^^ |
| 145 | + |
| 146 | +Gets the current brightness level. |
| 147 | + |
| 148 | +.. code-block:: arduino |
| 149 | +
|
| 150 | + uint8_t getLightLevel(); |
| 151 | +
|
| 152 | +Returns current brightness level (0-255). |
| 153 | + |
| 154 | +getColorTemperature |
| 155 | +^^^^^^^^^^^^^^^^^^^ |
| 156 | + |
| 157 | +Gets the current color temperature (in mireds). |
| 158 | + |
| 159 | +.. code-block:: arduino |
| 160 | +
|
| 161 | + uint16_t getColorTemperature(); |
| 162 | +
|
| 163 | +Returns current color temperature in mireds. |
| 164 | + |
| 165 | +Utility Methods |
| 166 | +*************** |
| 167 | + |
| 168 | +restoreLight |
| 169 | +^^^^^^^^^^^^ |
| 170 | + |
| 171 | +Restores the light to its last known state. |
| 172 | + |
| 173 | +.. code-block:: arduino |
| 174 | +
|
| 175 | + void restoreLight(); |
| 176 | +
|
| 177 | +Example |
| 178 | +------- |
| 179 | + |
| 180 | +Temperature Dimmable Light Implementation |
| 181 | +***************************************** |
| 182 | + |
| 183 | +.. literalinclude:: ../../../libraries/Zigbee/examples/Zigbee_Temperature_Dimmable_Light/Zigbee_Temperature_Dimmable_Light.ino |
| 184 | + :language: arduino |
0 commit comments