docs/en/zigbee/ep_carbon_dioxide_sensor.rst
######################### ZigbeeCarbonDioxideSensor #########################
The ZigbeeCarbonDioxideSensor class provides a CO2 sensor endpoint for Zigbee networks. This endpoint implements the Zigbee Home Automation (HA) standard for carbon dioxide measurement devices.
Constructor
ZigbeeCarbonDioxideSensor ^^^^^^^^^^^^^^^^^^^^^^^^^
Creates a new Zigbee CO2 sensor endpoint.
.. code-block:: arduino
ZigbeeCarbonDioxideSensor(uint8_t endpoint);
endpoint - Endpoint number (1-254)API Methods
setCarbonDioxide ^^^^^^^^^^^^^^^^
Sets the CO2 concentration measurement value.
.. code-block:: arduino
bool setCarbonDioxide(float carbon_dioxide);
carbon_dioxide - CO2 concentration value in ppmThis function will return true if successful, false otherwise.
setMinMaxValue ^^^^^^^^^^^^^^
Sets the minimum and maximum measurement values.
.. code-block:: arduino
bool setMinMaxValue(float min, float max);
min - Minimum CO2 concentration value in ppmmax - Maximum CO2 concentration value in ppmThis function will return true if successful, false otherwise.
setDefaultValue ^^^^^^^^^^^^^^^
Sets the default (initial) value for the carbon dioxide sensor in ppm. This value will be used as the initial measured value when the device is in factory reset mode and before the sensor provides actual readings.
.. code-block:: arduino
bool setDefaultValue(float defaultValue);
defaultValue - Default CO2 concentration value in ppmImportant: Must be called before adding the EP to Zigbee class. Only effective when the device is in factory reset mode (before commissioning/joining a network).
This function will return true if successful, false otherwise.
setTolerance ^^^^^^^^^^^^
Sets the tolerance value for measurements.
.. code-block:: arduino
bool setTolerance(float tolerance);
tolerance - Tolerance value in ppmThis function will return true if successful, false otherwise.
setReporting ^^^^^^^^^^^^
Sets the reporting configuration for CO2 measurements.
.. code-block:: arduino
bool setReporting(uint16_t min_interval, uint16_t max_interval, uint16_t delta);
min_interval - Minimum reporting interval in secondsmax_interval - Maximum reporting interval in secondsdelta - Minimum change required to trigger a report in ppmNote: Delta reporting is currently not supported by the carbon dioxide sensor.
This function will return true if successful, false otherwise.
report ^^^^^^
Manually reports the current CO2 concentration value.
.. code-block:: arduino
bool report();
This function will return true if successful, false otherwise.
CO2 Sensor Implementation
.. literalinclude:: ../../../libraries/Zigbee/examples/Zigbee_CarbonDioxide_Sensor/Zigbee_CarbonDioxide_Sensor.ino :language: arduino