mirror of https://github.com/arendst/Tasmota.git
Updated PowerOnState Configuration (markdown)
parent
2c3152f8a7
commit
8c04b00f1d
|
@ -1,17 +1,3 @@
|
|||
## Predefined PowerOnState functionality
|
||||
|
||||
| | |
|
||||
|-|-|
|
||||
|[`PowerOnState`](Commands#poweronstate) | Control relay state after _**powering up**_ the device.<BR> `0` / `OFF` = keep relay(s) OFF after power up <BR> `1` / `ON` = turn relay(s) ON after power up <BR> `2` / `TOGGLE` = toggle relay(s) from last saved state <BR> `3` = switch relay(s) to their last saved state *(default)* <BR> `4` = turn relay(s) ON and disable further relay control <BR> `5` = after a `PulseTime` period turn relay(s) ON (acts as inverted [`PulseTime`](Commands#pulsetime) mode)|
|
||||
|
||||
The `PowerOnState` device configuration parameter is applied when the device is initially powered up. _It does not apply to device warm restarts_.
|
||||
|
||||
Tasmota tracks the relays' state in a masked variable. A set bit (`1`) means the corresponding **relay** is turned ON. The associated GPIO state will be high or low according to whether the relay is configured as `Relay<x>` or `Relay<x>i`. Every command for setting the relay state is "recorded" in the variable and saved to flash (depending on [`SetOption0`](Commands#setoption0)). The setting of the relay GPIO is then executed.
|
||||
|
||||
After a **_warm restart_**, the mask variable is re-initialised with the saved state from flash and the relay(s) set to that state. `PowerOnState` is not executed. During any a device restart, the relay power feedback state is scanned according to the setting of [`SetOption63`](Commands#setoption63). Scanning the relay state attempts to READ from GPIOs that are configured as relays, i.e., OUTPUTS! The result will not always be what is expected as it depends on how the device relays are wired to the GPIO. `SetOption63` was introduced to make this scan optional. With `SetOption63` set to `0` (the default), each GPIO assigned as a `Relay<x>` or `Relay<x>i` is scanned using _'digitalRead'_. The mask variable will be updated with the detected values. The state of the relay(s) will not be changed. READING from an OUTPUT GPIO may result in the mask value being different from the state the relays are in. Thus, `SetOption63` was introduced to disable the startup scan for devices where the scan leads to undefined results.
|
||||
|
||||
`SetOption63` is executed after `PowerOnState` or restart initialization.
|
||||
|
||||
## Side effects with using MQTT messages
|
||||
|
||||
If MQTT is defined and [`PowerRetain`](Commands#powerretain) is used the last state will be stored permanently in MQTT database.
|
||||
|
@ -32,4 +18,18 @@ You can use [Tasmota Device Manager](https://github.com/jziolkowski/tdm) to clea
|
|||
or use the following tutorials/forum threads:
|
||||
* [Clearing retained messages with mosquitto](https://community.openhab.org/t/clearing-mqtt-retained-messages/58221)
|
||||
* [Remove retained messages in Home Assistant](https://community.home-assistant.io/t/mqtt-how-to-remove-retained-messages/79029)
|
||||
* [Remove retained messages in hass.io MQTT addon](https://community.home-assistant.io/t/clear-hass-io-mosquitto-broker-add-on-retain-messages/57250/3)
|
||||
* [Remove retained messages in hass.io MQTT addon](https://community.home-assistant.io/t/clear-hass-io-mosquitto-broker-add-on-retain-messages/57250/3)
|
||||
|
||||
## Predefined PowerOnState functionality
|
||||
|
||||
| | |
|
||||
|-|-|
|
||||
|[`PowerOnState`](Commands#poweronstate) | Control relay state after _**powering up**_ the device.<BR> `0` / `OFF` = keep relay(s) OFF after power up <BR> `1` / `ON` = turn relay(s) ON after power up <BR> `2` / `TOGGLE` = toggle relay(s) from last saved state <BR> `3` = switch relay(s) to their last saved state *(default)* <BR> `4` = turn relay(s) ON and disable further relay control <BR> `5` = after a `PulseTime` period turn relay(s) ON (acts as inverted [`PulseTime`](Commands#pulsetime) mode)|
|
||||
|
||||
The `PowerOnState` device configuration parameter is applied when the device is initially powered up. _It does not apply to device warm restarts_.
|
||||
|
||||
Tasmota tracks the relays' state in a masked variable. A set bit (`1`) means the corresponding **relay** is turned ON. The associated GPIO state will be high or low according to whether the relay is configured as `Relay<x>` or `Relay<x>i`. Every command for setting the relay state is "recorded" in the variable and saved to flash (depending on [`SetOption0`](Commands#setoption0)). The setting of the relay GPIO is then executed.
|
||||
|
||||
After a **_warm restart_**, the mask variable is re-initialised with the saved state from flash and the relay(s) set to that state. `PowerOnState` is not executed. During any a device restart, the relay power feedback state is scanned according to the setting of [`SetOption63`](Commands#setoption63). Scanning the relay state attempts to READ from GPIOs that are configured as relays, i.e., OUTPUTS! The result will not always be what is expected as it depends on how the device relays are wired to the GPIO. `SetOption63` was introduced to make this scan optional. With `SetOption63` set to `0` (the default), each GPIO assigned as a `Relay<x>` or `Relay<x>i` is scanned using _'digitalRead'_. The mask variable will be updated with the detected values. The state of the relay(s) will not be changed. READING from an OUTPUT GPIO may result in the mask value being different from the state the relays are in. Thus, `SetOption63` was introduced to disable the startup scan for devices where the scan leads to undefined results.
|
||||
|
||||
`SetOption63` is executed after `PowerOnState` or restart initialization.
|
||||
|
|
Loading…
Reference in New Issue