Skip to content

Commit

Permalink
Merge branch 'tasmota:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
andySFRD authored Sep 18, 2023
2 parents a840b10 + 5acb0a4 commit cfbacae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ SwitchDebounce<a class="cmnd" id="switchdebounce"></a>|User control over switch
SwitchMode<x\><a class="cmnd" id="switchmode"></a>|[Switch mode](Buttons-and-Switches#switchmode). Index `0` applies to **all** switches.<BR> `0` = toggle *(default)* <BR> `1` = follow (0 = off, 1 = on) <BR> `2` = inverted follow (0 = on, 1 = off) <BR> `3` = pushbutton (default 1, 0 = toggle) <BR> `4` = inverted pushbutton (default 0, 1 = toggle) <BR> `5` = pushbutton with hold (default 1, 0 = toggle, Hold = hold) <BR> `6` = inverted pushbutton with hold (default 0, 1 = toggle, hold = hold) <BR> `7` = pushbutton toggle (0 = toggle, 1 = toggle)<BR> `8` = multi change toggle (0 = toggle, 1 = toggle, 2x change = hold)<BR> `9` = multi change follow (0 = off, 1 = on, 2x change = hold)<BR> `10` = inverted multi change follow (0 = on, 1 = off, 2x change = hold)<BR> `11` = pushbutton with dimmer mode <BR> `12` = inverted pushbutton with dimmer mode <BR> `13` = pushon mode (1 = on, switch off using `PulseTime`)<BR> `14` = inverted pushon mode (0 = on, switch off using `PulseTime`)<BR> `15` = send only an MQTT message on switch change (`tele/tasmota/SENSOR` with payload `{"Time":"2021-01-01T00:00:00","Switch1":"OFF"}`)<BR> `16` = inverted send only an MQTT message on switch change
SwitchText<x\><a class="cmnd" id="switchtext"></a>|Show current JSON label of `Switch<x>` (`1..8`). Only `SwitchText` shows value for all 8 switches<BR>`<text>` - replace default `Switch<x>` label in JSON messages with a custom text<BR>
WebButton<x\><a class="cmnd" id="webbutton"></a>|Change the name of the toggle buttons of the WEB UI. This command accepts spaces in the name
WebQuery<x\><a class="cmnd" id="webquery"></a>|Command for GET, POST, PUT, and PATCH HTTP queries, complete with Request Headers and request body (when applicable)<BR> `<url> GET|POST|PUT|PATCH [<headers>] <body>`<BR>[More information...](https://github.com/arendst/Tasmota/pull/13209)
WebQuery<x\><a class="cmnd" id="webquery"></a>|Command for GET, POST, PUT, and PATCH HTTP queries, complete with Request Headers and request body (when applicable).<BR>`<url> GET|POST|PUT|PATCH [<headers>] <body>`<BR>Note: If a response is needed you must compile your own bin with `#define USE_WEBSEND_RESPONSE`.<BR>`https:` is only supported on ESP32s<BR>[More information...](https://github.com/arendst/Tasmota/pull/13209)
See also|[`SetOption1`](#setoption1) - Set button multipress mode<BR>[`SetOption11`](#setoption11) - Swap pushbutton single and double press functionality<BR>[`SetOption13`](#setoption13) - Allow immediate action on single button press<BR>[`SetOption26`](#setoption26) - Use indexes even when only one relay is present<BR>[`SetOption31`](#setoption31) - Disable Wi-Fi LED status blinking<BR>[`SetOption32`](#setoption32) - Set hold interval before sending `HOLD` action<BR>[`SetOption40`](#setoption40) - Stop detecting any input change on button GPIO<BR>[`SetOption67`](#setoption67) - Enable/Disable Buzzer<BR>[`SetOption73`](#setoption73) - Decouple buttons from controlling power outputs

### Management
Expand Down
16 changes: 13 additions & 3 deletions docs/Matter.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ Keep in mind that many values are in the range `0..254` because `255` is an inva

### Full Example

The example below if theroetical. We will use a Tasmota Relay via `Power1` and map it with rules to a virtual `Light0` type.
The example below implements a simple bridge between Matter and IR (Infra Red). This allows to trigger On/Off commands from the Matter controller, that are translated to On/Off infra-red commands (we use the simple NEC protocol in the example, like used in Magic Home LED strips). You can also received On/Off infra-red commands that are reflected in the virtual light. In reality, you will probably use only Matter-to-IR or IR-to-Matter direction, but it doesn't harm to have both directions implemented.

Note: the example has the sole purpose of showing how virtual devices work. You should use the native mapping to relays.
We will use a Tasmota Relay via `Power1` and map it with rules to a virtual `Light0` type.

**Step 1.** Define one endpoint as `(v) Light 0 On` and give it the name `Light0`.

Expand All @@ -290,10 +290,20 @@ We use `SetOption83 1` to match endpoint name instead of number, which is highly

```
SetOption83 1
Rule1 on mtrreceived#Light0#power do power %value% endon on power1#state do mtrupdate {"name":"Light0","power":%value%} endon
Rule1 on mtrreceived#Light0#power==1 do irsend {"protocol":"nec","bits":32,"data":"0xffb04f"} endon on mtrreceived#Light0#power==0 do irsend {"protocol":"nec","bits":32,"data":"0xfff807"} endon on irreceived#data=0xFFB04F do mtrupdate {"name":"Light0","power":1} endon on irreceived#data=0xFFF807 do mtrupdate {"name":"Light0","power":0} endon
Rule1 1
```

If we decompose the Rule, the first two rule matches convert a Matter initiated command to an IR message, the two last convert an IR message to a Matter state update:

```
Rule1
on mtrreceived#Light0#power==1 do irsend {"protocol":"nec","bits":32,"data":"0xffb04f"} endon
on mtrreceived#Light0#power==0 do irsend {"protocol":"nec","bits":32,"data":"0xfff807"} endon
on irreceived#data=0xFFB04F do mtrupdate {"name":"Light0","power":1} endon
on irreceived#data=0xFFF807 do mtrupdate {"name":"Light0","power":0} endon
```

**Step 3.** Pair Tasmota to the Matter Controller.


Expand Down
2 changes: 2 additions & 0 deletions docs/Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ The value of a `Var<x>` and `Mem<x>` can be:
- %color%
- %deviceid%
- %macaddr%
- %power1% to number of power channels
- %sunrise%
- %sunset%
- %switch1% to number of switch gpios
- %time%
- %timer1% to %timer16%
- %timestamp%
Expand Down

0 comments on commit cfbacae

Please sign in to comment.