You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I have written a v2 usermod for the BME280/BMP280 sensor based on the [existing v1 usermod](https://github.com/Aircoookie/WLED/blob/master/usermods/Wemos_D1_mini%2BWemos32_mini_shield/usermod_bme280.cpp). It is not just a refactor, there are many changes which I made to fit my use case, and I hope they will fit the use cases of others as well! Most notably, this usermod is *just* for the BME280 and does not control a display like in the v1 usermod designed for the WeMos shield.
2
+
3
+
- Requires libraries `BME280@~3.0.0` (by [finitespace](https://github.com/finitespace/BME280)) and `Wire`. Please add these under `lib_deps` in your `platform.ini` (or `platform_override.ini`).
4
+
- Data is published over MQTT so make sure you've enabled the MQTT sync interface.
5
+
- This usermod also writes to serial (GPIO1 on ESP8266). Please make sure nothing else listening on the serial TX pin of your board will get confused by log messages!
6
+
7
+
To enable, compile with `USERMOD_BME280` defined (i.e. `platformio_override.ini`)
8
+
```ini
9
+
build_flags =
10
+
${common.build_flags_esp8266}
11
+
-D USERMOD_BME280
12
+
```
13
+
or define `USERMOD_BME280` in `my_config.h`
14
+
```c++
15
+
#defineUSERMOD_BME280
16
+
```
17
+
18
+
Changes include:
19
+
- Adjustable measure intervals
20
+
- Temperature and pressure have separate intervals due to pressure not frequently changing at any constant altitude
21
+
- Adjustment of number of decimal places in published sensor values
22
+
- Separate adjustment for temperature, humidity and pressure values
23
+
- Values are rounded to the specified number of decimal places
24
+
- Pressure measured in units of hPa instead of Pa
25
+
- Calculation of heat index (apparent temperature) and dew point
26
+
- These, along with humidity measurements, are disabled if the sensor is a BMP280
27
+
- 16x oversampling of sensor during measurement
28
+
- Values are only published if they are different from the previous value
29
+
- Values are published on startup (continually until the MQTT broker acknowledges a successful publication)
30
+
31
+
Adjustments are made through preprocessor definitions at the start of the class definition.
0 commit comments