From 02007a12f2c32d49e35b824d4cb6b65c8f341bcf Mon Sep 17 00:00:00 2001 From: Martin <25747549+martgras@users.noreply.github.com> Date: Thu, 19 May 2022 02:47:37 +0200 Subject: [PATCH] Sgp4x (#2016) --- _redirects | 1 + components/sensor/sen5x.rst | 2 +- components/sensor/sgp40.rst | 72 ------------------------ components/sensor/sgp4x.rst | 109 ++++++++++++++++++++++++++++++++++++ cookbook/iaq_board.rst | 2 +- index.rst | 2 +- 6 files changed, 113 insertions(+), 75 deletions(-) delete mode 100644 components/sensor/sgp40.rst create mode 100644 components/sensor/sgp4x.rst diff --git a/_redirects b/_redirects index 991abd4e3..f6b61f081 100644 --- a/_redirects +++ b/_redirects @@ -2,3 +2,4 @@ # Moved components # e.g: /components/sensors/abc.html /components/sensors/xyz.html 301 +/components/sensor/sgp40.html /components/sensor/sgp4x.html 301 diff --git a/components/sensor/sen5x.rst b/components/sensor/sen5x.rst index dd7904003..3e4e398c3 100644 --- a/components/sensor/sen5x.rst +++ b/components/sensor/sen5x.rst @@ -213,6 +213,6 @@ See Also - :doc:`ccs811` - :doc:`scd4x` - :doc:`sps30` -- :doc:`sgp40` +- :doc:`sgp4x` - :apiref:`sen5x/sen5x.h` - :ghedit:`Edit` diff --git a/components/sensor/sgp40.rst b/components/sensor/sgp40.rst deleted file mode 100644 index e4ed76322..000000000 --- a/components/sensor/sgp40.rst +++ /dev/null @@ -1,72 +0,0 @@ -SGP40 Volatile Organic Compound Sensor -====================================== - -.. seo:: - :description: Instructions for setting up SGP40 Volatile Organic Compound sensor - :image: sgp40.jpg - -The ``sgp40`` sensor platform allows you to use your Sensirion SGP40 VOC sensor -(`datasheet `__) with ESPHome. -The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. - -.. note:: - - This sensor need to be driven at a rate of 1Hz. Because of this, the - sensor will be read out on device once a second separately from the - update_interval. The state will be reported to other components, or - the front end at the update_interval, saving wifi power and network - communication. - -.. figure:: images/sgp40.jpg - :align: center - :width: 80.0% - -.. code-block:: yaml - - # Example configuration entry - sensor: - - platform: sgp40 - name: "Workshop VOC" - -Configuration variables: ------------------------- - -- **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. -- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s`` -- **store_baseline** (*Optional*, boolean): Stores and retrieves the baseline information for quicker startups. Defaults to ``true`` - -- **compensation** (*Optional*): The block containing sensors used for compensation. If not set defaults will be used. - - - **temperature_source** (*Optional*, :ref:`config-id`): Give an external temperature sensor ID - here. This can improve the sensor's internal calculations. Defaults to ``25`` - - - **humidity_source** (*Optional*, :ref:`config-id`): Give an external humidity sensor ID - here. This can improve the sensor's internal calculations. Defaults to ``50`` - -- All other options from :ref:`Sensor `. - -Example With Compensation -------------------------- -.. code-block:: yaml - - # Example configuration entry - sensor: - - platform: sgp40 - name: "Workshop VOC" - update_interval: 5s - compensation: - humidity_source: dht1_hum - temperature_source: dht1_temp - -See Also --------- - -- :ref:`sensor-filters` -- :doc:`dht` -- :doc:`dht12` -- :doc:`hdc1080` -- :doc:`htu21d` -- :doc:`sht3xd` -- :apiref:`sgp40/sgp40.h` -- :ghedit:`Edit` diff --git a/components/sensor/sgp4x.rst b/components/sensor/sgp4x.rst new file mode 100644 index 000000000..404b3ae79 --- /dev/null +++ b/components/sensor/sgp4x.rst @@ -0,0 +1,109 @@ +SGP40 Volatile Organic Compound Sensor and SGP41 VOC and NOx Sensor +=================================================================== + +.. seo:: + :description: Instructions for setting up SGP40/SGP41 Volatile Organic Compound and NOx sensor + :image: sgp40.jpg + +The ``sgp4x`` sensor platform allows you to use your Sensirion SGP40 +(`datasheet `__) or SGP41 +(`datasheet `__) with ESPHome. +The type of sensor used is automatically detected. +The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. + +.. note:: + + This sensor need to be driven at a rate of 1Hz. Because of this, the + sensor will be read out on device once a second separately from the + update_interval. The state will be reported to other components, or + the front end at the update_interval, saving wifi power and network + communication. + +.. figure:: images/sgp40.jpg + :align: center + :width: 80.0% + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: sgp4x + voc: + name: "VOC Index" + nox: + name: "NOx Index" + + +Configuration variables: +------------------------ + +- **voc** (*Optional*): VOC Index + + - **name** (**Required**, string): The name of the sensor. + - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. + - **algorithm_tuning** (*Optional*): The VOC algorithm can be customized by tuning 6 different parameters. For more details see `Engineering Guidelines for SEN5x `__ + + - **index_offset** (*Optional*): VOC index representing typical (average) conditions. Allowed values are in range 1..250. The default value is 100. + - **learning_time_offset_hours** (*Optional*): Time constant to estimate the VOC algorithm offset from the history in hours. Past events will be forgotten after about twice the learning time. Allowed values are in range 1..1000. The default value is 12 hour + - **learning_time_gain_hours** (*Optional*): Time constant to estimate the VOC algorithm gain from the history in hours. Past events will be forgotten after about twice the learning time. Allowed values are in range 1..1000. The default value is 12 hours. + - **gating_max_duration_minutes** (*Optional*): Maximum duration of gating in minutes (freeze of estimator during high VOC index signal). Zero disables the gating. Allowed values are in range 0..3000. The default value is 180 minutes + - **std_initial** (*Optional*): Initial estimate for standard deviation. Lower value boosts events during initial learning period, but may result in larger device-todevice variations. Allowed values are in range 10..5000. The default value is 50. + - **gain_factor:** (*Optional*): Gain factor to amplify or to attenuate the VOC index output. Allowed values are in range 1..1000. The default value is 230. + + + - All other options from :ref:`Sensor `. + +- **nox** (*Optional*): NOx Index. Only available with SGP41. If a SGP40 sensor is detected this sensor will be ignored + + - **name** (**Required**, string): The name of the sensor. + - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. + - **algorithm_tuning** (*Optional*): The NOx algorithm can be customized by tuning 5 different parameters.For more details see `Engineering Guidelines for SEN5x `__ + + - **index_offset** (*Optional*): NOx index representing typical (average) conditions. Allowed values are in range 1..250. The default value is 100. + - **learning_time_offset_hours** (*Optional*): Time constant to estimate the NOx algorithm offset from the history in hours. Past events will be forgotten after about twice the learning time. Allowed values are in range 1..1000. The default value is 12 hour + - **learning_time_gain_hours** (*Optional*): Time constant to estimate the NOx algorithm gain from the history in hours. Past events will be forgotten after about twice the learning time. Allowed values are in range 1..1000. The default value is 12 hours. + - **gating_max_duration_minutes** (*Optional*): Maximum duration of gating in minutes (freeze of estimator during high NOx index signal). Zero disables the gating. Allowed values are in range 0..3000. The default value is 180 minutes + - **std_initial** (*Optional*): The initial estimate for standard deviation parameter has no impact for NOx. This parameter is still in place for consistency reasons with the VOC tuning parameters command. This parameter must always be set to 50. + - **gain_factor:** (*Optional*) + + - All other options from :ref:`Sensor `. + +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s`` +- **store_baseline** (*Optional*, boolean): Stores and retrieves the baseline information for quicker startups. Defaults to ``true`` + +- **compensation** (*Optional*): The block containing sensors used for compensation. If not set defaults will be used. + + - **temperature_source** (*Optional*, :ref:`config-id`): Give an external temperature sensor ID + here. This can improve the sensor's internal calculations. Defaults to ``25`` + + - **humidity_source** (*Optional*, :ref:`config-id`): Give an external humidity sensor ID + here. This can improve the sensor's internal calculations. Defaults to ``50`` + + +Example With Compensation +------------------------- +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: sgp4x + voc: + name: "VOC Index" + nox: + name: "NOx Index" + compensation: + humidity_source: dht1_hum + temperature_source: dht1_temp + +See Also +-------- + +- :ref:`sensor-filters` +- :doc:`dht` +- :doc:`dht12` +- :doc:`hdc1080` +- :doc:`htu21d` +- :doc:`sht3xd` +- :doc:`sht4x` +- :apiref:`sgp4x/sgp4x.h` +- :ghedit:`Edit` diff --git a/cookbook/iaq_board.rst b/cookbook/iaq_board.rst index cedaa11d1..53ae96af6 100644 --- a/cookbook/iaq_board.rst +++ b/cookbook/iaq_board.rst @@ -53,7 +53,7 @@ See Also - :doc:`/components/sensor/pmsx003` - :doc:`/components/sensor/mhz19` - :doc:`/components/sensor/sgp30` -- :doc:`/components/sensor/sgp40` +- :doc:`/components/sensor/sgp4x` - :doc:`/components/sensor/tsl2561` - :doc:`/components/binary_sensor/gpio` - :doc:`/components/sensor/template` diff --git a/index.rst b/index.rst index 3eaaabc10..21c9f0f9c 100644 --- a/index.rst +++ b/index.rst @@ -195,7 +195,7 @@ Air Quality SCD30, components/sensor/scd30, scd30.jpg, CO2 & Temperature & Humidity SCD4X, components/sensor/scd4x, scd4x.jpg, CO2 & Temperature & Humidity SGP30, components/sensor/sgp30, sgp30.jpg, CO2 & Volatile organics - SGP40, components/sensor/sgp40, sgp40.jpg, Volatile organics + SGP4x, components/sensor/sgp4x, sgp40.jpg, Volatile organics and NOx SM300D2, components/sensor/sm300d2, sm300d2.jpg, Air quality SPS30, components/sensor/sps30, sps30.jpg, Particulate T6613/15, components/sensor/t6615, t6615.jpg, CO2