Skip to content

Commit b241872

Browse files
authored
Merge pull request wled#2942 from ezcGman/um-sht
New Usermod: SHT temperature & humidity sensors
2 parents e7449b4 + b7034d3 commit b241872

File tree

4 files changed

+558
-1
lines changed

4 files changed

+558
-1
lines changed

usermods/sht/readme.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SHT
2+
Usermod to support various SHT i2c sensors like the SHT30, SHT31, SHT35 and SHT85
3+
4+
## Requirements
5+
* "SHT85" by Rob Tillaart, v0.2 or higher: https://github.com/RobTillaart/SHT85
6+
7+
## Usermod installation
8+
Simply copy the below block (build task) to your `platformio_override.ini` and compile WLED using this new build task. Or use an existing one, add the buildflag `-D USERMOD_SHT` and the below library dependencies.
9+
10+
ESP32:
11+
```
12+
[env:custom_esp32dev_usermod_sht]
13+
extends = env:esp32dev
14+
build_flags = ${common.build_flags_esp32}
15+
-D USERMOD_SHT
16+
lib_deps = ${esp32.lib_deps}
17+
robtillaart/SHT85@~0.3.3
18+
```
19+
20+
ESP8266:
21+
```
22+
[env:custom_d1_mini_usermod_sht]
23+
extends = env:d1_mini
24+
build_flags = ${common.build_flags_esp8266}
25+
-D USERMOD_SHT
26+
lib_deps = ${esp8266.lib_deps}
27+
robtillaart/SHT85@~0.3.3
28+
```
29+
30+
## MQTT Discovery for Home Assistant
31+
If you're using Home Assistant and want to have the temperature and humidity available as entities in HA, you can tick the "Add-To-Home-Assistant-MQTT-Discovery" option in the usermod settings. If you have an MQTT broker configured under "Sync Settings" and it is connected, the mod will publish the auto discovery message to your broker and HA will instantly find it and create an entity each for the temperature and humidity.
32+
33+
### Publishing readings via MQTT
34+
Regardless of having MQTT discovery ticked or not, the mod will always report temperature and humidity to the WLED MQTT topic of that instance, if you have a broker configured and it's connected.
35+
36+
## Configuration
37+
Navigate to the "Config" and then to the "Usermods" section. If you compiled WLED with `-D USERMOD_SHT`, you will see the config for it there:
38+
* SHT-Type:
39+
* What it does: Select the SHT sensor type you want to use
40+
* Possible values: SHT30, SHT31, SHT35, SHT85
41+
* Default: SHT30
42+
* Unit:
43+
* What it does: Select which unit should be used to display the temperature in the info section. Also used when sending via MQTT discovery, see below.
44+
* Possible values: Celsius, Fahrenheit
45+
* Default: Celsius
46+
* Add-To-HA-MQTT-Discovery:
47+
* What it does: Makes the temperature and humidity available via MQTT discovery, so they're automatically added to Home Assistant, because that way it's typesafe.
48+
* Possible values: Enabled/Disabled
49+
* Default: Disabled
50+
51+
## Change log
52+
2022-12
53+
* First implementation.
54+
55+
## Credits
56+
ezcGman | Andy: Find me on the Intermit.Tech (QuinLED) Discord server: https://discord.gg/WdbAauG

0 commit comments

Comments
 (0)