Updated Expanding Sonoffs (markdown)

Theo Arends 2017-03-15 12:37:22 +01:00
parent c5d7166552
commit 6db80a8e2c
1 changed files with 12 additions and 11 deletions

@ -38,19 +38,20 @@ If a pin is defined as GPIO_USER in the module template, you can assign it one o
```
# Examples
## Connect swotch
If you take a Sonoff Basic and connect a switch between pin4 (ground) and pin5 (GPIO4) of the 5 pin programming header you now have a second switch connected to the device. You can set this through the module config page as option ``09 Switch1`` or from the command line with ``gpio4 9``.
1. If you take a Sonoff Basic and connect a switch between pin4 (ground) and pin5 (GPIO4) of the 5 pin programming header you now have a second switch connected to the device. You can set this through the module config page as option ``09 Switch1`` or from the command line with ``gpio4 9``.
If you have fewer than two relays on the module, the additional switch(es) will not show up any different than the built-in switch and will control the single relay unless you set switchtopic to something other than 0 (either 1 or a custom topic). Once this is done the built-in switch will produce ``stat/<topic>/POWER1`` while the new switch will produce ``cmnd/<switchtopic>/POWER1``
If you have fewer than two relays on the module, the additional switch(es) will not show up any different than the built-in switch and will control the single relay unless you set switchtopic to something other than 0 (either 1 or a custom topic). Once this is done the built-in switch will produce ``stat/<topic>/POWER1`` while the new switch will produce ``cmnd/<switchtopic>/POWER1``
With more relays on the modules, the additional switch will create additional POWER\<n> events without the need to set switchtopic.
With more relays on the modules, the additional switch will create additional POWER\<n> events without the need to set switchtopic.
You can set the mode of each switch individually with ``switchmode1`` or ``switchmode2``
you can set the mode of each switch individually with ``switchmode1`` or ``switchmode2``
## Connect header
Instead of connecting a switch, you could connect a 4-pin 2.5mm jack, with the pins wired:
* tip pin5 (GPIO4)
* r1 no connection
* r2 pin1 (3.3v)
* r3 pin4 (ground)
2. Instead of connecting a switch, you could connect a 4-pin 2.5mm jack, with the pins wired:
* tip pin5 (GPIO4)
* r1 no connection
* r2 pin1 (3.3v)
* r3 pin4 (ground)
You can then plug a sensor into the jack like you would to a Sonoff TH10/TH16 and define what sensor you have connected to GPIO4
You can then plug a sensor into the jack like you would to a Sonoff TH10/TH16 and define what sensor you have connected to GPIO4