mirror of https://github.com/arendst/Tasmota.git
SwitchMode<x> is for Switch<x> only
parent
80511664e8
commit
3ae8680130
|
@ -40,16 +40,14 @@ By default a switch toggles the corresponding relay. Every time the switch gets
|
|||
|
||||
Apart from the default toggling of the relay, switches can be configured to do long press (HOLD) actions, send messages to different MQTT topics or commands to other Tasmota devices.
|
||||
|
||||
> Now to make everything a little confusing:
|
||||
>
|
||||
>A built in push-button can be configured as a Switch and a toggle switch can be configured as a Button. We don't recommend to do so, but it is entirely possible!
|
||||
|
||||
## Switch and Button options
|
||||
> Now to make everything a little confusing: A built in push-button can be configured as a Switch and a toggle switch can be configured as a Button. We don't recommend to do so, but it is entirely possible!
|
||||
|
||||
## [SwitchMode](Commands#switchmode)
|
||||
> For visual learners: [Tasmota Switchmode Explained](https://www.youtube.com/watch?v=kiXAGkyqFeU) - video by Dr Zzs
|
||||
|
||||
To change the mode of a switch or button use the [`SwitchMode`](Commands#switchmode) command. If there is more than one, use `SwitchMode<x>` where `<x>` is the number of your switch or button from GPIO configuration.
|
||||
To change the behavior of an input peripheral configured as a Tasmota `Switch<x>` component, whether a latching switch or a [momentary switch](https://en.wikipedia.org/wiki/Switch#Biased_switches) (i.e., a push-button), use the `SwitchMode` command. If there is more than one `Switch<x>` component, use `SwitchMode<x>` where `<x>` is the number of your switch from GPIO configuration.
|
||||
|
||||
SwitchMode, as the name implies, applies _**ONLY**_ to GPIO configured in Tasmota as a `Switch<x>` component (9-16 & 82-89). SwitchMode has _**NO**_ impact on the behavior of GPIO configured as `Button<x>` components (17-20, 90-93, & 112-129). SwitchMode is intended to set the desired behavior of a `Switch<x>` component based on whether a switch or a button (a momentary switch) is physically connected to the GPIO.
|
||||
|
||||
**`SwitchMode 0`** (_Tasmota default_)
|
||||
|
||||
|
@ -71,6 +69,8 @@ At the time when the circuit is closed, Tasmota will send `ON` and opening the c
|
|||
|
||||
At the time when the circuit is closed, Tasmota will send `OFF` and opening the circuit sends `ON`.
|
||||
|
||||
>When connecting a momentary switch (i.e., a push-button) you will want to use `SwitchMode 3..7`.
|
||||
|
||||
**`SwitchMode 3`**
|
||||
|
||||
```Set push-button mode (0 = TOGGLE, 1 = ON (_default_))```
|
||||
|
@ -83,8 +83,6 @@ Tasmota will send a `TOGGLE` command when the button is released (opening the ci
|
|||
|
||||
Tasmota will send a `TOGGLE` command when the button is pressed (closing the circuit). When the button is released (opening the circuit) nothing will happen. Default state is OFF and when pressed it's ON. (This trigger is known as [rising-edge](https://en.wikipedia.org/wiki/Signal_edge))
|
||||
|
||||
>When connecting a [momentary switch](https://en.wikipedia.org/wiki/Switch#Biased_switches) (i.e., a push-button) you will want to use `SwitchMode 3` or `SwitchMode 4`.
|
||||
|
||||
**`SwitchMode 5`**
|
||||
|
||||
```Set push-button with long press mode (0 = TOGGLE, 1 = ON (_default_), long press = HOLD)```
|
||||
|
|
Loading…
Reference in New Issue