esphome-docs/components/sensor/scd4x.rst
Martin 16e9425941
Document Scd4x environment compensation options (#1526)
* add documentation for modbus controller

* remove words from blacklist

* esp32 modbus controller

* doc update

* add epever cookbook

* fix merge failure

* documenting code changes

* updating examples

* remove offset

* fix formatting errors

* lint

* fix errors in links

* documenting modbus number and output

* updates with code changes

* fix indentation

* Improve doc

* Apply suggestions from code review

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

* Review suggestions part 2

* Fix Optional labels

* Rename files

* Fix index

* Fix doc links

* update scd4x to document new compensation options

* change indented to 4 spaces

* document changes after CR

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-10 08:27:39 +02:00

119 lines
3.9 KiB
ReStructuredText

SCD4X CO₂, Temperature and Relative Humidity Sensor
===================================================
.. seo::
:description: Instructions for setting up SCD4X CO₂ Temperature and Relative Humidity Sensor
:image: scd4x.jpg
The ``scd4x`` sensor platform allows you to use your Sensirion SCD4X CO₂
(`datasheet <https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/9.5_CO2/Sensirion_CO2_Sensors_SCD4x_Datasheet.pdf>`__) sensors with ESPHome.
The :ref:`I²C Bus <i2c>` is required to be set up in your configuration for this sensor to work.
.. figure:: images/scd4x.jpg
:align: center
:width: 80.0%
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: scd4x
co2:
name: "Workshop CO2"
temperature:
name: "Workshop Temperature"
humidity:
name: "Workshop Humidity"
Configuration variables:
------------------------
- **co2** (*Optional*): The information for the CO₂ sensor.
- **name** (**Required**, string): The name for the CO₂eq sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **temperature** (*Optional*): The information for the Temperature sensor.
- **name** (**Required**, string): The name for the temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **humidity** (*Optional*): The information for the Humidity sensor.
- **name** (**Required**, string): The name for the humidity sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **temperature_offset** (*Optional*, float): The temperature offset can depend
on various factors such as the SCD4x measurement mode, self-heating of close
components, the ambient temperature and air flow. This variable allows the
compensation of those effects by setting a temperature offset. Defaults to
``4°C``.
- **automatic_self_calibration** (*Optional*, boolean): Whether to enable
automatic self calibration (ASC). Defaults to ``true``.
- **ambient_pressure_compensation** (*Optional*, int): Enable compensation
of measured CO₂ values based on given ambient pressure in mBar.
- **altitude_compensation** (*Optional*, int): Enable compensating
deviations due to current altitude (in metres). Notice: setting
*altitude_compensation* is ignored if *ambient_pressure_compensation*
is set.
- **ambient_pressure_compensation_source** (*Optional*, :ref:`config-id`): Set an external pressure sensor ID used for ambient pressure compensation.
The pressure sensor must report pressure in hPa. the correction is applied before updating the state of the co2 sensor.
- **address** (*Optional*, int): Manually specify the I²C address of the sensor.
Defaults to ``0x62``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``.
Automation
-----------------
Ambient pressure compensation compensation can be changed from :ref:`lambdas <config-lambda>`
``set_ambient_pressure_compensation( <pressure in bar)"``
Example
*******
Note: that the pressure from bme280 is in hPa and must be converted to bar.
.. code-block:: yaml
sensor:
- platform: scd4x
id: scd41
i2c_id: bus_a
co2:
name: co2
id: co2
- platform: bme280
pressure:
name: "BME280-Pressure"
id: bme280_pressure
oversampling: 1x
on_value:
then:
- lambda: "id(scd41)->set_ambient_pressure_compensation(x / 1000.0);"
See Also
--------
- :ref:`sensor-filters`
- :doc:`scd30`
- :apiref:`scd4x/scd4x.h`
- :ghedit:`Edit`