From 513ccd9f0b3fe3562fe784a8aa7ddb0d700e3b18 Mon Sep 17 00:00:00 2001 From: blakadder Date: Wed, 20 Feb 2019 15:38:57 +0100 Subject: [PATCH] Updated Commands (markdown) --- Commands.md | 115 ++++++++++++++++------------------------------------ 1 file changed, 34 insertions(+), 81 deletions(-) diff --git a/Commands.md b/Commands.md index a8105619..22204be6 100644 --- a/Commands.md +++ b/Commands.md @@ -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). -Command tables | . | . | . -:---: | :---: | :---: | :---: -[Main](#main) | [MQTT](#mqtt) | [Light](#light) | [Domoticz](#domoticz) -[Management](#management) | [Timers](#timers) | [RF 433Mhz bridge](#sonoff-rf-bridge-433) | [KNX](#knx) -[Sensor](#sensor) | [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) | +| Command tables | | | | +| :---: | :---: | :---: | :---: | +| [Main](#main) | [Sensor](#sensor) | [Light](#light) | [Domoticz](#domoticz) | +| [Management](#management) | [Timers](#timers) | [RF 433Mhz bridge](#sonoff-rf-bridge) | [KNX](#knx) | +| [Wi-Fi](#Wi-Fi) | [SetOption Overview](#setoption-overview) | [IR remote control](#irremote) | [MP3 Player](#mp3-player) | +| [MQTT](#mqtt) | [Power monitoring](#power-monitoring-specific) | [Serial Bridge](#serial-bridge) | | ### Main -Command | Description with options +Command | Parameters ---: | :--- BlinkCount | Number of blinks
`0` = blink many times before restoring power state
`1..32000` = set how many blinks before restoring power state BlinkTime | Time in 0.1 Sec to blink/toggle power for relay
`2..3600` = set BlinkTime with 0.1 seconds increment ButtonDebounce | User control over button debounce timing
`40..1000` = set button debounce time in ms. Default is `40` FanSpeed | Fan speed control *([iFan02](Sonoff-iFan02) module only)*
`0` = turn fan OFF
`1..3` = set fan speed
`+` = increase fan speed
`-` = decrease fan speed
- Interlock | Relay interlock mode and group selection. Introduced in [v6.4.1.11](https://github.com/arendst/Sonoff-Tasmota/pull/5014)
`0` = set self-locking mode for all relays *(default)*
`1` = set interlock mode for selected relays

Add up to 8 relays in 1 to 4 interlock groups, each separated by a space. For example
`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_)
`1,2,3` = group Relay1, Relay2 and Relay3 in a single interlock group
`1 3 2,4` = Relay1 is in group 1, Relay3 in group 2, Relay2 and Relay4 in group 3 + Interlock | Relay interlock mode and group selection. Introduced in [v6.4.1.11](https://github.com/arendst/Sonoff-Tasmota/pull/5014)
`0` = set self-locking mode for all relays *(default)*
`1` = set interlock mode for selected relays + Interlock | Add up to 8 relays in 1 to 4 interlock groups, each separated by a space. For example
`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_)
`1,2,3` = group Relay1, Relay2 and Relay3 in a single interlock group
`1 3 2,4` = Relay1 is in group 1, Relay3 in group 2, Relay2 and Relay4 in group 3 LedPower | LED power state as on or off
`0` = turn LED OFF and LedState OFF
`1` = turn LED ON and LedState OFF
(Use `Backlog LEDPower 0; SetOption31 1` to disable LED even when Wi-Fi or MQTT is not connected) LedState | Manage LED state
`0` = disable use of LED as much as possible
`1` = show power state on LED (LED on when power on) *(inverted for Sonoff Touch/T1)*
`2` = show MQTT subscriptions as a LED blink
`3` = show power state and MQTT subscriptions as a LED blink
`4` = show MQTT publications as a LED blink
`5` = show power state and MQTT publications as a LED blink
`6` = show all MQTT messages as a LED blink
`7` = show power state and MQTT messages as a LED blink
Power\ | Control Relay\ power state, also resetting its PulseTime\
`0` / `off` = turn Relay\'s power OFF
`1` / `on` = turn Relay\'s power ON
`2` / `toggle` = toggle power of Relay\
`3` / `blink` = blink power of Relay\
`4` / `blinkoff` = stop blinking power of Relay\
@@ -141,7 +142,7 @@ Command | Parameters ### Sensor -Command | Description with options +Command | Parameters ---: | :--- Altitude | `-30000..30000` - altitude in meters AmpRes | Current sensor resolution
`0..3` = maximum number of decimal points @@ -161,7 +162,7 @@ See also | [`SetOption8`](#SetOption8) - Show temperature in Celsius *(default ### Wi-Fi -Command | Description with options +Command | Parameters ---: | :--- AP | `0` = switch to other Wi-Fi Access Point
`1`= select Wi-Fi Access Point 1
`2`= select Wi-Fi Access Point 2 Hostname | `1` = reset hostname to `MQTT_TOPIC-<4digits>` and restart
`` = 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
[`SetOption ### MQTT commands -Command | Description with options +Command | Parameters ---: | :--- ButtonRetain | `0` = disable use of MQTT retain flag *(default)*
`1` = enable MQTT retain flag on button press ButtonTopic | `0` = disable use of MQTT button topic
`1` = set MQTT button topic to ``
`2` = set MQTT button topic to firmware default (`MQTT_BUTTON_TOPIC`)
`` = 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} ``` -Command | Description with options +Command | Parameters ---: | --------------------------------------------------------------------------- Latitude | `` = set latitude Longitude | `` = set longitude @@ -251,7 +252,7 @@ Action | `0` = turn output OFF
`1` = turn output ON
`2` = TOGGLE output ### SetOption overview -Command | Description with options +Command | Parameters :---: | :--- SetOption0 | Save power state and use after restart
`0` = disable
`1` = enable *(default)* SetOption1 | Set [button multipress](Control-other-devices) mode to
`0` = allow all button actions *(default)*
`1` = restrict to single, double and hold actions @@ -294,7 +295,7 @@ Command | Description with options ### Power monitoring specific -Command | Description with options +Command | Parameters ---: | :--- AmpRes | Current sensor resolution
`0..3` = maximum number of decimal points CurrentHigh | `0` = disable current high threshold *(default)*
`` = set current high threshold value in miliamps @@ -379,57 +380,22 @@ Command | Parameters SSerialSend4 | `` = send binary data to software serial port. Data in serial response messages is encoded as hex strings. SSerialSend5 | `` = 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 --------------|-------------|--------------------------------------------------------------------------------------------- -SetOption28 | | Enable hex (0) or decimal (1) RF signal receive data representation -RfCode | | Show last send 24-bit user code -RfCode | 1..8388607 | Send 24-bit user code using RfSync, RfLow and RfHigh timing -RfCode | #1..#7FFFFF | Send 24-bit hexadecimal user code using RfSync, RfLow and RfHigh timing -RfHigh | | Show high pulse time in microseconds -RfHigh | 1 | Reset high pulse time to 840 microseconds -RfHigh | 2..32767 | Set high pulse time in microseconds -RfHigh | #2..#7FFF | Set high pulse time in hexadecimal microseconds -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\ | | Send learned or default RF data for RfKey1 to RfKey16 -RfKey\ | 1 | Send default RF data for RfKey1 to RfKey16 using RfSync, RfLow, RfHigh and RfHost parameters -RfKey\ | 2 | Learn RF data for RfKey1 to RfKey16 -RfKey\ | 3 | Unlearn RF data for RfKey1 to RfKey16 -RfKey\ | 4 | Save RF data using RfSync, RfLow, RfHigh and last RfCode parameters -RfKey\ | 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 | \ | (Portisch) Data to be send to RF chip +Command | Parameters +---: | :--- + RfCode | Show last sent 24-bit user code
`1..8388607` = send 24-bit user code
`#1..#7FFFFF` = send 24-bit hexadecimal user code using RfSync, RfLow and RfHigh timing + RfHigh | `1` = reset high pulse time to 840 microseconds
`2..32767` = set high pulse time in microseconds
`#2..#7FFF` = set high pulse time in hexadecimal microseconds + RfHost | Show 16-bit host part of user code
`1` = reset 16-bit host part of user code to 11802 (#2E1A)
`2..32767` = set 16-bit host part of user code
`#2..7FFF` = set 16-bit host part of user code in hexadecimal + RfKey\ | Send learned or default RF data for RfKey\ (x = `1 – 16`)
`1` = send default RF data for RfKey\ using RfSync, RfLow, RfHigh and RfHost parameters
`2` = learn RF data for RfKey\
`3` = unlearn RF data for RfKey\
`4` = save RF data using RfSync, RfLow, RfHigh and last RfCode parameters
`5` = show default or learned RF data + RfLow | `1` = reset low pulse time to 270 microseconds
`2..32767` = set low pulse time in microseconds
`#2..#7FFF` = set low pulse time in hexadecimal microseconds + RfRaw | **This command only works when the firmware has been updated by the provided Portisch firmware in folder tools/fw_efm8bb1**
`0` = Set iTead default firmware support and messages *(default on restart)*
`1` = set Portisch firmware support and messages
`166` or `AAA655` = start sniffing/reading RF signals disabling iTead default RF handling
`167` or `AAA755` = stop sniffing/reading RF signals enabling iTead default RF handling
`168` or `AAA855` = transmiting iTead default RF protocols
`169` or `AAA955` = start sniffing and learning predefined protocols
`176` or `AAB055` = bucket Transmitting using command 0xB0
`177` or `AAB155` = start Bucket sniffing using command 0xB1
`192` or `AAC000C055` = beep (`00C0` is the length of the sound)
`255` or `AAFF55` = show Rf firmware version
`` = hexadecimal data to be sent to RF chip + RfSync | `1` = reset start sync pulse time to 8470 microseconds
`2..32767` = set start sync pulse time in microseconds
`#2..#7FFF` = set start sync pulse time in hexadecimal microseconds +See also | [`SetOption28`](#SetOption28) - Set RF received data format ### 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":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. -| Command | Payload | Description | Version Introduced -| --------|---------------------------|------------------------------------------------------|------------- -| IRsend | | Send IR remote control as JSON encapsulated command. -| | `{"Protocol": "",` | \ 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": 1..(2^32)-1}` | data is the data frame as 32 bit decimal. -| | | -| | `{"Protocol": "",` | \ 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. -| | | -| | \,\,\,.. | Send IR remote control as RAW command. -| | | -| IRhvac | `{"Vendor": "",` | Send IR remote control data to Toshiba, Mitsubishi, LG or Fujitsu HVAC -| | `"Power": <0/1>,` | -| | `"Mode": "",` | -| | `"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 +|Command | Parameters +|---: | :--- +| IRsend | Send IR remote control code as JSON decimal string
`{"Protocol":"","Bits":,"Data":}`
`"Protocol":"NEC"\|"SONY"\|"RC5"\|"RC6"\|"DISH"\|"JVC"\|"PANASONIC"\|"SAMSUNG"`
`"Bits":1..32` = required number of data bits (for PANASONIC the address))
`"Data":1..(2^32)-1` = data frame as 32 bit decimal.
+| | Send IR remote control code as JSON hexadecimal string
`{"Protocol":"","Bits":,"Data":}`
`"Protocol":"NEC"\|"SONY"\|"RC5"\|"RC6"\|"DISH"\|"JVC"\|"PANASONIC"\|"SAMSUNG"`
`"Bits":1..32` = required number of data bits (for PANASONIC the address))
`"Data":0x1..0xFFFFFFFF` = data frame as 32 bit hexadecimal.
+| | Send IR remote control as RAW command
`,,,..` +| IRhvac | Send HVAC IR remote control code as JSON string
`{"Vendor":"","Power":,"Mode":””, "FanSpeed":””,"Temp":}`
`"Vendor":"Toshiba"\|"Mitsubishi"\|"LG"\|"Fujitsu"`
`"Power":0\|1`
`"Mode":"Hot"\|"Cold"\|"Dry"\|"Auto"`
`"FanSpeed":"1"\|"2"\|"3"\|"4"\|"5"\|"Auto"\|"Silence"`
`"Temp":17..30` +| See also | [`SetOption29`](#SetOption29) - Set IR received data format
[`SetOption58`](#SetOption58) - [IR Raw data in JSON message](https://github.com/arendst/Sonoff-Tasmota/issues/2116#issuecomment-440716483) ### MP3 Player