Updated Commands (markdown)

blakadder 2019-02-20 15:38:57 +01:00
parent 97339604fa
commit 513ccd9f0b
1 changed files with 34 additions and 81 deletions

@ -68,22 +68,23 @@ http://sonoff/cm?user=admin&password=joker&cmnd=Backlog%20Power%20Toggle%3BPower
**Note:** Beside results initiated by a command (synchronous) you can get asynchronous results initiated by rule trigger, telemetry event and other changed device related values. Simply put, results to your commands might be preceded by other messages (for example a `tele/%topic%/STATUS` message that is sent every 300 seconds by default). **Note:** Beside results initiated by a command (synchronous) you can get asynchronous results initiated by rule trigger, telemetry event and other changed device related values. Simply put, results to your commands might be preceded by other messages (for example a `tele/%topic%/STATUS` message that is sent every 300 seconds by default).
Command tables | . | . | . | Command tables | | | |
:---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
[Main](#main) | [MQTT](#mqtt) | [Light](#light) | [Domoticz](#domoticz) | [Main](#main) | [Sensor](#sensor) | [Light](#light) | [Domoticz](#domoticz) |
[Management](#management) | [Timers](#timers) | [RF 433Mhz bridge](#sonoff-rf-bridge-433) | [KNX](#knx) | [Management](#management) | [Timers](#timers) | [RF 433Mhz bridge](#sonoff-rf-bridge) | [KNX](#knx) |
[Sensor](#sensor) | [SetOption Overview](#setoption-overview) | [IR remote control](#irremote) | [MP3 Player](#mp3-player) | [Wi-Fi](#Wi-Fi) | [SetOption Overview](#setoption-overview) | [IR remote control](#irremote) | [MP3 Player](#mp3-player) |
[Wi-Fi](#Wi-Fi) | [Power monitoring](#power-monitoring-specific) | [Serial Bridge](#serial-bridge) | | [MQTT](#mqtt) | [Power monitoring](#power-monitoring-specific) | [Serial Bridge](#serial-bridge) | |
### Main ### Main
Command | Description with options Command | Parameters
---: | :--- ---: | :---
<a id="BlinkCount"> BlinkCount </a> | Number of blinks<BR> `0` = blink many times before restoring power state <BR> `1..32000` = set how many blinks before restoring power state <a id="BlinkCount"> BlinkCount </a> | Number of blinks<BR> `0` = blink many times before restoring power state <BR> `1..32000` = set how many blinks before restoring power state
<a id="BlinkTime"> BlinkTime </a> | Time in 0.1 Sec to blink/toggle power for relay <BR> `2..3600` = set BlinkTime with 0.1 seconds increment <a id="BlinkTime"> BlinkTime </a> | Time in 0.1 Sec to blink/toggle power for relay <BR> `2..3600` = set BlinkTime with 0.1 seconds increment
<a id="ButtonDebounce"> ButtonDebounce </a> | User control over button debounce timing <BR>`40..1000` = set button debounce time in ms. Default is `40` <a id="ButtonDebounce"> ButtonDebounce </a> | User control over button debounce timing <BR>`40..1000` = set button debounce time in ms. Default is `40`
<a id="FanSpeed"> FanSpeed </a> | Fan speed control *([iFan02](Sonoff-iFan02) module only)* <BR>`0` = turn fan OFF <BR> `1..3` = set fan speed <BR> `+` = increase fan speed <BR>`-` = decrease fan speed <BR> <a id="FanSpeed"> FanSpeed </a> | Fan speed control *([iFan02](Sonoff-iFan02) module only)* <BR>`0` = turn fan OFF <BR> `1..3` = set fan speed <BR> `+` = increase fan speed <BR>`-` = decrease fan speed <BR>
<a id="Interlock"> Interlock </a> | Relay interlock mode and group selection. Introduced in [v6.4.1.11](https://github.com/arendst/Sonoff-Tasmota/pull/5014)<BR>`0` = set self-locking mode for all relays *(default)* <BR> `1` = set interlock mode for selected relays<BR><BR>Add up to 8 relays in 1 to 4 interlock groups, each separated by a space. For example<BR> `1,2 3,4` = Group Relay1 and Relay2 in group 1 and Relay3 and Relay4 in group 2 (_note the space between the two group declarations_) <BR> `1,2,3` = group Relay1, Relay2 and Relay3 in a single interlock group <BR>`1 3 2,4` = Relay1 is in group 1, Relay3 in group 2, Relay2 and Relay4 in group 3 <a id="Interlock"> Interlock </a> | Relay interlock mode and group selection. Introduced in [v6.4.1.11](https://github.com/arendst/Sonoff-Tasmota/pull/5014)<BR>`0` = set self-locking mode for all relays *(default)* <BR> `1` = set interlock mode for selected relays
<a id="Interlock"> Interlock </a> | Add up to 8 relays in 1 to 4 interlock groups, each separated by a space. For example<BR> `1,2 3,4` = Group Relay1 and Relay2 in group 1 and Relay3 and Relay4 in group 2 (_note the space between the two group declarations_) <BR> `1,2,3` = group Relay1, Relay2 and Relay3 in a single interlock group <BR>`1 3 2,4` = Relay1 is in group 1, Relay3 in group 2, Relay2 and Relay4 in group 3
<a id="LedPower"> LedPower </a> | LED power state as on or off <BR> `0` = turn LED OFF and LedState OFF <BR> `1` = turn LED ON and LedState OFF<BR>(Use `Backlog LEDPower 0; SetOption31 1` to disable LED even when Wi-Fi or MQTT is not connected) <a id="LedPower"> LedPower </a> | LED power state as on or off <BR> `0` = turn LED OFF and LedState OFF <BR> `1` = turn LED ON and LedState OFF<BR>(Use `Backlog LEDPower 0; SetOption31 1` to disable LED even when Wi-Fi or MQTT is not connected)
<a id="LedState"> LedState </a> | Manage LED state<BR> `0` = disable use of LED as much as possible <BR> `1` = show power state on LED (LED on when power on) *(inverted for Sonoff Touch/T1)*<BR> `2` = show MQTT subscriptions as a LED blink<BR> `3` = show power state and MQTT subscriptions as a LED blink<BR> `4` = show MQTT publications as a LED blink<BR> `5` = show power state and MQTT publications as a LED blink<BR> `6` = show all MQTT messages as a LED blink<BR> `7` = show power state and MQTT messages as a LED blink<BR> <a id="LedState"> LedState </a> | Manage LED state<BR> `0` = disable use of LED as much as possible <BR> `1` = show power state on LED (LED on when power on) *(inverted for Sonoff Touch/T1)*<BR> `2` = show MQTT subscriptions as a LED blink<BR> `3` = show power state and MQTT subscriptions as a LED blink<BR> `4` = show MQTT publications as a LED blink<BR> `5` = show power state and MQTT publications as a LED blink<BR> `6` = show all MQTT messages as a LED blink<BR> `7` = show power state and MQTT messages as a LED blink<BR>
<a id="Power"> Power\<x\> </a> | Control Relay\<x\> power state, also resetting its PulseTime\<x\> <BR> `0` / `off` = turn Relay\<x\>'s power OFF <BR> `1` / `on` = turn Relay\<x\>'s power ON <BR> `2` / `toggle` = toggle power of Relay\<x\> <BR> `3` / `blink` = blink power of Relay\<x\> <BR> `4` / `blinkoff` = stop blinking power of Relay\<x\> <BR> <a id="Power"> Power\<x\> </a> | Control Relay\<x\> power state, also resetting its PulseTime\<x\> <BR> `0` / `off` = turn Relay\<x\>'s power OFF <BR> `1` / `on` = turn Relay\<x\>'s power ON <BR> `2` / `toggle` = toggle power of Relay\<x\> <BR> `3` / `blink` = blink power of Relay\<x\> <BR> `4` / `blinkoff` = stop blinking power of Relay\<x\> <BR>
@ -141,7 +142,7 @@ Command | Parameters
### Sensor ### Sensor
Command | Description with options Command | Parameters
---: | :--- ---: | :---
<a id="Altitude"> Altitude </a> | `-30000..30000` - altitude in meters <a id="Altitude"> Altitude </a> | `-30000..30000` - altitude in meters
<a id="AmpRes"> AmpRes </a> | Current sensor resolution<BR>`0..3` = maximum number of decimal points <a id="AmpRes"> AmpRes </a> | Current sensor resolution<BR>`0..3` = maximum number of decimal points
@ -161,7 +162,7 @@ See also | [`SetOption8`](#SetOption8) - Show temperature in Celsius *(default
### Wi-Fi ### Wi-Fi
Command | Description with options Command | Parameters
---: | :--- ---: | :---
<a id="AP"> AP </a> | `0` = switch to other Wi-Fi Access Point<BR>`1`= select Wi-Fi Access Point 1<BR>`2`= select Wi-Fi Access Point 2 <a id="AP"> AP </a> | `0` = switch to other Wi-Fi Access Point<BR>`1`= select Wi-Fi Access Point 1<BR>`2`= select Wi-Fi Access Point 2
<a id="Hostname"> Hostname </a> | `1` = reset hostname to `MQTT_TOPIC-<4digits>` and restart<BR>`<value>` = set hostname (32 char limit) and restart. If hostname contains `%` it will be reset to the default instead. <a id="Hostname"> Hostname </a> | `1` = reset hostname to `MQTT_TOPIC-<4digits>` and restart<BR>`<value>` = set hostname (32 char limit) and restart. If hostname contains `%` it will be reset to the default instead.
@ -182,7 +183,7 @@ See also | [`SetOption55`](#Setoption55) - mDNS service control<BR>[`SetOption
### MQTT commands ### MQTT commands
Command | Description with options Command | Parameters
---: | :--- ---: | :---
<a id="ButtonRetain"> ButtonRetain </a> | `0` = disable use of MQTT retain flag *(default)*<BR>`1` = enable MQTT retain flag on button press <a id="ButtonRetain"> ButtonRetain </a> | `0` = disable use of MQTT retain flag *(default)*<BR>`1` = enable MQTT retain flag on button press
<a id="ButtonTopic"> ButtonTopic </a> | `0` = disable use of MQTT button topic<BR>`1` = set MQTT button topic to `<topic>`<BR>`2` = set MQTT button topic to firmware default (`MQTT_BUTTON_TOPIC`)<BR>`<value>` = set MQTT button topic (32 chars max) <a id="ButtonTopic"> ButtonTopic </a> | `0` = disable use of MQTT button topic<BR>`1` = set MQTT button topic to `<topic>`<BR>`2` = set MQTT button topic to firmware default (`MQTT_BUTTON_TOPIC`)<BR>`<value>` = set MQTT button topic (32 chars max)
@ -231,7 +232,7 @@ When `Mode 1` or `Mode 2` is used, `Latitude` and `Longitude` become available.
Timer1 {""Arm"":1,""Mode"":2,""Time"":""-2:23"",""Window"":0,""Days"":""11TW11S"",""Repeat"":1,""Output"":1,""Action"":1} Timer1 {""Arm"":1,""Mode"":2,""Time"":""-2:23"",""Window"":0,""Days"":""11TW11S"",""Repeat"":1,""Output"":1,""Action"":1}
``` ```
Command | Description with options Command | Parameters
---: | --------------------------------------------------------------------------- ---: | ---------------------------------------------------------------------------
<a id="Latitude"> Latitude </a> | `<value>` = set latitude <a id="Latitude"> Latitude </a> | `<value>` = set latitude
<a id="Longitude"> Longitude </a> | `<value>` = set longitude <a id="Longitude"> Longitude </a> | `<value>` = set longitude
@ -251,7 +252,7 @@ Action | `0` = turn output OFF<BR> `1` = turn output ON<BR>`2` = TOGGLE output
### SetOption overview ### SetOption overview
Command | Description with options Command | Parameters
:---: | :--- :---: | :---
<a id="SetOption0"> SetOption0 </a> | Save power state and use after restart<BR> `0` = disable<BR> `1` = enable *(default)* <a id="SetOption0"> SetOption0 </a> | Save power state and use after restart<BR> `0` = disable<BR> `1` = enable *(default)*
<a id="SetOption1"> SetOption1 </a> | Set [button multipress](Control-other-devices) mode to<BR> `0` = allow all button actions *(default)*<BR> `1` = restrict to single, double and hold actions <a id="SetOption1"> SetOption1 </a> | Set [button multipress](Control-other-devices) mode to<BR> `0` = allow all button actions *(default)*<BR> `1` = restrict to single, double and hold actions
@ -294,7 +295,7 @@ Command | Description with options
### Power monitoring specific ### Power monitoring specific
Command | Description with options Command | Parameters
---: | :--- ---: | :---
<a id="AmpRes"> AmpRes </a> | Current sensor resolution<BR>`0..3` = maximum number of decimal points <a id="AmpRes"> AmpRes </a> | Current sensor resolution<BR>`0..3` = maximum number of decimal points
<a id="CurrentHigh"> CurrentHigh </a> | `0` = disable current high threshold *(default)*<BR>`<value>` = set current high threshold value in miliamps <a id="CurrentHigh"> CurrentHigh </a> | `0` = disable current high threshold *(default)*<BR>`<value>` = set current high threshold value in miliamps
@ -379,57 +380,22 @@ Command | Parameters
<a id="SSerialSend4"> SSerialSend4 </a> | `<value>` = send binary data to software serial port. Data in serial response messages is encoded as hex strings. <a id="SSerialSend4"> SSerialSend4 </a> | `<value>` = send binary data to software serial port. Data in serial response messages is encoded as hex strings.
<a id="SSerialSend5"> SSerialSend5 </a> | `<value>` = send hex text to software serial port. Data in serial response messages is encoded as hex strings. <a id="SSerialSend5"> SSerialSend5 </a> | `<value>` = send hex text to software serial port. Data in serial response messages is encoded as hex strings.
### Sonoff RF Bridge 433 ### Sonoff RF Bridge
Command | Payload | Description Command | Parameters
-------------|-------------|--------------------------------------------------------------------------------------------- ---: | :---
SetOption28 | | Enable hex (0) or decimal (1) RF signal receive data representation <a id="RfCode"> RfCode </a> | Show last sent 24-bit user code<BR>`1..8388607` = send 24-bit user code<BR>`#1..#7FFFFF` = send 24-bit hexadecimal user code using RfSync, RfLow and RfHigh timing
RfCode | | Show last send 24-bit user code <a id="RfHigh"> RfHigh </a> | `1` = reset high pulse time to 840 microseconds<BR>`2..32767` = set high pulse time in microseconds<BR>`#2..#7FFF` = set high pulse time in hexadecimal microseconds
RfCode | 1..8388607 | Send 24-bit user code using RfSync, RfLow and RfHigh timing <a id="RfHost"> RfHost </a> | Show 16-bit host part of user code<BR>`1` = reset 16-bit host part of user code to 11802 (#2E1A)<BR>`2..32767` = set 16-bit host part of user code<BR>`#2..7FFF` = set 16-bit host part of user code in hexadecimal
RfCode | #1..#7FFFFF | Send 24-bit hexadecimal user code using RfSync, RfLow and RfHigh timing <a id="RfKey"> RfKey\<x\> </a> | Send learned or default RF data for RfKey\<x\> (x = `1 16`)<BR>`1` = send default RF data for RfKey\<x\> using RfSync, RfLow, RfHigh and RfHost parameters<BR>`2` = learn RF data for RfKey\<x\><BR>`3` = unlearn RF data for RfKey\<x\><BR>`4` = save RF data using RfSync, RfLow, RfHigh and last RfCode parameters<BR>`5` = show default or learned RF data
RfHigh | | Show high pulse time in microseconds <a id="RfLow"> RfLow </a> | `1` = reset low pulse time to 270 microseconds<BR>`2..32767` = set low pulse time in microseconds<BR>`#2..#7FFF` = set low pulse time in hexadecimal microseconds
RfHigh | 1 | Reset high pulse time to 840 microseconds <a id="RfRaw"> RfRaw </a> | **This command only works when the firmware has been updated by the provided Portisch firmware in folder tools/fw_efm8bb1**<BR>`0` = Set iTead default firmware support and messages *(default on restart)*<BR> `1` = set Portisch firmware support and messages<BR> `166` or `AAA655` = start sniffing/reading RF signals disabling iTead default RF handling<BR> `167` or `AAA755` = stop sniffing/reading RF signals enabling iTead default RF handling<BR> `168` or `AAA855` = transmiting iTead default RF protocols<BR> `169` or `AAA955` = start sniffing and learning predefined protocols<BR> `176` or `AAB055` = bucket Transmitting using command 0xB0<BR> `177` or `AAB155` = start Bucket sniffing using command 0xB1<BR> `192` or `AAC000C055` = beep (`00C0` is the length of the sound)<BR> `255` or `AAFF55` = show Rf firmware version<BR> `<value>` = hexadecimal data to be sent to RF chip
RfHigh | 2..32767 | Set high pulse time in microseconds <a id="RfSync"> RfSync </a> | `1` = reset start sync pulse time to 8470 microseconds<BR>`2..32767` = set start sync pulse time in microseconds<BR>`#2..#7FFF` = set start sync pulse time in hexadecimal microseconds
RfHigh | #2..#7FFF | Set high pulse time in hexadecimal microseconds See also | [`SetOption28`](#SetOption28) - Set RF received data format
RfHost | | Show 16-bit host part of user code
RfHost | 1 | Reset 16-bit host part of user code to 11802 (#2E1A)
RfHost | 2..32767 | Set 16-bit host part of user code
RfHost | #2..7FFF | Set 16-bit host part of user code in hexadecimal
RfKey\<x\> | | Send learned or default RF data for RfKey1 to RfKey16
RfKey\<x\> | 1 | Send default RF data for RfKey1 to RfKey16 using RfSync, RfLow, RfHigh and RfHost parameters
RfKey\<x\> | 2 | Learn RF data for RfKey1 to RfKey16
RfKey\<x\> | 3 | Unlearn RF data for RfKey1 to RfKey16
RfKey\<x\> | 4 | Save RF data using RfSync, RfLow, RfHigh and last RfCode parameters
RfKey\<x\> | 5 | Show default or learnt RF data
RfLow | | Show low pulse time in microseconds
RfLow | 1 | Reset low pulse time to 270 microseconds
RfLow | 2..32767 | Set low pulse time in microseconds
RfLow | #2..#7FFF | Set low pulse time in hexadecimal microseconds
RfSync | | Show start sync pulse time in microseconds
RfSync | 1 | Reset start sync pulse time to 8470 microseconds
RfSync | 2..32767 | Set start sync pulse time in microseconds
RfSync | #2..#7FFF | Set start sync pulse time in hexadecimal microseconds
With EFM8BB1 RF chip firmware update support (released 20180604) the following commands become useful when the firmware has been updated by the provided Portisch firmware in folder tools/fw_efm8bb1.
Command | Payload | Description
-------------|---------|---------------------------------------------------------------------------
RfRaw | | Show current state. Off for iTead default firmware, On for Portisch firmware support
RfRaw | 0 | (Default on restart) Set iTead default firmware support and messages
RfRaw | 1 | Set Portisch firmware support and messages
RfRaw | 166 or AAA655 | (Portisch) Start sniffing/reading RF signals disabling iTead default RF handling
RfRaw | 167 or AAA755 | (Portisch) Stop sniffing/reading RF signals enabling iTead default RF handling
RfRaw | 168 or AAA855 | (Portisch) Transmiting iTead default RF protocols
RfRaw | 169 or AAA955 | (Portisch) Start sniffing and learning predefined protocols
RfRaw | 176 or AAB055 | (Portisch) Bucket Transmitting using command 0xB0
RfRaw | 177 or AAB155 | (Portisch) Start Bucket sniffing using command 0xB1
RfRaw | 192 or AAC000C055 | (Portisch) Beep - 00C0 is the length of the sound
RfRaw | 255 or AAFF55 | (Portisch) Show Rf firmware version
RfRaw | \<Hexadecimal\> | (Portisch) Data to be send to RF chip
### IRremote ### IRremote
Using IRsend as documented below it is possible to send the same IR code in decimal or hexadecimal notation using the 0x prefix: Using IRsend it is possible to send the same IR code in decimal, hexadecimal and RAW format:
``` ```
IRsend {"Protocol":"NEC","Bits":32,"Data":2170978686} IRsend {"Protocol":"NEC","Bits":32,"Data":2170978686}
IRsend {"Protocol":"NEC","Bits":32,"Data":0x8166817E} IRsend {"Protocol":"NEC","Bits":32,"Data":0x8166817E}
@ -437,26 +403,13 @@ IRsend 0,926,844,958,832,1798,868,902,848,900,870,900,852,908,918,958,794,934,87
``` ```
See [Linux Infrared Remote Control (LIRC)](http://www.lirc.org/) for more information. See [Linux Infrared Remote Control (LIRC)](http://www.lirc.org/) for more information.
| Command | Payload | Description | Version Introduced |Command | Parameters
| --------|---------------------------|------------------------------------------------------|------------- |---: | :---
| IRsend | | Send IR remote control as JSON encapsulated command. |<a id="IRsend"> IRsend </a> | Send IR remote control code as JSON decimal string<BR>`{"Protocol":"<value>","Bits":<value>,"Data":<value>}`<BR>`"Protocol":"NEC"\|"SONY"\|"RC5"\|"RC6"\|"DISH"\|"JVC"\|"PANASONIC"\|"SAMSUNG"`<BR>`"Bits":1..32` = required number of data bits (for PANASONIC the address))<BR>`"Data":1..(2^32)-1` = data frame as 32 bit decimal.<BR>
| | `{"Protocol": "<proto>",` | \<proto\> is NEC, SONY, RC5, RC6, DISH, JVC, PANASONIC or SAMSUNG | | Send IR remote control code as JSON hexadecimal string<BR>`{"Protocol":"<value>","Bits":<value>,"Data":<value>}`<BR>`"Protocol":"NEC"\|"SONY"\|"RC5"\|"RC6"\|"DISH"\|"JVC"\|"PANASONIC"\|"SAMSUNG"`<BR>`"Bits":1..32` = required number of data bits (for PANASONIC the address))<BR>`"Data":0x1..0xFFFFFFFF` = data frame as 32 bit hexadecimal.<BR>
| | `"Bits": 1..32` | bits are the required number of data bits or for PANASONIC the address. | | Send IR remote control as RAW command<BR>`<frequency>,<rawdata1>,<rawdata\>,..`
| | `"Data": 1..(2^32)-1}` | data is the data frame as 32 bit decimal. |<a id="IRhvac"> IRhvac </a> | Send HVAC IR remote control code as JSON string<Br>`{"Vendor":"<value>","Power":<value>,"Mode":”<value>”, "FanSpeed":”<value>”,"Temp":<value>}`<BR>`"Vendor":"Toshiba"\|"Mitsubishi"\|"LG"\|"Fujitsu"`<BR>`"Power":0\|1`<BR>`"Mode":"Hot"\|"Cold"\|"Dry"\|"Auto"`<BR>`"FanSpeed":"1"\|"2"\|"3"\|"4"\|"5"\|"Auto"\|"Silence"` <BR>`"Temp":17..30`
| | | | See also | [`SetOption29`](#SetOption29) - Set IR received data format<BR>[`SetOption58`](#SetOption58) - [IR Raw data in JSON message](https://github.com/arendst/Sonoff-Tasmota/issues/2116#issuecomment-440716483)
| | `{"Protocol": "<proto>",` | \<proto\> is NEC, SONY, RC5, RC6, DISH, JVC, PANASONIC or SAMSUNG
| | `"Bits": 1..32` | bits are the required number of data bits or for PANASONIC the address.
| | `"Data": 0x1..0xFFFFFFFF}` | data is the data frame as 32 bit hexadecimal.
| | |
| | \<frequency\>,\<rawdata1\>,\<rawdata2\>,.. | Send IR remote control as RAW command.
| | |
| IRhvac | `{"Vendor": "<Toshiba/Mitsubishi/LG/Fujitsu>",` | Send IR remote control data to Toshiba, Mitsubishi, LG or Fujitsu HVAC
| | `"Power": <0/1>,` |
| | `"Mode": "<Hot/Cold/Dry/Auto>",` |
| | `"FanSpeed": "<1/2/3/4/5/Auto/Silence>",` |
| | `"Temp": <17..30>}` |
| SetOption29 | | Enable hex (0) or decimal (1) IR signal receive data representation
| SetOption58 | | Enable IR Raw data received in JSON message. See [TASMOTA Issue #2116 (comment)](https://github.com/arendst/Sonoff-Tasmota/issues/2116#issuecomment-440716483) | 6.3.0.11
### MP3 Player ### MP3 Player