Updated Rules (markdown)

Michael Ingraham 2019-02-11 10:26:44 -05:00
parent 92a0389934
commit a121c8e12a
1 changed files with 17 additions and 17 deletions

@ -923,7 +923,7 @@ So,
- As an example:
**_[ assuming gpio0 is configured as button1 ]_**
**_[ assuming GPIO0 is configured as Button1 ]_**
And that you want:
@ -942,7 +942,7 @@ rule 1
- Another example:
**_[ assuming gpio0 is configured as button1 ]_**
**_[ assuming GPIO0 is configured as Button1 ]_**
And that you want:
@ -951,35 +951,35 @@ And that you want:
**hold 2 secs**: send another mqtt message
```
buttontopic 0
setoption1 1
setoption11 0
setoption32 20
ButtonTopic 0
SetOption1 1
SetOption11 0
SetOption32 20
rule on button1#state=3 do publish cmnd/topicHOLD/power 2 endon on button1#state=2 do publish cmnd/topicSINGLEPRESS/power 2 endon
rule 1
```
please note that `setoption11 0`.
please note that `SetOption11 0`.
**_SWITCHS WITH 2 DIFFERENT ACTIONS_**
**_SWITCHES WITH 2 DIFFERENT ACTIONS_**
**Switchs do not have double press feature**
**Switches do not have double press feature**
- Example:
**_[ assuming gpio0 is configured as switch1 and that you have a pushbutton connected ]_**
**_[ assuming GPIO0 is configured as Switch1 and that you have a pushbutton connected ]_**
And that you want:
**single press**: do nothing
**hold 2 secs**: toggle relay 1
**single press**: Do nothing
**hold 2 secs**: Toggle relay 1
```
switchtopic1 0
switchmode1 5
setoption32 20
rule on switch1#state=3 do power1 2 endon on switch1#state=2 do delay endon
rule 1
SwitchTopic1 0
SwitchMode1 5
SetOption32 20
Rule on Switch1#State=3 do Power1 2 endon on Switch1#State=2 do Delay endon
Rule 1
```
[BackToExamples](https://github.com/arendst/Sonoff-Tasmota/wiki/Rules#examples)