Updated PowerOnState Configuration (markdown)

stefanbode 2017-05-16 11:32:18 +02:00
parent f6fc981759
commit 5017458048
1 changed files with 13 additions and 13 deletions

@ -1,11 +1,11 @@
## Predefined PowerOnState functionality
PowerOnState | | Show current relay power on state
PowerOnState | 0 | off | Keep relay(s) off after power on
PowerOnState | 1 | on | Turn relay(s) on after power on
PowerOnState | 2 | toggle | Toggle relay(s) on from last saved
PowerOnState | 3 | (default) Turn relay(s) on as last saved
PowerOnState | 4 | Turn relay(s) on and disable further relay control
`PowerOnState | | Show current relay power on state`
`PowerOnState | 0 | off | Keep relay(s) off after power on`
`PowerOnState | 1 | on | Turn relay(s) on after power on`
`PowerOnState | 2 | toggle | Toggle relay(s) on from last saved`
`PowerOnState | 3 | (default) Turn relay(s) on as last saved`
`PowerOnState | 4 | Turn relay(s) on and disable further relay control`
by DEFAULT the relay(s) will power on with the last saved state on a reboot/restart.
@ -13,23 +13,23 @@ by DEFAULT the relay(s) will power on with the last saved state on a reboot/rest
If MQTT is defined and PowerRetain is used the last state will be stored permanently in MQTT database.
PowerRetain | | Show current MQTT power retain state
PowerRetain | 0 | off | (default) Disable MQTT power retain on status update
PowerRetain | 1 | on | Enable MQTT power retain on status update
`PowerRetain | | Show current MQTT power retain state`
`PowerRetain | 0 | off | (default) Disable MQTT power retain on status update`
`PowerRetain | 1 | on | Enable MQTT power retain on status update`
The stored MQTT message will always **override the PowerOnState!!!**
To check, if there is a value set for the power switch you can use mosquitto_sub
mosquitto_sub -p 1883 -u <username> -P <password> -t hm/setting/#
`mosquitto_sub -p 1883 -u <username> -P <password> -t hm/cmnd/+/power`
hm/setting/# could also something different depending what you have defined as IN folder for commands
hm/cmd/+/power could also something different depending what you have defined as IN folder for commands. "power" needs to be replaced by power1,power2 and so on, if you have more relays or use "hm/cmnd/#". Be aware that MQTT does **NOT SUPPORT **wildcards "hm/cmnd/+/Power?"
#define SUB_PREFIX "cmnd"
`#define SUB_PREFIX "cmnd" `
Now you can see, if there are messages stored that Power ON/OFF and need to be deleted. To delete use:
mosquitto_pub -p 1883 -u <username> -P <password> -d -n -r -t hm/setting/ESP_0C220A/power
`mosquitto_pub -p 1883 -u <username> -P <password> -d -n -r -t hm/cmnd/ESP_0C220C/power`
The -n sends an empty key and the -r store this change permanently