Skip to content

Commit 9938c07

Browse files
authored
Merge branch 'wled:main' into main
2 parents bbd3738 + 25223c4 commit 9938c07

File tree

24 files changed

+413
-183
lines changed

24 files changed

+413
-183
lines changed

usermods/Animated_Staircase/README.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Usermod Animated Staircase
2+
23
This usermod makes your staircase look cool by illuminating it with an animation. It uses
34
PIR or ultrasonic sensors at the top and bottom of your stairs to:
45

@@ -11,11 +12,13 @@ The Animated Staircase can be controlled by the WLED API. Change settings such a
1112
speed, on/off time and distance by sending an HTTP request, see below.
1213

1314
## WLED integration
15+
1416
To include this usermod in your WLED setup, you have to be able to [compile WLED from source](https://kno.wled.ge/advanced/compiling-wled/).
1517

1618
Before compiling, you have to make the following modifications:
1719

1820
Edit your environment in `platformio_override.ini`
21+
1922
1. Open `platformio_override.ini`
2023
2. add `Animated_Staircase` to the `custom_usermods` line for your environment
2124

@@ -25,10 +28,10 @@ If you use PIR sensor enter -1 for echo pin.
2528
Maximum distance for ultrasonic sensor can be configured as the time needed for an echo (see below).
2629

2730
## Hardware installation
31+
2832
1. Attach the LED strip to each step of the stairs.
2933
2. Connect the ESP8266 pin D4 or ESP32 pin D2 to the first LED data pin at the bottom step.
30-
3. Connect the data-out pin at the end of each strip per step to the data-in pin on the
31-
next step, creating one large virtual LED strip.
34+
3. Connect the data-out pin at the end of each strip per step to the data-in pin on the next step, creating one large virtual LED strip.
3235
4. Mount sensors of choice at the bottom and top of the stairs and connect them to the ESP.
3336
5. To make sure all LEDs get enough power and have your staircase lighted evenly, power each
3437
step from one side, using at least AWG14 or 2.5mm^2 cable. Don't connect them serial as you
@@ -37,24 +40,23 @@ Maximum distance for ultrasonic sensor can be configured as the time needed for
3740
You _may_ need to use 10k pull-down resistors on the selected PIR pins, depending on the sensor.
3841

3942
## WLED configuration
40-
1. In the WLED UI, configure a segment for each step. The lowest step of the stairs is the
41-
lowest segment id.
42-
2. Save your segments into a preset.
43-
3. Ideally, add the preset in the config > LED setup menu to the "apply
44-
preset **n** at boot" setting.
43+
44+
1. In the WLED UI, configure a segment for each step. The lowest step of the stairs is the lowest segment id.
45+
2. Save your segments into a preset.
46+
3. Ideally, add the preset in the config > LED setup menu to the "apply preset **n** at boot" setting.
4547

4648
## Changing behavior through API
49+
4750
The Staircase settings can be changed through the WLED JSON api.
4851

4952
**NOTE:** We are using [curl](https://curl.se/) to send HTTP POSTs to the WLED API.
5053
If you're using Windows and want to use the curl commands, replace the `\` with a `^`
5154
or remove them and put everything on one line.
5255

53-
5456
| Setting | Description | Default |
5557
|------------------|---------------------------------------------------------------|---------|
5658
| enabled | Enable or disable the usermod | true |
57-
| bottom-sensor | Manually trigger a down to up animation via API | false |
59+
| bottom-sensor | Manually trigger a down to up animation via API | false |
5860
| top-sensor | Manually trigger an up to down animation via API | false |
5961

6062

@@ -74,6 +76,7 @@ The staircase settings and sensor states are inside the WLED "state" element:
7476
```
7577

7678
### Enable/disable the usermod
79+
7780
By disabling the usermod you will be able to keep the LED's on, independent from the sensor
7881
activity. This enables you to play with the lights without the usermod switching them on or off.
7982

@@ -90,6 +93,7 @@ To enable the usermod again, use `"enabled":true`.
9093
Alternatively you can use _Usermod_ Settings page where you can change other parameters as well.
9194

9295
### Changing animation parameters and detection range of the ultrasonic HC-SR04 sensor
96+
9397
Using _Usermod_ Settings page you can define different usermod parameters, including sensor pins, delay between segment activation etc.
9498

9599
When an ultrasonic sensor is enabled you can enter maximum detection distance in centimeters separately for top and bottom sensors.
@@ -99,6 +103,7 @@ distances creates delays in the WLED software, _might_ introduce timing hiccups
99103
a less responsive web interface. It is therefore advised to keep the detection distance as short as possible.
100104

101105
### Animation triggering through the API
106+
102107
In addition to activation by one of the stair sensors, you can also trigger the animation manually
103108
via the API. To simulate triggering the bottom sensor, use:
104109

@@ -115,15 +120,19 @@ curl -X POST -H "Content-Type: application/json" \
115120
-d '{"staircase":{"top-sensor":true}}' \
116121
xxx.xxx.xxx.xxx/json/state
117122
```
123+
118124
**MQTT**
119125
You can publish a message with either `up` or `down` on topic `/swipe` to trigger animation.
120126
You can also use `on` or `off` for enabling or disabling the usermod.
121127

122-
Have fun with this usermod.<br/>
123-
www.rolfje.com
128+
Have fun with this usermod
129+
130+
`www.rolfje.com`
124131

125132
Modifications @blazoncek
126133

127134
## Change log
135+
128136
2021-04
129-
* Adaptation for runtime configuration.
137+
138+
- Adaptation for runtime configuration.

usermods/BH1750_v2/readme.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This usermod will read from an ambient light sensor like the BH1750.
44
The luminance is displayed in both the Info section of the web UI, as well as published to the `/luminance` MQTT topic if enabled.
55

66
## Dependencies
7+
78
- Libraries
89
- `claws/BH1750 @^1.2.0`
910
- Data is published over MQTT - make sure you've enabled the MQTT sync interface.
@@ -13,23 +14,30 @@ The luminance is displayed in both the Info section of the web UI, as well as pu
1314
To enable, compile with `BH1750` in `custom_usermods` (e.g. in `platformio_override.ini`)
1415

1516
### Configuration Options
17+
1618
The following settings can be set at compile-time but are configurable on the usermod menu (except First Measurement time):
17-
* `USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL` - the max number of milliseconds between measurements, defaults to 10000ms
18-
* `USERMOD_BH1750_MIN_MEASUREMENT_INTERVAL` - the min number of milliseconds between measurements, defaults to 500ms
19-
* `USERMOD_BH1750_OFFSET_VALUE` - the offset value to report on, defaults to 1
20-
* `USERMOD_BH1750_FIRST_MEASUREMENT_AT` - the number of milliseconds after boot to take first measurement, defaults to 10000 ms
19+
20+
- `USERMOD_BH1750_MAX_MEASUREMENT_INTERVAL` - the max number of milliseconds between measurements, defaults to 10000ms
21+
- `USERMOD_BH1750_MIN_MEASUREMENT_INTERVAL` - the min number of milliseconds between measurements, defaults to 500ms
22+
- `USERMOD_BH1750_OFFSET_VALUE` - the offset value to report on, defaults to 1
23+
- `USERMOD_BH1750_FIRST_MEASUREMENT_AT` - the number of milliseconds after boot to take first measurement, defaults to 10000 ms
2124

2225
In addition, the Usermod screen allows you to:
26+
2327
- enable/disable the usermod
2428
- Enable Home Assistant Discovery of usermod
2529
- Configure the SCL/SDA pins
2630

2731
## API
32+
2833
The following method is available to interact with the usermod from other code modules:
34+
2935
- `getIlluminance` read the brightness from the sensor
3036

3137
## Change Log
38+
3239
Jul 2022
40+
3341
- Added Home Assistant Discovery
3442
- Implemented PinManager to register pins
3543
- Made pins configurable in usermod menu

usermods/PIR_sensor_switch/readme.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,24 @@ You can also use usermod's off timer instead of sensor's. In such case rotate th
2525

2626
**NOTE:** Usermod has been included in master branch of WLED so it can be compiled in directly just by defining `-D USERMOD_PIRSWITCH` and optionally `-D PIR_SENSOR_PIN=16` to override default pin. You can also change the default off time by adding `-D PIR_SENSOR_OFF_SEC=30`.
2727

28-
## API to enable/disable the PIR sensor from outside. For example from another usermod:
28+
## API to enable/disable the PIR sensor from outside. For example from another usermod
2929

3030
To query or change the PIR sensor state the methods `bool PIRsensorEnabled()` and `void EnablePIRsensor(bool enable)` are available.
3131

3232
When the PIR sensor state changes an MQTT message is broadcasted with topic `wled/deviceMAC/motion` and message `on` or `off`.
3333
Usermod can also be configured to send just the MQTT message but not change WLED state using settings page as well as responding to motion only at night
3434
(assuming NTP and latitude/longitude are set to determine sunrise/sunset times).
3535

36-
### There are two options to get access to the usermod instance:
36+
### There are two options to get access to the usermod instance
3737

38-
1. Include `usermod_PIR_sensor_switch.h` **before** you include other usermods in `usermods_list.cpp'
38+
_1._ Include `usermod_PIR_sensor_switch.h` **before** you include other usermods in `usermods_list.cpp'
3939

4040
or
4141

42-
2. Use `#include "usermod_PIR_sensor_switch.h"` at the top of the `usermod.h` where you need it.
42+
_2._ Use `#include "usermod_PIR_sensor_switch.h"` at the top of the `usermod.h` where you need it.
4343

4444
**Example usermod.h :**
45+
4546
```cpp
4647
#include "wled.h"
4748

@@ -79,25 +80,30 @@ Usermod can be configured via the Usermods settings page.
7980
* `override` - override PIR input when WLED state is changed using UI
8081
* `domoticz-idx` - Domoticz virtual switch ID (used with MQTT `domoticz/in`)
8182
82-
8383
Have fun - @gegu & @blazoncek
8484
8585
## Change log
86+
8687
2021-04
88+
8789
* Adaptation for runtime configuration.
8890
8991
2021-11
92+
9093
* Added information about dynamic configuration options
9194
* Added option to temporary enable/disable usermod from WLED UI (Info dialog)
9295
9396
2022-11
97+
9498
* Added compile time option for off timer.
9599
* Added Home Assistant autodiscovery MQTT broadcast.
96100
* Updated info on compiling.
97101
98102
2023-??
103+
99104
* Override option
100105
* Domoticz virtual switch ID (used with MQTT `domoticz/in`)
101106
102107
2024-02
103-
* Added compile time option to expand number of PIR sensors (they are logically ORed) `-D PIR_SENSOR_MAX_SENSORS=3`
108+
109+
* Added compile time option to expand number of PIR sensors (they are logically ORed) `-D PIR_SENSOR_MAX_SENSORS=3`

usermods/PWM_fan/readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ If the fan speed is unlocked, it will revert to temperature controlled speed on
4040
## Change Log
4141

4242
2021-10
43+
4344
* First public release
45+
4446
2022-05
47+
4548
* Added JSON API call to allow changing of speed

usermods/Temperature/readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,23 @@ All parameters can be configured at runtime via the Usermods settings page, incl
3535

3636
## Change Log
3737

38-
2020-09-12
38+
2020-09-12
39+
3940
* Changed to use async non-blocking implementation
4041
* Do not report erroneous low temperatures to MQTT
4142
* Disable plugin if temperature sensor not detected
4243
* Report the number of seconds until the first read in the info screen instead of sensor error
4344

4445
2021-04
46+
4547
* Adaptation for runtime configuration.
4648

4749
2023-05
50+
4851
* Rewrite to conform to newer recommendations.
4952
* Recommended @blazoncek fork of OneWire for ESP32 to avoid Sensor error
5053

5154
2024-09
55+
5256
* Update OneWire to version 2.3.8, which includes stickbreaker's and garyd9's ESP32 fixes:
53-
blazoncek's fork is no longer needed
57+
blazoncek's fork is no longer needed

usermods/audioreactive/readme.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@ Does audio processing and provides data structure that specially written effects
88
**does not** provide effects or draw anything to an LED strip/matrix.
99

1010
## Additional Documentation
11+
1112
This usermod is an evolution of [SR-WLED](https://github.com/atuline/WLED), and a lot of documentation and information can be found in the [SR-WLED wiki](https://github.com/atuline/WLED/wiki):
13+
1214
* [getting started with audio](https://github.com/atuline/WLED/wiki/First-Time-Setup#sound)
1315
* [Sound settings](https://github.com/atuline/WLED/wiki/Sound-Settings) - similar to options on the usemod settings page in WLED.
1416
* [Digital Audio](https://github.com/atuline/WLED/wiki/Digital-Microphone-Hookup)
1517
* [Analog Audio](https://github.com/atuline/WLED/wiki/Analog-Audio-Input-Options)
1618
* [UDP Sound sync](https://github.com/atuline/WLED/wiki/UDP-Sound-Sync)
1719

18-
1920
## Supported MCUs
20-
This audioreactive usermod works best on "classic ESP32" (dual core), and on ESP32-S3 which also has dual core and hardware floating point support.
2121

22-
It will compile successfully for ESP32-S2 and ESP32-C3, however might not work well, as other WLED functions will become slow. Audio processing requires a lot of computing power, which can be problematic on smaller MCUs like -S2 and -C3.
22+
This audioreactive usermod works best on "classic ESP32" (dual core), and on ESP32-S3 which also has dual core and hardware floating point support.
23+
24+
It will compile successfully for ESP32-S2 and ESP32-C3, however might not work well, as other WLED functions will become slow. Audio processing requires a lot of computing power, which can be problematic on smaller MCUs like -S2 and -C3.
2325

2426
Analog audio is only possible on "classic" ESP32, but not on other MCUs like ESP32-S3.
2527

26-
Currently ESP8266 is not supported, due to low speed and small RAM of this chip.
28+
Currently ESP8266 is not supported, due to low speed and small RAM of this chip.
2729
There are however plans to create a lightweight audioreactive for the 8266, with reduced features.
28-
## Installation
30+
31+
## Installation
2932

3033
Add 'ADS1115_v2' to `custom_usermods` in your platformio environment.
3134

@@ -35,29 +38,31 @@ All parameters are runtime configurable. Some may require a hard reset after cha
3538

3639
If you want to define default GPIOs during compile time, use the following (default values in parentheses):
3740

38-
- `-D SR_DMTYPE=x` : defines digital microphone type: 0=analog, 1=generic I2S (default), 2=ES7243 I2S, 3=SPH0645 I2S, 4=generic I2S with master clock, 5=PDM I2S
39-
- `-D AUDIOPIN=x` : GPIO for analog microphone/AUX-in (36)
40-
- `-D I2S_SDPIN=x` : GPIO for SD pin on digital microphone (32)
41-
- `-D I2S_WSPIN=x` : GPIO for WS pin on digital microphone (15)
42-
- `-D I2S_CKPIN=x` : GPIO for SCK pin on digital microphone (14)
43-
- `-D MCLK_PIN=x` : GPIO for master clock pin on digital Line-In boards (-1)
44-
- `-D ES7243_SDAPIN` : GPIO for I2C SDA pin on ES7243 microphone (-1)
45-
- `-D ES7243_SCLPIN` : GPIO for I2C SCL pin on ES7243 microphone (-1)
41+
* `-D SR_DMTYPE=x` : defines digital microphone type: 0=analog, 1=generic I2S (default), 2=ES7243 I2S, 3=SPH0645 I2S, 4=generic I2S with master clock, 5=PDM I2S
42+
* `-D AUDIOPIN=x` : GPIO for analog microphone/AUX-in (36)
43+
* `-D I2S_SDPIN=x` : GPIO for SD pin on digital microphone (32)
44+
* `-D I2S_WSPIN=x` : GPIO for WS pin on digital microphone (15)
45+
* `-D I2S_CKPIN=x` : GPIO for SCK pin on digital microphone (14)
46+
* `-D MCLK_PIN=x` : GPIO for master clock pin on digital Line-In boards (-1)
47+
* `-D ES7243_SDAPIN` : GPIO for I2C SDA pin on ES7243 microphone (-1)
48+
* `-D ES7243_SCLPIN` : GPIO for I2C SCL pin on ES7243 microphone (-1)
4649

4750
Other options:
4851

49-
- `-D UM_AUDIOREACTIVE_ENABLE` : makes usermod default enabled (not the same as include into build option!)
50-
- `-D UM_AUDIOREACTIVE_DYNAMICS_LIMITER_OFF` : disables rise/fall limiter default
52+
* `-D UM_AUDIOREACTIVE_ENABLE` : makes usermod default enabled (not the same as include into build option!)
53+
* `-D UM_AUDIOREACTIVE_DYNAMICS_LIMITER_OFF` : disables rise/fall limiter default
5154

5255
**NOTE** I2S is used for analog audio sampling. Hence, the analog *buttons* (i.e. potentiometers) are disabled when running this usermod with an analog microphone.
5356

5457
### Advanced Compile-Time Options
58+
5559
You can use the following additional flags in your `build_flags`
60+
5661
* `-D SR_SQUELCH=x` : Default "squelch" setting (10)
5762
* `-D SR_GAIN=x` : Default "gain" setting (60)
5863
* `-D I2S_USE_RIGHT_CHANNEL`: Use RIGHT instead of LEFT channel (not recommended unless you strictly need this).
5964
* `-D I2S_USE_16BIT_SAMPLES`: Use 16bit instead of 32bit for internal sample buffers. Reduces sampling quality, but frees some RAM ressources (not recommended unless you absolutely need this).
60-
* `-D I2S_GRAB_ADC1_COMPLETELY`: Experimental: continuously sample analog ADC microphone. Only effective on ESP32. WARNING this _will_ cause conflicts(lock-up) with any analogRead() call.
65+
* `-D I2S_GRAB_ADC1_COMPLETELY`: Experimental: continuously sample analog ADC microphone. Only effective on ESP32. WARNING this *will* cause conflicts(lock-up) with any analogRead() call.
6166
* `-D MIC_LOGGER` : (debugging) Logs samples from the microphone to serial USB. Use with serial plotter (Arduino IDE)
6267
* `-D SR_DEBUG` : (debugging) Additional error diagnostics and debug info on serial USB.
6368

usermods/project_cars_shiftlight/readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
### Shift Light for Project Cars
1+
# Shift Light for Project Cars
22

33
Turn your WLED lights into a rev light and shift indicator for Project Cars.
44
It's easy to use.
55

6-
1. Make sure your WLED device and your PC/console are on the same network and can talk to each other
6+
_1._ Make sure your WLED device and your PC/console are on the same network and can talk to each other
77

8-
2. Go to the gameplay settings menu in PCARS and enable UDP. There are 9 numbers you can choose from. This is the refresh rate. The lower the number, the better. However, you might run into problems at faster rates.
8+
_2._ Go to the gameplay settings menu in PCARS and enable UDP. There are 9 numbers you can choose from. This is the refresh rate. The lower the number, the better. However, you might run into problems at faster rates.
99

1010
| Number | Updates/Second |
1111
| ------ | -------------- |
@@ -19,5 +19,5 @@ It's easy to use.
1919
| 8 | 05 |
2020
| 9 | 1 |
2121

22-
3. Once you enter a race, WLED should automatically shift to PCARS mode.
23-
4. Done.
22+
_3._ Once you enter a race, WLED should automatically shift to PCARS mode.
23+
_4._ Done.

usermods/readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
### Usermods
1+
# Usermods
22

33
This folder serves as a repository for usermods (custom `usermod.cpp` files)!
44

55
If you have created a usermod you believe is useful (for example to support a particular sensor, display, feature...), feel free to contribute by opening a pull request!
66

77
In order for other people to be able to have fun with your usermod, please keep these points in mind:
88

9-
- Create a folder in this folder with a descriptive name (for example `usermod_ds18b20_temp_sensor_mqtt`)
10-
- Include your custom files
11-
- If your usermod requires changes to other WLED files, please write a `readme.md` outlining the steps one needs to take
12-
- Create a pull request!
13-
- If your feature is useful for the majority of WLED users, I will consider adding it to the base code!
9+
* Create a folder in this folder with a descriptive name (for example `usermod_ds18b20_temp_sensor_mqtt`)
10+
* Include your custom files
11+
* If your usermod requires changes to other WLED files, please write a `readme.md` outlining the steps one needs to take
12+
* Create a pull request!
13+
* If your feature is useful for the majority of WLED users, I will consider adding it to the base code!
1414

1515
While I do my best to not break too much, keep in mind that as WLED is updated, usermods might break.
1616
I am not actively maintaining any usermod in this directory, that is your responsibility as the creator of the usermod.

0 commit comments

Comments
 (0)