mirror of https://github.com/arendst/Tasmota.git
replaced sonoff references
parent
c505a5d8ba
commit
12a4845e8c
|
@ -40,57 +40,57 @@ To change the behavior of a physical input peripheral configured as a Tasmota `S
|
|||
|
||||
SwitchMode, as the name implies, applies _**ONLY**_ to GPIO configured in Tasmota as a `Switch<x>` [component](Components) (9-16 & 82-89). SwitchMode has _**NO**_ impact on the behavior of GPIO configured as `Button<x>` [components](Components) (17-20, 90-93, & 112-129). SwitchMode sets the desired behavior of a `Switch<x>` component based on whether it's a switch or a push-button (i.e., a momentary switch) that is physically connected to the GPIO.
|
||||
|
||||
**`SwitchMode 0`** (_Tasmota default_)
|
||||
#### `SwitchMode 0`
|
||||
> _Default mode_
|
||||
|
||||
```Set switch to toggle mode```
|
||||
Set switch to toggle mode.
|
||||
|
||||
Tasmota sends `TOGGLE` command each time the state of the circuit changes (closing or opening).
|
||||
|
||||
**`SwitchMode 1`**
|
||||
|
||||
```Set switch to follow mode (0 = OFF, 1 = ON)```
|
||||
#### `SwitchMode 1`
|
||||
Set switch to follow mode (`0 = OFF`, `1 = ON`)
|
||||
|
||||
At the time when the circuit is closed, Tasmota will send `ON` and opening the circuit sends `OFF`.
|
||||
|
||||
> You want to use `SwitchMode 1` when connecting a [toggle switch](https://en.wikipedia.org/wiki/Switch#Toggle_switch) (e.g. a classic light switch) to your device. This way the "software switch" will mirror the state of the "hardware switch". If the real switch is in the "ON" position, the state in Tasmota is `ON` as well.
|
||||
|
||||
**`SwitchMode 2`**
|
||||
#### `SwitchMode 2`
|
||||
|
||||
```Set switch to inverted follow mode (0 = ON, 1 = OFF)```
|
||||
Set switch to inverted follow mode (`0 = ON`, `1 = OFF`)
|
||||
|
||||
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`**
|
||||
#### `SwitchMode 3`
|
||||
|
||||
```Set push-button mode (0 = TOGGLE, 1 = ON (_default_))```
|
||||
Set push-button mode (`0 = TOGGLE`, `1 = ON` (_default_))
|
||||
|
||||
Tasmota will send a `TOGGLE` command when the button is released (opening the circuit). When pressing the button (closing the circuit) nothing will happen. Default state is ON and when pressed it's OFF. (This trigger is known as [falling-edge](https://en.wikipedia.org/wiki/Signal_edge))
|
||||
|
||||
**`SwitchMode 4`**
|
||||
#### `SwitchMode 4`
|
||||
|
||||
```Set inverted push-button mode (0 = OFF (_default_), 1 = TOGGLE)```
|
||||
Set inverted push-button mode (`0 = OFF` (_default_), `1 = TOGGLE`)
|
||||
|
||||
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))
|
||||
|
||||
**`SwitchMode 5`**
|
||||
#### `SwitchMode 5`
|
||||
|
||||
```Set push-button with long press mode (0 = TOGGLE, 1 = ON (_default_), long press = HOLD)```
|
||||
Set push-button with long press mode (`0 = TOGGLE`, `1 = ON` (_default_), `long press = HOLD`)
|
||||
|
||||
Tasmota will send a `TOGGLE` command when the button is released (opening the circuit). When pressing the button (closing the circuit) nothing will happen. Default state is ON and when pressed it's OFF. When held for the time set in `SetOption32` (_default = 4s_), Tasmota sends `HOLD` (use Switch<x>#state=3 in rules).
|
||||
|
||||
**`SwitchMode 6`**
|
||||
#### `SwitchMode 6`
|
||||
|
||||
```Set inverted push-button with long press mode (Default 0 = OFF, 1 = toggle, long press = HOLD)```
|
||||
Set inverted push-button with long press mode (`0 = OFF` (_default_), `1 = TOGGLE`, `long press = HOLD`)
|
||||
|
||||
Tasmota will send a `TOGGLE` command when the button 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. When held for the time set in `SetOption32` (_default = 4s_), Tasmota sends `HOLD` (use Switch<x>#state=3 in rules).
|
||||
|
||||
>Long press or hold can be used in [conjunction with rules](Rule-cookbook#use-long-press-action-on-a-switch) to create additional features or to control another Tasmota device.
|
||||
|
||||
**`SwitchMode 7`**
|
||||
#### `SwitchMode 7`
|
||||
|
||||
```Set toggle push-button mode```
|
||||
Set toggle push-button mode
|
||||
|
||||
Tasmota will send a `TOGGLE` command when pressed and another `TOGGLE` command when released.
|
||||
|
||||
|
@ -112,15 +112,15 @@ Rule1 1
|
|||
|
||||
If you still need to use SwitchTopic or ButtonTopic, read on!
|
||||
|
||||
**`SwitchTopic 0`**
|
||||
#### `SwitchTopic 0`
|
||||
|
||||
> Default option
|
||||
> _Default mode_
|
||||
|
||||
By default a switch controls the corresponding relay and doesn't send any MQTT messages itself.
|
||||
|
||||
No MQTT message will be published on account of the new switch state. The message you see in console is the new state of the relay that is controlled and not the switch state.
|
||||
|
||||
**`SwitchTopic 1`**
|
||||
#### `SwitchTopic 1`
|
||||
|
||||
> Sets MQTT switch topic to device %topic%
|
||||
|
||||
|
@ -134,7 +134,7 @@ When changing the state of the switch an MQTT message is sent to the device topi
|
|||
|
||||
This is the same as sending an MQTT commands to this device, the device relay will be set to the defined state.
|
||||
|
||||
**`SwitchTopic <value>`**
|
||||
#### `SwitchTopic <value>`
|
||||
|
||||
> Set switch topic to a custom topic (32 characters max)
|
||||
|
||||
|
|
Loading…
Reference in New Issue