Skip to content

Commit

Permalink
Merge branch 'main' into seg-groups
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek committed May 29, 2023
2 parents ee7036f + 995d94c commit 0a5aac7
Show file tree
Hide file tree
Showing 11 changed files with 2,734 additions and 2,541 deletions.
8 changes: 2 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ click==8.1.3
# platformio
# uvicorn
colorama==0.4.6
# via
# click
# platformio
# via platformio
h11==0.14.0
# via
# uvicorn
Expand All @@ -42,7 +40,7 @@ pyelftools==0.29
# via platformio
pyserial==3.5
# via platformio
requests==2.28.2
requests==2.31.0
# via platformio
semantic-version==2.10.0
# via platformio
Expand All @@ -52,8 +50,6 @@ starlette==0.23.1
# via platformio
tabulate==0.9.0
# via platformio
typing-extensions==4.5.0
# via starlette
urllib3==1.26.15
# via requests
uvicorn==0.20.0
Expand Down
12 changes: 10 additions & 2 deletions usermods/multi_relay/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Multi Relay

This usermod-v2 modification allows the connection of multiple relays, each with individual delay and on/off mode.
Usermod supports PCF8574 I2C port expander to reduce GPIO use.
PCF8574 supports 8 outputs and each output corresponds to a relay in WLED (relay 0 = port 0, etc). I you are using more than 8 relays with multiple PCF8574 make sure their addresses are set conscutively (e.g. 0x20 and 0x21). You can set address of first expander in settings.
(**NOTE:** Will require Wire library and global I2C pins defined.)

## HTTP API
All responses are returned in JSON format.
Expand Down Expand Up @@ -81,13 +84,15 @@ void registerUsermods()
Usermod can be configured via the Usermods settings page.

* `enabled` - enable/disable usermod
* `use-PCF8574` - use PCF8574 port expander instead of GPIO pins
* `first-PCF8574` - I2C address of first expander (WARNING: enter *decimal* value)
* `broadcast`- time in seconds between MQTT relay-state broadcasts
* `HA-discovery`- enable Home Assistant auto discovery
* `pin` - ESP GPIO pin the relay is connected to (can be configured at compile time `-D MULTI_RELAY_PINS=xx,xx,...`)
* `delay-s` - delay in seconds after on/off command is received
* `active-high` - assign high/low activation of relay (can be used to reverse relay states)
* `external` - if enabled, WLED does not control relay, it can only be triggered by an external command (MQTT, HTTP, JSON or button)
* `button` - button (from LED Settings) that controls this relay
* `broadcast`- time in seconds between MQTT relay-state broadcasts
* `HA-discovery`- enable Home Assistant auto discovery

If there is no MultiRelay section, just save current configuration and re-open Usermods settings page.

Expand All @@ -100,3 +105,6 @@ Have fun - @blazoncek
2021-11
* Added information about dynamic configuration options
* Added button support.

2023-05
* Added support for PCF8574 I2C port expander (multiple)
Loading

0 comments on commit 0a5aac7

Please sign in to comment.