From 9ee05aa2946eab4ccf66d8a1eacf465b8ff6149f Mon Sep 17 00:00:00 2001 From: blakadder Date: Thu, 7 Nov 2019 11:06:51 +0100 Subject: [PATCH] new text, images and title change pending --- Sensor-Configuration.md | 108 +++++++++++----------------------------- 1 file changed, 29 insertions(+), 79 deletions(-) diff --git a/Sensor-Configuration.md b/Sensor-Configuration.md index 2df15648..3615c1bc 100644 --- a/Sensor-Configuration.md +++ b/Sensor-Configuration.md @@ -1,93 +1,43 @@ -Pre-work: -* [Device Configuration](https://github.com/arendst/Tasmota/wiki/Initial-Configuration) -* [How To Connect a Sensor](https://github.com/arendst/Tasmota/wiki/Expanding-Tasmota) +> Read before continuing: +>  - [Components](Components) +>  - [Expanding Tasmota](Expanding-Tasmota) -The software allows for easy configuration of sensors and devices to selected GPIO pins. Depending on the type of Template/Module, certain GPIO pins are user configurable. Sensor configuration is possible by either the WebUI or using the commands [`Template`](Commands#template), [`Module`](Commands#module) or [`GPIO`](Commands#gpio). +_**A peripheral must have correctly wired power, GND and data pins to the device prior to booting in order for Tasmota to detect it and initialize it properly.**_ -_**Note: A sensor must be connected to the device prior to booting the device in order for Tasmota to detect it and initialize it properly.**_ +## Configuration in Tasmota +Tasmota allows for easy selection of peripherals (sensors, switches, etc) and configuration to GPIO pins. -Tasmota supports: -- [Single wire sensors](#single-wire-sensor) -- [Dual wire or I2C sensors](#i2c-sensor) -- [Single wire devices](#device) +Configuration is possible in the webUI **Configure - Configure Module** page +or by using commands: [`Module`](Commands#module) and [`GPIO`](Commands#gpio), or [`Template`](Commands#template). -## Single wire sensor -The following single wire sensors are supported: -- DHT11 Temperature and Humidity - ``DHT11 (1)`` in group 1 -- DHT21 Temperature and Humidity - ``AM2301 (2)`` in group 1 -- AM2301 Temperature and Humidity - ``AM2301 (2)`` in group 1 -- DHT22 Temperature and Humidity - ``AM2301 (2)`` in group 1 -- AM2302 Temperature and Humidity - ``AM2301 (2)`` in group 1 -- AM2321 Temperature and Humidity - ``AM2301 (2)`` in group 1 -- Itead SI7021 Temperature and Humidity - ``SI7021 (3)`` in group 1 -- DS18B20 Temperature - ``DS18x20 (4)`` in group 2
Enable option ``USE_DS18x20`` in ``user_config_override.h`` for multiple sensors using OneWire library -- DS18S20 Temperature - ``DS18x20 (4)`` in group 2
Enable option ``USE_DS18x20`` in ``user_config_override.h`` using OneWire library -- External switch - ``Switch (9)``
Use [`SwitchMode`](Commands#switchmode) to tune its behaviour -- HC-SR501 PIR Motion Detection - ``Switch (9)``
Use [`SwitchMode`](Commands#switchmode) to tune its behaviour +#### [`Module`](Commands#module) +First select desired module for the device (Wait for the restart). Depending on the type of [Module](Modules), only certain GPIO pins are user configurable. Module Generic (18) has all the GPIOs configurable. -Note: With older releases DHT22, AM20302, and AM2321 sensors operated under ``AM2302 (3)``. They now operate under ``AM2301 (2)``. If you are using a DHT22 or similar and do not see ``AM2302 (3)`` use ``AM2301 (2)``. +_[`Modules`](Commands#modules) shows supported modules_ -You can add a sensor using the following commands: +#### [`GPIO`](Commands#gpio) +Assign a [component](Components) to a GPIO. + +- `gpio14 2` configures sensor AM2301 to GPIO14_ +- `Backlog gpio14 5; gpio4 6` sets I2C SCL to GPIO14 and I2C SDA to GPIO4 + Tasmota will auto-detect all connected and supported I2C devices. If you have conflicting I2C addresses see [I2CDevice](Commands#I2CDevice) -* [`Template`](Commands#template) - select desired template functionality for the device (Wait for the restart) -* [`Modules`](Commands#modules) - show supported modules -* [`Module`](Commands#module) - select desired module functionality for the device (Wait for the restart) -* [`Gpios`](Commands#gpios) - show supported sensor types. (e.g. DHT21 = AM2301) -* [`GPIO`](Commands#gpio) - show current defined sensors on supported GPIO pins or assign a GPIO function, - e.g., ``gpio14 2`` configures sensor AM2301 to GPIO14 (Wait for the restart) +_[`Gpios All`](Commands#gpios) shows list of all available components by name and index_ -For some sensors to show up you may need to cycle power to reset the device you just configured. +**For a peripheral to show up you may need to power cycle your device instead of a soft restart.** -## I2C sensor -The following I2C sensors are supported using I2C SCL (5) and I2C SDA (6) in group 3: +#### [`Template`](Commands#template) +Instead of using `Module` and `GPIO` you can define all using `Template` [Read more...](Templates#template-configuration-with-commands) - - - -- BH1750 Ambient Light Intensity -- DS3231 External RTC -- BMP180 Pressure and Temperature in group 3a -- BMP280 Pressure and Temperature in group 3a -- BME280 Pressure, Temperature and Humidity in group 3a -- HTU21 Temperature and Humidity in group 3b -- SI7013 Temperature and Humidity in group 3b -- SI7020 Temperature and Humidity in group 3b -- SI7021 Temperature and Humidity in group 3b -- SHT10 Temperature and Humidity in group 3c -- SHT11 Temperature and Humidity in group 3c -- SHT15 Temperature and Humidity in group 3c - -You can add I2C sensors using the following commands: - -* [`Template`](Commands#template) - select desired template functionality for the device (Wait for the restart) -* [`Modules`](Commands#modules) - show supported modules -* [`Module`](Commands#module) - select desired module functionality for the device (Wait for the restart) -* [`Gpios`](Commands#gpios) - show supported sensor types. We need two pins: I2C SCL (5) and I2C SDA (6) -* [`GPIO`](Commands#gpio) - show current defined sensors on supported GPIO pins or assign a GPIO function, - e.g., ``Backlog gpio14 5; gpio4 6`` - select I2C SCL and SDA respectively (Wait for the restart) - -The software will auto-detect the connected I2C devices. For some sensors to show up you may need to cycle power to reset the device just configured. - -## Device -The following additional device(s) are supported: -- WS2812/WS2813 led string - ``WS2812 (7)`` in group 4
Using NeoPixelBus library and external 5V power supply
[LED Effects](../issues/3480#issuecomment-515042427) -- IR Remote - ``IRremote (8)`` in group 5
Using IRremoteESP8266 library and additional IR led hardware as documented [here](https://github.com/altelch/SonoffIR) - -You can add a device using the following commands: - -* [`Template`](Commands#template) - select desired template functionality for the device (Wait for the restart) -* [`Modules`](Commands#modules) - show supported modules -* [`Module`](Commands#module) - select desired module functionality for the device (Wait for the restart) -* [`Gpios`](Commands#gpios) - show supported sensor types. We need WS2812 (7) -* [`GPIO`](Commands#gpio) - show current defined sensors on supported GPIO pins or assign a GPIO function, - e.g., ``gpio14 7`` - select WS2812 led string (Wait for the restart) - -For some sensors to show up you may need to cycle power to reset the device just configured. - -## Additional Configuration - -### Temperature Units - -The temperature units can be set to report in Celsius or Fahrenheit with the [`SetOption8`](Commands#setoption8) command: +## Additional Options +### Measurement Units +Temperature units can be set to Celsius or Fahrenheit with [`SetOption8`](Commands#setoption8) command. +Pressure units can be set to hPa or mmHg with [`SetOption24`](Commands#setoption24) command. ### Update Interval +To change the update interval (teleperiod) of MQTT messages change the [`TelePeriod`](Commands#teleperiod). Default interval is 300 seconds but can be set between 10 and 3600 seconds. +`TelePeriod 10` will set the update interval to 10 seconds, so the sensor will update 6 times a minute. -To change the update interval change the [`TelePeriod`](Commands#teleperiod). The default interval is 300 seconds. The interval can be set between 10 and 3600 seconds. `TelePeriod 10` will set the update interval to 10 seconds, so the sensor will update 6 times a minute. \ No newline at end of file +### Peripheral Specific +Some peripherals offer, or even require, additional commands. See [Commands](Commands#Sensor) page for peripheral specific commands.