From 3ae8680130b0cecbb52f623ed3797b8915093bb7 Mon Sep 17 00:00:00 2001 From: Michael Ingraham <34340210+meingraham@users.noreply.github.com> Date: Thu, 5 Sep 2019 14:51:15 -0400 Subject: [PATCH] SwitchMode is for Switch only --- Buttons-and-Switches.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Buttons-and-Switches.md b/Buttons-and-Switches.md index de24fa9f..5c1cbe28 100644 --- a/Buttons-and-Switches.md +++ b/Buttons-and-Switches.md @@ -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` where `` is the number of your switch or button from GPIO configuration. +To change the behavior of an input peripheral configured as a Tasmota `Switch` 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` component, use `SwitchMode` where `` is the number of your switch from GPIO configuration. + +SwitchMode, as the name implies, applies _**ONLY**_ to GPIO configured in Tasmota as a `Switch` component (9-16 & 82-89). SwitchMode has _**NO**_ impact on the behavior of GPIO configured as `Button` components (17-20, 90-93, & 112-129). SwitchMode is intended to set the desired behavior of a `Switch` 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)```