mirror of https://github.com/arendst/Tasmota.git
peripheral edits
parent
14cbdbf10e
commit
5b6cb0e1aa
|
@ -14,10 +14,15 @@ Broadcom APDS-9960 is a digital RGB, ambient light, proximity and gesture sensor
|
||||||
|----------|-----------|
|
|----------|-----------|
|
||||||
| VCC/VIN | +3.3VDC |
|
| VCC/VIN | +3.3VDC |
|
||||||
| GND | GND |
|
| GND | GND |
|
||||||
| SCL | GPIO I<sup>2</sup>C SCL |
|
| SCL | GPIOy |
|
||||||
| SDA | GPIO I<sup>2</sup>C SDA |
|
| SDA | GPIOx |
|
||||||
| INT/IRQ | not used |
|
| INT/IRQ | not used |
|
||||||
|
|
||||||
|
### Tasmota Configuration
|
||||||
|
In the **Configuration -> Configure Module** page assign GPIOs:
|
||||||
|
1. GPIOx to `I2C SDA (6)`
|
||||||
|
2. GPIOy to `I2C SCL (5)`
|
||||||
|
|
||||||
After configuring the GPIO's the driver will detect the APDS-9960 automatically.
|
After configuring the GPIO's the driver will detect the APDS-9960 automatically.
|
||||||
On first boot sensor will start in gesture mode. It will not appear in the webUI but it can be observed via MQTT messages in console:
|
On first boot sensor will start in gesture mode. It will not appear in the webUI but it can be observed via MQTT messages in console:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
The BH1750 is a digital ambient light sensor module which uses I<sup>2</sup>C to communicate. The BH1750 provides you with a digital value in lux (Lx) over a range of 1 - 65535 lx. See [Digital 16bit Serial Output Type
|
||||||
|
Ambient Light Sensor IC](http://cpre.kmutnb.ac.th/esl/learning/bh1750-light-sensor/bh1750fvi-e_datasheet.pdf) for more information.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
### Wiring
|
||||||
|
| BH1750 | ESP8266 |
|
||||||
|
|---|---|
|
||||||
|
|GND |GND
|
||||||
|
|VCC |5V
|
||||||
|
|SDA | GPIOx
|
||||||
|
|SCL | GPIOy
|
||||||
|
|
||||||
|
### Tasmota
|
||||||
|
In the **Configuration -> Configure Module** page assign GPIOs:
|
||||||
|
1. GPIOx to `I2C SDA (6)`
|
||||||
|
2. GPIOy to `I2C SCL (5)`
|
||||||
|
|
||||||
|
After a reboot the driver will detect BH1750 automatically and display BH1750 Illuminance.
|
||||||
|
|
||||||
|
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos_bh1750_main_marked.jpg" width=300>
|
||||||
|
|
||||||
|
## Breakout Boards
|
||||||
|
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bh1750-light-intensity-sensor-front.jpg" width=225>
|
||||||
|
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bh1750-light-intensity-sensor-back.jpg" align=right width=225>
|
|
@ -0,0 +1,54 @@
|
||||||
|
BME280 sensor, an environmental sensor with temperature, barometric pressure and humidity" See [BME280 Temperature, Humidity and Pressure Sensor](https://www.adafruit.com/product/2652) for more information.
|
||||||
|
|
||||||
|
BME280 driver also supports [BMP085](https://learn.adafruit.com/bmp085), [BMP180](https://www.bosch-sensortec.com/bst/products/all_products/bmp180) and [BMP280](https://www.bosch-sensortec.com/bst/products/all_products/bmp280) sensors.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
### Wiring
|
||||||
|
|
||||||
|
| BME280 | ESP8266
|
||||||
|
| ---| ---
|
||||||
|
|GND | GND
|
||||||
|
|VCC | 3.3V
|
||||||
|
|SDA | GPIOx
|
||||||
|
|SCL | GPIOy
|
||||||
|
|
||||||
|
[Sonoff Basic wiring](Sonoff-Basic-and-BME280)
|
||||||
|
|
||||||
|
>If you are using breakout boards which break out pins CSB please ensure that you connect this pin to VCC to ensure that the chip stays in I<sup>2</sup>C mode. This is due to some manufacturers of breakout boards add pull-up resistors to allow for SPI compatibility (some would default to SPI, others to I<sup>2</sup>C)_
|
||||||
|
>
|
||||||
|
>Connect the SDO pin to GND or VCC to ensure required I<sup>2</sup>C address is used by the chip - Again some manufacturers add resistors to provide external bias but due to them wanting to retain SPI compatibility such pulldown resistors may not be sufficient to ensure that the pin levels are at the correct transition during power-up / reset state._
|
||||||
|
>
|
||||||
|
>Since the chip supports both SPI and I<sup>2</sup>C, but in Tasmota only I<sup>2</sup>C is supported you want to make sure that the chip is in I<sup>2</sup>C mode during reset/power-on and remain in that state during operation otherwise unexpected behaviour may result when the Tasmota firmware polls the chip for sensor data.
|
||||||
|
|
||||||
|
After a reboot the driver will detect BME280 automatically and display temperature, humidity and pressure measured.
|
||||||
|
|
||||||
|
![](https://user-images.githubusercontent.com/5904370/68090360-337c7780-fe73-11e9-95a0-1ec84fae8090.png)
|
||||||
|
|
||||||
|
Also sends an `tele/%topic%/SENSOR` JSON reponse:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"Time": "2019-11-03T19:34:28",
|
||||||
|
"BME280": {
|
||||||
|
"Temperature": 21.7,
|
||||||
|
"Humidity": 66.6,
|
||||||
|
"Pressure": 988.6
|
||||||
|
},
|
||||||
|
"PressureUnit": "hPa",
|
||||||
|
"TempUnit": "C"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*From v6.1.2.20 you can use multiple BMP Sensors ([#4195](../pull/4195))*
|
||||||
|
|
||||||
|
Limit is 2 sensors and you **have to** change the address of one sensor.
|
||||||
|
Than connect your sensor SCL and SDA parallel to the device.
|
||||||
|
|
||||||
|
<img src="https://user-images.githubusercontent.com/14855001/47621410-cd3e7580-daf7-11e8-91c4-a0db5bc87df5.png" width=300>
|
||||||
|
|
||||||
|
BME280 address change example:
|
||||||
|
<img title="bme280-2nd-address" src="https://user-images.githubusercontent.com/14855001/47621417-e3e4cc80-daf7-11e8-848b-aed744456fc0.png" width="150" height="auto">
|
||||||
|
|
||||||
|
### Breakout boards
|
||||||
|
![](https://raw.githubusercontent.com/arendst/arendst.github.io/master/media/wemos/bme280-adafruit-thp-sensor.jpg)
|
||||||
|
![](https://raw.githubusercontent.com/arendst/arendst.github.io/master/media/wemos/bme280-thp-sensor.png)
|
After Width: | Height: | Size: 2.8 KiB |
|
@ -0,0 +1,54 @@
|
||||||
|
**This feature is not included in precompiled binaries.** To use it you must [compile your build](compile-your-build). Add the following to `user_config_override.h`:
|
||||||
|
```
|
||||||
|
#ifndef USE_BME680
|
||||||
|
#define USE_BME680 // Enable support for BME680 sensor using Bosch BME680 library (+4k code)
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
----
|
||||||
|
BME680 sensor, an environmental sensor with temperature, humidity, barometric pressure and gas.
|
||||||
|
|
||||||
|
_The BME680 takes those sensors to the next step in that it contains a small MOX sensor. The heated metal oxide **changes resistance** based on the volatile organic compounds (VOC) in the air, so it can be used to detect gasses & alcohols such as Ethanol, Alcohol and Carbon Monoxide, and perform air quality measurements. Note it will give you one resistance value, with overall VOC content, but it cannot differentiate gasses or alcohols._
|
||||||
|
|
||||||
|
See [BME680 - Temperature, Humidity, Pressure and Gas Sensor](https://www.adafruit.com/product/3660) for more information.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
### Wiring
|
||||||
|
|
||||||
|
| BME680 | ESP8266 |
|
||||||
|
|---|---|
|
||||||
|
|GND |GND
|
||||||
|
|VCC |3.3V
|
||||||
|
|SDA |GPIOx
|
||||||
|
|SCL |GPIOy
|
||||||
|
|
||||||
|
### Tasmota
|
||||||
|
In the **Configuration -> Configure Module** page assign GPIOs:
|
||||||
|
1. GPIOx to `I2C SDA (6)`
|
||||||
|
2. GPIOy to `I2C SCL (5)`
|
||||||
|
|
||||||
|
After a reboot the driver will detect BME680 automatically and display temperature, humidity, pressure and gas measured by the BME680.
|
||||||
|
|
||||||
|
![](https://raw.githubusercontent.com/arendst/arendst.github.io/master/media/wemos/wemos-bme680-main-marked.jpg)
|
||||||
|
|
||||||
|
Also sends an `tele/%topic%/SENSOR` JSON reponse:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"Time": "2019-09-05T20:14:27",
|
||||||
|
"BME680": {
|
||||||
|
"Temperature": 28.0,
|
||||||
|
"Humidity": 38.8,
|
||||||
|
"Pressure": 1022.5,
|
||||||
|
"Gas": 5.08
|
||||||
|
},
|
||||||
|
"PressureUnit": "hPa",
|
||||||
|
"TempUnit": "C"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
## Breakout Boards
|
||||||
|
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bme680-gas-pressure-humidity-temperature-sensor.jpg" width=225>
|
||||||
|
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bme680-gas-pressure-humidity-temperature-sensor-adafruit.jpg" align=right width=275>
|
||||||
|
|
||||||
|
Buy from:
|
||||||
|
- [Adafruit](https://www.adafruit.com/product/3660)
|
||||||
|
- [AliExpress](https://aliexpress.com/item/CFsunbird-BME680-temperature-and-humidity-temperature-pressure-high-altitude-sensor/32852091387.html)
|
|
@ -320,17 +320,17 @@ Color\<x><a id="Color"></a>|`r,g,b` = set color by decimal value (`0..255`)<BR>`
|
||||||
||Set color to<BR>`1` = red<BR>`2` = green<BR>`3` = blue<BR>`4` = orange<BR>`5` = light green<BR>`6` = light blue<BR>`7` = amber<BR>`8` = cyan<BR>`9` = purple<BR>`10` = yellow<BR>`11` = pink<BR>`12` = white (using RGB channels)<BR>`+` = next color<BR>`-` = previous color
|
||Set color to<BR>`1` = red<BR>`2` = green<BR>`3` = blue<BR>`4` = orange<BR>`5` = light green<BR>`6` = light blue<BR>`7` = amber<BR>`8` = cyan<BR>`9` = purple<BR>`10` = yellow<BR>`11` = pink<BR>`12` = white (using RGB channels)<BR>`+` = next color<BR>`-` = previous color
|
||||||
CT<a id="CT"></a>|`153..500` = set color temperature from 153 (cold) to 500 (warm) for CT lights<BR>`+` = increase CT value by 10<BR>`-` = decrease CT value by 10
|
CT<a id="CT"></a>|`153..500` = set color temperature from 153 (cold) to 500 (warm) for CT lights<BR>`+` = increase CT value by 10<BR>`-` = decrease CT value by 10
|
||||||
Dimmer<a id="Dimmer"></a>|`0..100` = set dimmer value from 0 to 100%<BR>`+` = increase by 10<BR>`-` = decrease by 10
|
Dimmer<a id="Dimmer"></a>|`0..100` = set dimmer value from 0 to 100%<BR>`+` = increase by 10<BR>`-` = decrease by 10
|
||||||
Dimmer\<x>|**Commands available only when `SetOption37 > 128`** ([#6819](../pull/6819))  »7.0.0.1<br>`<value>` same as in `Dimmer`<br>`Dimmer0 <value>` - set dimming for all channels<BR>`Dimmer1 <value>` - set dimming for RGB channels<BR>`Dimmer2 <value>` - set dimming for white channels
|
Dimmer\<x>|**Commands available only when `SetOption37 >= 128`** ([#6819](../pull/6819))  »7.0.0.1<br>`<value>` same as in `Dimmer`<br>`Dimmer0 <value>` - set dimming for all channels<BR>`Dimmer1 <value>` - set dimming for RGB channels<BR>`Dimmer2 <value>` - set dimming for white channels
|
||||||
DimmerRange<a id="DimmerRange"></a>|Change dimming range  »6.6.0.18<br>`<dimmerMin>,<dimmerMax>` = set dimming range from minimum to maximum value ***Does not change [`Dimmer`](#dimmer) command behavior***<BR>*Works only with TuyaMCU and PS_16_DZ serial dimmers.*
|
DimmerRange<a id="DimmerRange"></a>|Change dimming range  »6.6.0.18<br>`<dimmerMin>,<dimmerMax>` = set dimming range from minimum to maximum value ***Does not change [`Dimmer`](#dimmer) command behavior***<BR>*Works only with TuyaMCU and PS_16_DZ serial dimmers.*
|
||||||
Fade<a id="Fade"></a>|`0` = do not use fade *(default)* <BR>`1` = use fade
|
Fade<a id="Fade"></a>|`0` = do not use fade *(default)* <BR>`1` = use fade
|
||||||
HsbColor<a id="HsbColor"></a>|`<hue>,<sat>,<bri>` = set color by hue, saturation and brightness
|
HsbColor<a id="HsbColor"></a>|`<hue>,<sat>,<bri>` = set color by hue, saturation and brightness
|
||||||
HsbColor1<a id="HsbColor1"></a>|`0..360` = set hue
|
HsbColor1<a id="HsbColor1"></a>|`0..360` = set hue
|
||||||
HsbColor2<a id="HsbColor2"></a>|`0..100` = set saturation
|
HsbColor2<a id="HsbColor2"></a>|`0..100` = set saturation
|
||||||
HsbColor3<a id="HsbColor3"></a>|`0..100` = set brightness
|
HsbColor3<a id="HsbColor3"></a>|`0..100` = set brightness
|
||||||
Led\<x\><a id="Led"></a>|`#RRGGBB` = set Led\<x\> hex color value where `<x>` is the pixel number *(aplies only to addressable LEDs)*
|
Led\<x\><a id="Led"></a>|`#RRGGBB` = set hex color value where `<x>` is the pixel number of the LED<br> *(aplies only to addressable LEDs)*
|
||||||
LedTable<a id="LedTable"></a>|`0` = do not use [LED gamma correction](https://learn.adafruit.com/led-tricks-gamma-correction?view=all) *(default prior to 6.5.0.9)*<BR>`1` = use gamma correction *(default)*
|
LedTable<a id="LedTable"></a>|`0` = do not use [LED gamma correction](https://learn.adafruit.com/led-tricks-gamma-correction?view=all) *(default «6.5.0.9)*<BR>`1` = use gamma correction *(default »6.5.0.9)*
|
||||||
Pixels<a id="Pixels"></a>|`1..512` = set amount of pixels in strip or ring and reset [`Rotation`](#rotation) *(applies only to addressable LEDs)*
|
Pixels<a id="Pixels"></a>|`1..512` = set amount of pixels in strip or ring and reset [`Rotation`](#rotation) *(applies only to addressable LEDs)*
|
||||||
RGBWWTable<a id="RGBWWTable"></a>|Control compensation of unbalanced PWM channels or [White Blend Mode](White-Blend-Mode)   »6.2.1.10<br>`PWM1,PWM2,PWM3,PWM4,PWM5` = channel range where: `PWM<x>` = `0..255`.<br>*(default =`255,255,255,255,255`)*<BR>Range adjustment is computed **after** Gamma correction.<BR>_Example:_<BR> `RGBWWTable 64,64,64,64,64` limits maximum power to 25% for all 5 channels.
|
RGBWWTable<a id="RGBWWTable"></a>|Control compensation of unbalanced PWM channels or [White Blend Mode](White-Blend-Mode)   »6.2.1.10<br>`PWM1,PWM2,PWM3,PWM4,PWM5` = channel range with values `0..255` *(default =`255,255,255,255,255`)*<BR>Range adjustment is computed **after** Gamma correction.
|
||||||
Rotation<a id="Rotation"></a>|`<value>` = set amount of pixels to rotate (up to `Pixels` value) *(applies only to addressable LEDs)*
|
Rotation<a id="Rotation"></a>|`<value>` = set amount of pixels to rotate (up to `Pixels` value) *(applies only to addressable LEDs)*
|
||||||
Scheme<a id="Scheme"></a>|Light effects<BR>`+` = next scheme<BR>`-` = previous scheme<BR>`0` = single color for LED light *(default)*<BR>`1` = start wake up sequence (same as [`Wakeup`](#wakeup))<BR>`2` = cycle up through colors using Speed option<BR>`3` = cycle down through colors using Speed option<BR>`4` = random cycle through colors using Speed and Fade
|
Scheme<a id="Scheme"></a>|Light effects<BR>`+` = next scheme<BR>`-` = previous scheme<BR>`0` = single color for LED light *(default)*<BR>`1` = start wake up sequence (same as [`Wakeup`](#wakeup))<BR>`2` = cycle up through colors using Speed option<BR>`3` = cycle down through colors using Speed option<BR>`4` = random cycle through colors using Speed and Fade
|
||||||
||**The following schemes are usable only with addressable LEDs, e.g. WS281X, Neopixel**<BR>`5` = clock mode ([example](https://hackaday.io/project/28194-esp-and-ws2812-based-clock))<BR>`6` = candlelight pattern<BR>`7` = RGB pattern<BR>`8` = Christmas pattern<BR>`9` = Hannukah pattern<BR>`10` = Kwanzaa pattern<BR>`11` = rainbow pattern<BR>`12` = fire pattern
|
||**The following schemes are usable only with addressable LEDs, e.g. WS281X, Neopixel**<BR>`5` = clock mode ([example](https://hackaday.io/project/28194-esp-and-ws2812-based-clock))<BR>`6` = candlelight pattern<BR>`7` = RGB pattern<BR>`8` = Christmas pattern<BR>`9` = Hannukah pattern<BR>`10` = Kwanzaa pattern<BR>`11` = rainbow pattern<BR>`12` = fire pattern
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
## DS3231 - External RTC (I<sup>2</sup>C)
|
|
||||||
|
|
||||||
Tasmota requires that its time be set in order to use timers. Usually, when the device boots, it gets the time and date from an an NTP (Network Time Protocol) server located somewhere on the Internet. When there is no Internet connection, Tasmota is not able to request the current date and time. The DS3231 is an external Real Time Clock (RTC) component used for keeping the time and date set in the device when it cannot establish an Internet connection.
|
|
||||||
|
|
||||||
### How to use:
|
|
||||||
_Note: before the DS3231 can be used with Tasmota, make sure it's software driver is activated. To do so, the `USE_DS3231` compiler directive must be defined in `user_config_override.h`._
|
|
||||||
|
|
||||||
```
|
|
||||||
#define USE_DS3231 // Enable use DS3231 external RTC , useful when you don't have available Internet. See docs in the source file (+1k2 code)
|
|
||||||
```
|
|
||||||
|
|
||||||
If you use a DS3231 with a different I<sup>2</sup>C address, also include this compiler directive:
|
|
||||||
```
|
|
||||||
// #define USE_RTC_ADDR 0x68 //you can change the address to the DS3231 RTC address, default is 0x68
|
|
||||||
```
|
|
||||||
|
|
||||||
Once you have specified these compiler directives, compile the firmware and flash the resulting binary on your device. Follow the flashing steps outlined in the wiki.
|
|
||||||
|
|
||||||
### Connecting the DS3231 to a Wemos Mini D1
|
|
||||||
|
|
||||||
| Wemos | DS3231 |
|
|
||||||
|---|---|
|
|
||||||
|GND |GND |
|
|
||||||
|3.3V |VCC |
|
|
||||||
|D2 (GPIO04) |SDA |
|
|
||||||
|D1 (GPIO05) |SCL |
|
|
||||||
|
|
||||||
### Tasmota Configuration
|
|
||||||
In the Configuration -> Configure Module page, select the following:
|
|
||||||
1. **Module Type : 18 Generic**
|
|
||||||
2. **D2 GPIO04 : 06 I2C SDA**
|
|
||||||
3. **D1 GPIO05 : 05 I2C SCL**
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos_tsl2561_config_marked.jpg" width=300>
|
|
||||||
|
|
||||||
### Testing
|
|
||||||
|
|
||||||
Any time your device has an NTP connection, the DS3231 internal clock will be set automatically. _**The first time the RTC is used, you must to have an Internet connection**_. You can use your mobile phone hotspot boot your device in a location where it can get a Wi-Fi connection. From that point forward, the time is stored in the RTC and the device time will be restored from the RTC when there is no Internet connection.
|
|
||||||
|
|
||||||
Check that the time is set correctly by inspecting the log in the Console. You should see messages that Tasmota read or wrote the time from and to the DS3231. Make sure that the time is set correctly _even when you not have Internet connection_.
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
**This feature is not included in precompiled binaries.** To use it you must [compile your build](compile-your-build). Add the following to `user_config_override.h`:
|
||||||
|
```
|
||||||
|
#ifndef USE_DS3231
|
||||||
|
#define USE_DS3231 // Enable DS3231 external RTC in case no Wifi is avaliable. See docs in the source file (+1k2 code)
|
||||||
|
// #define USE_RTC_ADDR 0x68 // Default I2C address 0x68#endif
|
||||||
|
```
|
||||||
|
If you use a DS3231 with a different I<sup>2</sup>C address, uncomment and change to your address:
|
||||||
|
```
|
||||||
|
#define USE_RTC_ADDR 0x68
|
||||||
|
```
|
||||||
|
----
|
||||||
|
|
||||||
|
Tasmota requires that its time be set in order to use timers. Usually, when the device boots, it gets the time and date from an an NTP (Network Time Protocol) server located somewhere on the Internet. When there is no Internet connection, Tasmota is not able to request the current date and time. The DS3231 is an external Real Time Clock (RTC) component used for keeping the time and date set in the device when it cannot establish an Internet connection.
|
||||||
|
|
||||||
|
##Configuration
|
||||||
|
### Wiring
|
||||||
|
|
||||||
|
| DS3231 | ESP8266 |
|
||||||
|
|---|---|
|
||||||
|
|GND |GND |
|
||||||
|
|VCC |3.3V |
|
||||||
|
|SDA | GPIOx
|
||||||
|
|SCL | GPIOy
|
||||||
|
|
||||||
|
### Tasmota Configuration
|
||||||
|
### Tasmota
|
||||||
|
In the **Configuration -> Configure Module** page assign GPIOs:
|
||||||
|
1. GPIOx to `I2C SDA (6)`
|
||||||
|
2. GPIOy to `I2C SCL (5)`
|
||||||
|
|
||||||
|
Wiring on Wemos D1 mini
|
||||||
|
|
||||||
|
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos_tsl2561_config_marked.jpg" width=300>
|
||||||
|
|
||||||
|
### Tasmota
|
||||||
|
|
||||||
|
Any time your device has an NTP connection, the DS3231 internal clock will be set automatically. **The first time RTC is used, you must have an Internet connection**. From that point forward, the time is stored in the RTC and the device time will be restored from the RTC when there is no Internet connection.
|
||||||
|
>(You can use your mobile phone hotspot for your device in a location where it can't get a Wi-Fi connection
|
||||||
|
|
||||||
|
Check that the time is set correctly by inspecting the log in the Console. You should see messages that Tasmota read or wrote the time from and to the DS3231. Make sure that the time is set correctly **even when you do not have Internet connection**.
|
|
@ -39,75 +39,13 @@ A more [advanced example](Rule-Cookbook#Auto-off-Motion-Sense-Switch) of rules w
|
||||||
Pin marked VOUT is connected to a free GPIO pin on the device.
|
Pin marked VOUT is connected to a free GPIO pin on the device.
|
||||||
|
|
||||||
|
|
||||||
### First use case
|
|
||||||
|
|
||||||
Turning on the device after detecting a movement and turning off after 30 seconds. This rule can be used for hallway lights.
|
|
||||||
|
|
||||||
This PIR goes to off state after a few seconds so we need to use this rule *instead* of the one in the example.
|
This PIR goes to off state after a few seconds so we need to use this rule *instead* of the one in the example.
|
||||||
```
|
```
|
||||||
Rule1 on switch1#state=1 do backlog publish stat/%topic%/PIR1 ON; RuleTimer1 30 endon on Rules#Timer=1 do publish stat/%topic%/PIR1 OFF endon
|
Rule1 on switch1#state=1 do backlog publish stat/%topic%/PIR1 ON; RuleTimer1 30 endon on Rules#Timer=1 do publish stat/%topic%/PIR1 OFF endon
|
||||||
```
|
```
|
||||||
With this it will stay ON for 30 seconds then send OFF message and the timer restarts every time there's an ON trigger.
|
With this it will stay ON for 30 seconds then send OFF message and the timer restarts every time there's an ON trigger.
|
||||||
|
|
||||||
|
Another use case as a [hand wave switch](Project-AM312-and-Sonoff-R2).
|
||||||
### Second use case
|
|
||||||
|
|
||||||
This use case represents a method to use AM312 as a "wave hand toggle" (for under-cabinet kitchen LED). Please note that this solution isn't working in 100% (this sensor has a detection range of a few meters, to decrease the range you can remove the lens from the sensor but still it will pick up movement from 50 cm. You can create the Tasmota rule that will disable AM312 toggle action when the light is on and turn off the power after a few minutes. The gesture sensor [APDS-9960](https://github.com/arendst/Tasmota/wiki/APDS-9960) should work better for "hand-wave" toggle.
|
|
||||||
|
|
||||||
|
|
||||||
#### Wiring for Sonoff Basic R2
|
|
||||||
|
|
||||||
As the R2 version doesn't have GPIO14 exposed you can use [GPIO3 (RX)](https://www.youtube.com/watch?v=yavDqDzRdUk) as the AM312 data pin. GPIO2 goes high during the boot (it would toggle the switch then).
|
|
||||||
|
|
||||||
|AM312 | ESP8255 device |
|
|
||||||
|-----------:|:-------------------|
|
|
||||||
| VCC | 3V3 or VCC |
|
|
||||||
| VOUT | GPIO3 (RX) |
|
|
||||||
| GND | GND |
|
|
||||||
|
|
||||||
Remember to remove the lens to lower the sensitivity of the sensor.
|
|
||||||
|
|
||||||
#### Configuration the module
|
|
||||||
|
|
||||||
1. Go to IP of the device, next _Configuration --> Configure Module -->_ set "GPIO3 Serial In" to "Switch1 (9)"
|
|
||||||
2. Go to _Console_ and type _"[SwitchMode 4](https://github.com/arendst/Tasmota/wiki/Commands#switchmode)"_ ([detailed description of SwitchModes](https://github.com/arendst/Tasmota/wiki/Buttons-and-switches#switchmode)) to enable toggle switch type.
|
|
||||||
3. Set rule to turn off light after X amount of seconds (mentioned workaround):
|
|
||||||
```
|
|
||||||
rule1 on Switch1#State=2 do backlog Power1 1; RuleTimer1 180 endon on Rules#Timer=1 do backlog Power1 0 endon
|
|
||||||
rule1 1
|
|
||||||
```
|
|
||||||
|
|
||||||
Rule explanation:
|
|
||||||
``Switch1#State=2`` - fire the event when switch1 is toggled,
|
|
||||||
``Power1 1`` - turn on power,
|
|
||||||
``RuleTimer1 180`` - set Timer1 to 180 seconds and start counting,
|
|
||||||
``Rules#Timer=1`` - fire the event when Timer1 has stopped,
|
|
||||||
``Power1 0`` - turn off power.
|
|
||||||
|
|
||||||
This rule will turn off the light after 3 minutes, if the movement will be detected prior, the timer will be restarted and will count the time from the beginning.
|
|
||||||
|
|
||||||
4. Instead of point 3, you can set below rules in order to ignore the second and next movements. It will just turn off the power after 3 minutes.
|
|
||||||
```
|
|
||||||
rule1 on Switch1#State=2 do backlog Power1 1; RuleTimer1 180; Rule1 0; Rule2 1 endon
|
|
||||||
rule2 on Rules#Timer=1 do backlog Power1 0; Rule1 1; Rule2 0 endon on Switch1#State=2 do break
|
|
||||||
backlog rule1 1; rule2 0
|
|
||||||
```
|
|
||||||
|
|
||||||
Rules explanation:
|
|
||||||
``rule1 on Switch1#State=2 do backlog Power1 1; RuleTimer1 180; Rule1 0; Rule2 1 endon``:
|
|
||||||
``Switch1#State=2`` - fire the event when switch1 is toggled,
|
|
||||||
``Power1 1`` - turn on power,
|
|
||||||
``RuleTimer1 180`` - set Timer1 to 180 seconds and start counting,
|
|
||||||
``Rule1 0`` - disable Rule1,
|
|
||||||
``Rule2 1`` - enable Rule2.
|
|
||||||
|
|
||||||
``rule2 on Rules#Timer=1 do backlog Power1 0; Rule1 1; Rule2 0 endon on Switch1#State=2 do break``:
|
|
||||||
``Rules#Timer=1`` - fire the event when Timer1 has stopped
|
|
||||||
``Power1 0`` - turn off power
|
|
||||||
``Rule1 1`` - enable Rule1
|
|
||||||
``Rule2 0`` - disable Rule2
|
|
||||||
``Switch1#State=2 do break`` - ignore toggling
|
|
||||||
|
|
||||||
|
|
||||||
## HC-SR501
|
## HC-SR501
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@ More about [general configuration](Sensor-Configuration).
|
||||||
- [**AM312**](PIR-Motion-Sensors#AM312) - PIR Motion Sensor<img src="https://i.postimg.cc/qRLyPy1n/APDS-9960-1-720x533.jpg" align=right>
|
- [**AM312**](PIR-Motion-Sensors#AM312) - PIR Motion Sensor<img src="https://i.postimg.cc/qRLyPy1n/APDS-9960-1-720x533.jpg" align=right>
|
||||||
- [**APDS-9960**](APDS-9960) - Ambient Light, RGB Color and Proximity Sensor with Gesture Detection
|
- [**APDS-9960**](APDS-9960) - Ambient Light, RGB Color and Proximity Sensor with Gesture Detection
|
||||||
- [**AZ-7798**](Wemos-D1-Mini-and-AZ-Instrument-7798-CO2-Meter-Datalogger) - CO<sub>2</sub> Meter Datalogger
|
- [**AZ-7798**](Wemos-D1-Mini-and-AZ-Instrument-7798-CO2-Meter-Datalogger) - CO<sub>2</sub> Meter Datalogger
|
||||||
- [**BH1750**](Wemos-D1-Mini-and-BH1750-Luminosity-Sensor) - Luminosity Sensor
|
- [**BH1750**](BH1750) - Luminosity Sensor
|
||||||
- [**BME280 (BMP085, BMP180, BMP280, BME280)**](Wemos-D1-Mini-and-BME280-Temperature,-Humidity-and-Pressure-Sensor) - Temperature, Humidity and Pressure Sensor
|
- [**BMP280 (BMP085, BMP180)**](BME280) - Pressure Sensor
|
||||||
- [Sonoff Basic Wiring](BME280-Temperature,-Humidity-and-Pressure-Sensor-and-Sonoff-Basic-with-Tasmota)
|
- [**BME280**](BME280) - Temperature, Humidity and Pressure Sensor
|
||||||
- [**BME680**](Wemos-D1-Mini-and-BME680-Temperature,-Humidity,-Pressure-and-Gas-Sensor) - Temperature, Humidity, Pressure and Gas Sensor
|
- [**BME680**](BME680) - Temperature, Humidity, Pressure and Gas Sensor
|
||||||
- [**Buzzer**](Buzzer) - Audio Signalling Device
|
- [**Buzzer**](Buzzer) - Audio Signalling Device
|
||||||
- [**CC2530**](Zigbee) - Zigbee Adapter (Serial)
|
- [**CC2530**](Zigbee) - Zigbee Adapter (Serial)
|
||||||
- **CCS811** - Gas and Air Quality sensor (I<sup>2</sup>C)
|
- **CCS811** - Gas and Air Quality sensor (I<sup>2</sup>C)
|
||||||
|
@ -21,7 +21,7 @@ More about [general configuration](Sensor-Configuration).
|
||||||
- [Sonoff Basic wiring](DHT11-Wiring---Sonoff-Basic)
|
- [Sonoff Basic wiring](DHT11-Wiring---Sonoff-Basic)
|
||||||
- [**DHT22 (DHT21, AM2301, AM2302, AM2321)**](Wemos-D1-Mini-and-DHT22-(DHT21,-AM2301,-AM2302,-AM2321)-Shield-Humidity-&-Temperature) - Humidity & Temperature Sensor
|
- [**DHT22 (DHT21, AM2301, AM2302, AM2321)**](Wemos-D1-Mini-and-DHT22-(DHT21,-AM2301,-AM2302,-AM2321)-Shield-Humidity-&-Temperature) - Humidity & Temperature Sensor
|
||||||
- **DS18x20** - Temperature sensor (GPIO)
|
- **DS18x20** - Temperature sensor (GPIO)
|
||||||
- [**DS3231**](DS3231---External-RTC) - Real-Time-Clock (I<sup>2</sup>C)
|
- [**DS3231**](DS3231) - Real-Time-Clock (I<sup>2</sup>C)
|
||||||
- [**HM16/HM17**](iBeacon-driver) - Bluetooth iBeacon reader (Serial)
|
- [**HM16/HM17**](iBeacon-driver) - Bluetooth iBeacon reader (Serial)
|
||||||
- **HR-E** - Water Meter Encoder interface (Serial)
|
- **HR-E** - Water Meter Encoder interface (Serial)
|
||||||
- [**HC-SR04 (SR04+, SR04T)**](Wemos-D1-Mini-and-HC-SR04-Ultrasonic-Sensor) - Ultrasonic Sensor
|
- [**HC-SR04 (SR04+, SR04T)**](Wemos-D1-Mini-and-HC-SR04-Ultrasonic-Sensor) - Ultrasonic Sensor
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
This use case represents a method to use AM312 as a "wave hand toggle" (for under-cabinet kitchen LED). Please note that this solution isn't working in 100% (this sensor has a detection range of a few meters, to decrease the range you can remove the lens from the sensor but still it will pick up movement from 50 cm. You can create the Tasmota rule that will disable AM312 toggle action when the light is on and turn off the power after a few minutes. The gesture sensor [APDS-9960](https://github.com/arendst/Tasmota/wiki/APDS-9960) should work better for "hand-wave" toggle.
|
||||||
|
|
||||||
|
|
||||||
|
#### Wiring for Sonoff Basic R2
|
||||||
|
|
||||||
|
As the R2 version doesn't have GPIO14 exposed you can use [GPIO3 (RX)](https://www.youtube.com/watch?v=yavDqDzRdUk) as the AM312 data pin. GPIO2 goes high during the boot (it would toggle the switch then).
|
||||||
|
|
||||||
|
|AM312 | ESP8255 device |
|
||||||
|
|-----------:|:-------------------|
|
||||||
|
| VCC | 3V3 or VCC |
|
||||||
|
| VOUT | GPIO3 (RX) |
|
||||||
|
| GND | GND |
|
||||||
|
|
||||||
|
Remember to remove the lens to lower the sensitivity of the sensor.
|
||||||
|
|
||||||
|
#### Configuration the module
|
||||||
|
|
||||||
|
1. Go to IP of the device, next _Configuration --> Configure Module -->_ set "GPIO3 Serial In" to "Switch1 (9)"
|
||||||
|
2. Go to _Console_ and type _"[SwitchMode 4](https://github.com/arendst/Tasmota/wiki/Commands#switchmode)"_ ([detailed description of SwitchModes](https://github.com/arendst/Tasmota/wiki/Buttons-and-switches#switchmode)) to enable toggle switch type.
|
||||||
|
3. Set rule to turn off light after X amount of seconds (mentioned workaround):
|
||||||
|
```
|
||||||
|
rule1 on Switch1#State=2 do backlog Power1 1; RuleTimer1 180 endon on Rules#Timer=1 do backlog Power1 0 endon
|
||||||
|
rule1 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Rule explanation:
|
||||||
|
``Switch1#State=2`` - fire the event when switch1 is toggled,
|
||||||
|
``Power1 1`` - turn on power,
|
||||||
|
``RuleTimer1 180`` - set Timer1 to 180 seconds and start counting,
|
||||||
|
``Rules#Timer=1`` - fire the event when Timer1 has stopped,
|
||||||
|
``Power1 0`` - turn off power.
|
||||||
|
|
||||||
|
This rule will turn off the light after 3 minutes, if the movement will be detected prior, the timer will be restarted and will count the time from the beginning.
|
||||||
|
|
||||||
|
4. Instead of point 3, you can set below rules in order to ignore the second and next movements. It will just turn off the power after 3 minutes.
|
||||||
|
```
|
||||||
|
rule1 on Switch1#State=2 do backlog Power1 1; RuleTimer1 180; Rule1 0; Rule2 1 endon
|
||||||
|
rule2 on Rules#Timer=1 do backlog Power1 0; Rule1 1; Rule2 0 endon on Switch1#State=2 do break
|
||||||
|
backlog rule1 1; rule2 0
|
||||||
|
```
|
||||||
|
|
||||||
|
Rules explanation:
|
||||||
|
``rule1 on Switch1#State=2 do backlog Power1 1; RuleTimer1 180; Rule1 0; Rule2 1 endon``:
|
||||||
|
``Switch1#State=2`` - fire the event when switch1 is toggled,
|
||||||
|
``Power1 1`` - turn on power,
|
||||||
|
``RuleTimer1 180`` - set Timer1 to 180 seconds and start counting,
|
||||||
|
``Rule1 0`` - disable Rule1,
|
||||||
|
``Rule2 1`` - enable Rule2.
|
||||||
|
|
||||||
|
``rule2 on Rules#Timer=1 do backlog Power1 0; Rule1 1; Rule2 0 endon on Switch1#State=2 do break``:
|
||||||
|
``Rules#Timer=1`` - fire the event when Timer1 has stopped
|
||||||
|
``Power1 0`` - turn off power
|
||||||
|
``Rule1 1`` - enable Rule1
|
||||||
|
``Rule2 0`` - disable Rule2
|
||||||
|
``Switch1#State=2 do break`` - ignore toggling
|
||||||
|
|
|
@ -4,17 +4,17 @@
|
||||||
- [**AM312**](PIR-Motion-Sensors#AM312) PIR Motion Sensor
|
- [**AM312**](PIR-Motion-Sensors#AM312) PIR Motion Sensor
|
||||||
- [**APDS-9960**](APDS-9960) Ambient Light, RGB Color and Proximity Sensor with Gesture Detection
|
- [**APDS-9960**](APDS-9960) Ambient Light, RGB Color and Proximity Sensor with Gesture Detection
|
||||||
- [**AZ-7798**](Wemos-D1-Mini-and-AZ-Instrument-7798-CO2-Meter-Datalogger) CO<sub>2</sub> Meter Datalogger
|
- [**AZ-7798**](Wemos-D1-Mini-and-AZ-Instrument-7798-CO2-Meter-Datalogger) CO<sub>2</sub> Meter Datalogger
|
||||||
- [**BH1750**](Wemos-D1-Mini-and-BH1750-Luminosity-Sensor) Luminosity Sensor
|
- [**BH1750**](BH1750) Luminosity Sensor
|
||||||
- [**BME280 (BMP085, BMP180, BMP280, BME280)**](Wemos-D1-Mini-and-BME280-Temperature,-Humidity-and-Pressure-Sensor) Temperature, Humidity and Pressure Sensor
|
- [**BME280 (BMP085, BMP180, BMP280, BME280)**](BME280) Temperature, Humidity and Pressure Sensor
|
||||||
- [Sonoff Basic Wiring](BME280-Temperature,-Humidity-and-Pressure-Sensor-and-Sonoff-Basic-with-Tasmota)
|
- [Sonoff Basic Wiring](Sonoff-Basic-and-BME280)
|
||||||
- [**BME680**](Wemos-D1-Mini-and-BME680-Temperature,-Humidity,-Pressure-and-Gas-Sensor) Temperature, Humidity, Pressure and Gas Sensor
|
- [**BME680**](BME680) Temperature, Humidity, Pressure and Gas Sensor
|
||||||
- [**CC2530**](Zigbee) Zigbee Adapter (Serial)
|
- [**CC2530**](Zigbee) Zigbee Adapter (Serial)
|
||||||
- **CCS811** Gas and Air Quality sensor (I<sup>2</sup>C)
|
- **CCS811** Gas and Air Quality sensor (I<sup>2</sup>C)
|
||||||
- [**DHT11**](Wemos-D1-Mini-and-DHT11-Shield-Humidity-&-Temperature) Humidity & Temperature Sensor
|
- [**DHT11**](Wemos-D1-Mini-and-DHT11-Shield-Humidity-&-Temperature) Humidity & Temperature Sensor
|
||||||
- [Sonoff Basic wiring](DHT11-Wiring---Sonoff-Basic)
|
- [Sonoff Basic wiring](DHT11-Wiring---Sonoff-Basic)
|
||||||
- [**DHT22 (DHT21, AM2301, AM2302, AM2321)**](Wemos-D1-Mini-and-DHT22-(DHT21,-AM2301,-AM2302,-AM2321)-Shield-Humidity-&-Temperature) Humidity & Temperature Sensor<img src="https://user-images.githubusercontent.com/5904370/53279561-cfb18480-3711-11e9-9889-76ab1d6eafcb.png" width="250" align="right" />
|
- [**DHT22 (DHT21, AM2301, AM2302, AM2321)**](Wemos-D1-Mini-and-DHT22-(DHT21,-AM2301,-AM2302,-AM2321)-Shield-Humidity-&-Temperature) Humidity & Temperature Sensor<img src="https://user-images.githubusercontent.com/5904370/53279561-cfb18480-3711-11e9-9889-76ab1d6eafcb.png" width="250" align="right" />
|
||||||
- **DS18x20** Temperature sensor (GPIO)
|
- **DS18x20** Temperature sensor (GPIO)
|
||||||
- [**DS3231**](DS3231---External-RTC) Real-Time-Clock (I<sup>2</sup>C)
|
- [**DS3231**](DS3231) Real-Time-Clock (I<sup>2</sup>C)
|
||||||
- [**HM16/HM17**](iBeacon-driver) Bluetooth iBeacon reader (Serial)
|
- [**HM16/HM17**](iBeacon-driver) Bluetooth iBeacon reader (Serial)
|
||||||
- **HR-E** Water Meter Encoder interface (Serial)
|
- **HR-E** Water Meter Encoder interface (Serial)
|
||||||
- [**HC-SR04 (SR04+, SR04T)**](Wemos-D1-Mini-and-HC-SR04-Ultrasonic-Sensor) Ultrasonic Sensor
|
- [**HC-SR04 (SR04+, SR04T)**](Wemos-D1-Mini-and-HC-SR04-Ultrasonic-Sensor) Ultrasonic Sensor
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
## BH1750 Luminosity Sensor (I<sup>2</sup>C)
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bh1750-light-intensity-sensor-front.jpg" align=right width=225>
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bh1750-light-intensity-sensor-back.jpg" align=right width=225>
|
|
||||||
|
|
||||||
The BH1750 is a digital ambient light sensor module which uses I<sup>2</sup>C to communicate. The BH1750 provides you with a digital value in lux (Lx) over a range of 1 - 65535 lx. See [Digital 16bit Serial Output Type
|
|
||||||
Ambient Light Sensor IC](http://cpre.kmutnb.ac.th/esl/learning/bh1750-light-sensor/bh1750fvi-e_datasheet.pdf) for more information.
|
|
||||||
|
|
||||||
### Connecting the BH1750 to a Wemos Mini D1
|
|
||||||
|
|
||||||
| Wemos | BH1750 |
|
|
||||||
|---|---|
|
|
||||||
|GND |GND |
|
|
||||||
|5V |VCC |
|
|
||||||
|D3 (gpio0) |SDA |
|
|
||||||
|D4 (gpio2) |SCL |
|
|
||||||
|
|
||||||
### Tasmota Configuration
|
|
||||||
In the Configuration -> Configure Module page, select the following:
|
|
||||||
1. **Module Type : 18 Generic**
|
|
||||||
2. **D3 GPIO0 : 06 I<sup>2</sup>C SDA**
|
|
||||||
3. **D4 GPIO2 : 05 I<sup>2</sup>C SCL**
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos_bh1750_config_marked.jpg" width=300>
|
|
||||||
|
|
||||||
### Tasmota Main
|
|
||||||
After reboot of the device the displays the BH1750 Illuminance.
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos_bh1750_main_marked.jpg" width=300>
|
|
|
@ -1,72 +0,0 @@
|
||||||
## BME280 Temperature, Humidity and Pressure Sensor (I<sup>2</sup>C)
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bme280-adafruit-thp-sensor.jpg" align=right width=200>
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bme280-thp-sensor.png" align=right width=225>
|
|
||||||
|
|
||||||
"BME280 sensor, an environmental sensor with temperature, barometric pressure and humidity" See [BME280 Temperature, Humidity and Pressure Sensor](https://www.adafruit.com/product/2652) for more information.
|
|
||||||
|
|
||||||
_Note: before the BME280 can be used with Tasmota, make sure it's enabled. To enable it, ensure that the following directive is defined in your `user_config_overrid.h` before you compile and upload Tasmota to your Wemos device._
|
|
||||||
|
|
||||||
```
|
|
||||||
#define USE_BMP // Add I2C code for BMP085/BMP180/BMP280/BME280 sensor (+4k code)
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
Since 2018-10-29 v6.1.2.20 you can use multiple BMP Sensors ([9d981d8](https://github.com/arendst/Tasmota/commit/9d981d83e4dd01376f0b20ac5408bc7470c11600))
|
|
||||||
|
|
||||||
Limit is 2 BMP Sensors and you HAVE TO change the address of one sensor.
|
|
||||||
Than connect your Sensor SCL and SDA parallel to the device.
|
|
||||||
BME280 address change example:
|
|
||||||
<img title="bme280-2nd-address" src="https://user-images.githubusercontent.com/14855001/47621417-e3e4cc80-daf7-11e8-848b-aed744456fc0.png" width="150" height="auto">
|
|
||||||
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
### Connecting the BME280 to a Wemos Mini D1
|
|
||||||
|
|
||||||
| Wemos | BME280 |
|
|
||||||
|---|---|
|
|
||||||
|GND |GND |
|
|
||||||
|3.3V |VCC |
|
|
||||||
|D3 (gpio0) |SDA |
|
|
||||||
|D4 (gpio2) |SCL |
|
|
||||||
|
|
||||||
_If you are using breakout boards which break out pins CSB please ensure that you connect this pin to VCC to ensure that the chip stays in I<sup>2</sup>C mode - This is due to some manufacturers of breakout boards add pull-up resistors to allow for SPI compatibility (some would default to SPI, others to I<sup>2</sup>C)_
|
|
||||||
|
|
||||||
_Also connect the SDO pin to GND or VCC to ensure required I<sup>2</sup>C address is used by the chip - Again some manufacturers add resistors to provide external bias but due to them wanting to retain SPI compatibility such pulldown resistors may not be sufficient to ensure that the pin levels are at the correct transition during power-up / reset state._
|
|
||||||
|
|
||||||
_Since the chip supports both SPI and I<sup>2</sup>C, but in Tasmota only I<sup>2</sup>C is supported you want to make sure that the chip is in I<sup>2</sup>C mode during reset/power-on and remain in that state during operation otherwise unexpected behaviour may result when the Tasmota firmware polls the chip for sensor data._
|
|
||||||
|
|
||||||
### Tasmota Configuration
|
|
||||||
In the Configuration -> Configure Module page, select the following:
|
|
||||||
1. **Module Type : 18 Generic**
|
|
||||||
2. **D3 GPIO0 : 06 I<sup>2</sup>C SDA**
|
|
||||||
3. **D4 GPIO2 : 05 I<sup>2</sup>C SCL**
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos_bme280_config_marked.jpg" width=300>
|
|
||||||
|
|
||||||
### Tasmota Main
|
|
||||||
After reboot of the device the displays temperature, humidity and pressure measured by the BME280.
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos_bme280_main_marked.jpg" width=300>
|
|
||||||
<img src="https://user-images.githubusercontent.com/14855001/47621410-cd3e7580-daf7-11e8-91c4-a0db5bc87df5.png" width=300>
|
|
||||||
<img src="https://user-images.githubusercontent.com/14855001/47621426-fa8b2380-daf7-11e8-8e47-37c76b0c7691.png" width=300>
|
|
||||||
|
|
||||||
An example of the SENSOR json:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
{
|
|
||||||
"Time": "2019-09-05T20:04:18",
|
|
||||||
"Epoch": 1567706658,
|
|
||||||
"Switch1": "OFF",
|
|
||||||
"BME280": {
|
|
||||||
"Temperature": 24.3,
|
|
||||||
"Humidity": 39.5,
|
|
||||||
"Pressure": 1022.1
|
|
||||||
},
|
|
||||||
"PressureUnit": "hPa",
|
|
||||||
"TempUnit": "C"
|
|
||||||
}
|
|
||||||
```
|
|
|
@ -1,59 +0,0 @@
|
||||||
## BME680 Temperature, Humidity, Pressure and Gas Sensor (I<sup>2</sup>C)
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bme680-gas-pressure-humidity-temperature-sensor.jpg" align=right width=225>
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/bme680-gas-pressure-humidity-temperature-sensor-adafruit.jpg" align=right width=275>
|
|
||||||
|
|
||||||
"BME680 sensor, an environmental sensor with temperature, humidity, barometric pressure and gas".
|
|
||||||
|
|
||||||
_The BME680 takes those sensors to the next step in that it contains a small MOX sensor. The heated metal oxide **changes resistance** based on the volatile organic compounds (VOC) in the air, so it can be used to detect gasses & alcohols such as Ethanol, Alcohol and Carbon Monoxide, and perform air quality measurements. Note it will give you one resistance value, with overall VOC content, but it cannot differentiate gasses or alcohols._
|
|
||||||
|
|
||||||
See [BME680 - Temperature, Humidity, Pressure and Gas Sensor](https://www.adafruit.com/product/3660) for more information.
|
|
||||||
|
|
||||||
Buy example:
|
|
||||||
- [Adafruit](https://www.adafruit.com/product/3660)
|
|
||||||
- [AliExpress](https://aliexpress.com/item/CFsunbird-BME680-temperature-and-humidity-temperature-pressure-high-altitude-sensor/32852091387.html)
|
|
||||||
|
|
||||||
_Note: before the BME680 can be used with Tasmota, make sure it's enabled. To enable it, remove the forward slashes before this line before you compile and upload tasmota to your Wemos device._
|
|
||||||
|
|
||||||
```
|
|
||||||
#define USE_BME680 // Add additional support for BME680 sensor using Adafruit Sensor and BME680 libraries (+6k code)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Connecting the BME680 to a Wemos Mini D1
|
|
||||||
|
|
||||||
| Wemos | BME680 |
|
|
||||||
|---|---|
|
|
||||||
|GND |GND |
|
|
||||||
|3.3V |VCC |
|
|
||||||
|D2 (gpio4) |SDA |
|
|
||||||
|D1 (gpio5) |SCL |
|
|
||||||
|
|
||||||
### Tasmota Configuration
|
|
||||||
In the Configuration -> Configure Module page, select the following:
|
|
||||||
1. **Module Type : 18 Generic**
|
|
||||||
2. **D2 GPIO4 : 06 I<sup>2</sup>C SDA**
|
|
||||||
3. **D1 GPIO5 : 05 I<sup>2</sup>C SCL**
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos-bme680-config-marked.jpg" width=300>
|
|
||||||
|
|
||||||
### Tasmota Main
|
|
||||||
After reboot of the device the displays temperature, humidity, pressure and gas measured by the BME680.
|
|
||||||
|
|
||||||
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos-bme680-main-marked.jpg" width=300>
|
|
||||||
|
|
||||||
An example of the SENSOR json is:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"Time": "2019-09-05T20:14:27",
|
|
||||||
"Epoch": 1567707267,
|
|
||||||
"BME680": {
|
|
||||||
"Temperature": 28.0,
|
|
||||||
"Humidity": 38.8,
|
|
||||||
"Pressure": 1022.5,
|
|
||||||
"Gas": 5.08
|
|
||||||
},
|
|
||||||
"PressureUnit": "hPa",
|
|
||||||
"TempUnit": "C"
|
|
||||||
}
|
|
||||||
```
|
|
Loading…
Reference in New Issue