Skip to content

Commit

Permalink
Merge pull request letscontrolit#2177 from Grovkillen/UpdateDocs
Browse files Browse the repository at this point in the history
[docs] P005 added to RTD
  • Loading branch information
TD-er authored Dec 19, 2018
2 parents 7d13571 + 6c83884 commit 17f403d
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 25 deletions.
6 changes: 3 additions & 3 deletions docs/source/Plugin/P003_TCR5000.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Indicators (recommended settings)
:header: "Indicator", "Value Name", "Interval", "Decimals", "Extra information"
:widths: 8, 5, 5, 5, 40

"Count", "MomentaryConsumption", "10", "0", "Using the formula ``%value%*3600/10`` to convert the pulse count into Watts.
"Count", "W", "10", "0", "Using the formula ``%value%*3600/10`` to convert the pulse count into Watts.
You might have to tweak the value to fit your application, our energy meter gives 1Wh per pulse and since
our interval was set to 10 seconds we have to first multiply the value with ``3600`` (3600 seconds per hour) and
also divide that value with ``10`` because we measure the Watt over a time period of 10 seconds (of that hour).
Expand All @@ -99,8 +99,8 @@ Rules examples

.. code-block:: html

On PowerMeter#MomentaryConsumption Do
If [PowerMeter#MomentaryConsumption]>1500
On PowerMeter#W Do
If [PowerMeter#W]>1500
NeoPixelAll,255,0,0 //using too much energy!
Else
NeoPixelAll,0,255,0 //good job, low energy consumption
Expand Down
79 changes: 63 additions & 16 deletions docs/source/Plugin/P005_DHT11_DHT22.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,98 @@ DHT11/DHT22
|P005_typename|
|P005_status|

.. image:: P005_DHT11_DHT22_1.jpg

Introduction
------------

DHT11 and its sibling DHT22 are temperature and humidity sensors which
using a custom 1-wire protocol. That means that they are not compatible with
the same 1-wire bus as standard 1-wire units.

Specifications:
* Temperature (-40 to +85C)
* Temperature (-40 to +85C)
* Humidity (0-100 % rel. humidity)


Wiring
------

The DHT sensor needs to be connected to a configurable GPIO on the ESP module.
In case you have a simple ESP-01 module, it's best to use the GPIO-2 pin.

.. code-block:: html
.. image:: P005_DHT11_DHT22_2.jpg

DHT11 (blue)

.. image:: P005_DHT11_DHT22_3.jpg

ESP S8
GPIO (X) <--> TX
GPIO (X) <--> RX
DHT22 (white)

.. code-block:: html

ESP DHT11/DHT22
GPIO (X) <--> Data (2nd pin)

Power
5.0V <--> VCC
GND <--> GND
5.0V <--> VCC (1st pin)
GND <--> GND (4th pin)

.. note:: Do not use GPIO 15 as an input for the DHT11/22. During startup of the
ESP8266, this pin must be ``LOW`` for proper operation. It is good to
avoid using GPIO 0 as an input as well. This pin must be ``HIGHT`` at
startup, unless program mode is required. The data pin of the DHT11/22
needs a pull-up resistor. A value of 4.7k - 10k proves to be sufficient.

Setup
-----

.. image:: P005_Setup_DHT11_DHT22_1.png

Task settings
~~~~~~~~~~~~~

Rules examples
--------------
* **Device**: Name of plugin
* **Name**: Name of the task (example name **DHT**)
* **Enable**: Should the task be enabled or not

.. code-block:: html
Sensor
^^^^^^

* **GPIO <--> Data**: Pulse input is generally set to **GPIO 14 (D5)**.
* **Sensor model**: Pick your **sensor model**, either DHT11 or DHT22.

//Code below...
.. note::

Data acquisition
^^^^^^^^^^^^^^^^

* **Send to controller** 1..3: Check which controller (if any) you want to publish to. All or no controller can be used.
* **Interval**: How often should the task publish its value (5..15 seconds is normal).


Indicators (recommended settings)
---------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. csv-table::
:header: "Indicator", "Value Name", "Interval", "Decimals", "Extra information"
:widths: 8, 5, 5, 5, 40

"XXXXXX", "N/A", "", "", ""
"Temperature", "Celsius", "10", "1", ""
"Humidity", "RH", "10", "1", ""

Rules examples
--------------

.. code-block:: html

On DHT#Celsius Do
If [DHT#Celsius]>-15
NeoPixelAll,255,0,0 //Red light
Else
NeoPixelAll,0,255,0 //Green light
EndIf
EndOn

Where to buy
------------
Expand All @@ -62,10 +107,12 @@ Where to buy
:header: "Store", "Link"
:widths: 5, 40

"AliExpress","`Link 1 ($) <http://s.click.aliexpress.com/e/cg1fhDDI>`_"
"AliExpress","`Link 1 ($) DHT11 <http://s.click.aliexpress.com/e/Rw9LhDW>`_ `Link 2 ($) DHT22 <http://s.click.aliexpress.com/e/bym03SW8>`_"
"Banggood","`Link 3 ($) DHT11 <https://www.banggood.com/KY-015-DHT11-Temperature-Humidity-Sensor-Module-For-Arduino-p-916173.html?p=V3270422659778201806>`_ `Link 4 ($) DHT22 <https://www.banggood.com/AM2302-DHT22-Temperature-And-Humidity-Sensor-Module-For-Arduino-SCM-p-937403.html?p=V3270422659778201806>`_"
"eBay","`Link 5 ($) DHT11 <https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338336929&mpre=https%3A%2F%2Fwww.ebay.com%2Fsch%2Fi.html%3F_from%3DR40%26_trksid%3Dm570.l1313%26_nkw%3DDHT11%26_sacat%3D0%26LH_TitleDesc%3D0%26_osacat%3D0%26_odkw%3DDHT11>`_ `Link 6 ($) DHT22 <https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338336929&mpre=https%3A%2F%2Fwww.ebay.com%2Fsch%2Fi.html%3F_from%3DR40%26_trksid%3Dm570.l1313%26_nkw%3DDHT22%26_sacat%3D0%26LH_TitleDesc%3D0%26_osacat%3D0%26_odkw%3DDHT22>`_"

|affiliate|


More pictures
-------------
.. More pictures
.. -------------
Binary file added docs/source/Plugin/P005_DHT11_DHT22_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/Plugin/P005_DHT11_DHT22_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/Plugin/P005_DHT11_DHT22_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/Plugin/P005_Setup_DHT11_DHT22_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/Plugin/_Plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Environment

Plugins: |Plugin_Environment|

Hardware: |P004_usedby|
Hardware: |P004_usedby|, |P005_usedby|

Extra IO
--------
Expand Down
6 changes: 3 additions & 3 deletions docs/source/Plugin/_plugin_substitutions_p00x.repl
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@

.. |P005_name| replace:: :cyan:`DHT11/12/22/SONOFF2301/7021`
.. |P005_type| replace:: :cyan:`Environment`
.. |P005_typename| replace:: :cyan:`Environment - DHT11/12/22/SONOFF2301/7021`
.. |P005_typename| replace:: :cyan:`Environment - DHT11/12/22 SONOFF2301/7021`
.. |P005_status| replace:: :green:`NORMAL`
.. |P005_github| replace:: P005_DHT.ino
.. _P005_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P005_DHT.ino
.. |P005_usedby| replace:: `.`
.. |P005_shortinfo| replace:: `.`
.. |P005_usedby| replace:: :ref:`P005_DHT11_DHT22_page`
.. |P005_shortinfo| replace:: Plugin used to communicate with DHT11/12/22/SONOFF2301/7021
.. |P005_maintainer| replace:: `.`
.. |P005_compileinfo| replace:: `.`

Expand Down
2 changes: 1 addition & 1 deletion docs/source/Plugin/_plugin_substitutions_p06x.repl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

.. |P064_name| replace:: :cyan:`APDS9960`
.. |P064_type| replace:: :cyan:`Gesture`
.. |P064_typename| replace:: :cyan:`Gestrure -APDS9960`
.. |P064_typename| replace:: :cyan:`Gestrure - APDS9960`
.. |P064_status| replace:: :red:`DEVELOPMENT`
.. |P064_github| replace:: P064_APDS9960.ino
.. _P064_github: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P064_APDS9960.ino
Expand Down
2 changes: 1 addition & 1 deletion src/_P005_DHT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ boolean Plugin_005(byte function, struct EventStruct *event, String& string)
const String options[] = { F("DHT 11"), F("DHT 22"), F("DHT 12"), F("Sonoff am2301"), F("Sonoff si7021") };
int indices[] = { P005_DHT11, P005_DHT22, P005_DHT12, P005_AM2301, P005_SI7021 };

addFormSelector(F("DHT Type"), F("p005_dhttype"), 5, options, indices, Settings.TaskDevicePluginConfig[event->TaskIndex][0] );
addFormSelector(F("Sensor model"), F("p005_dhttype"), 5, options, indices, Settings.TaskDevicePluginConfig[event->TaskIndex][0] );

success = true;
break;
Expand Down

0 comments on commit 17f403d

Please sign in to comment.