Updated Rule Cookbook (markdown)

Michael Ingraham 2019-08-03 16:49:59 -04:00
parent a0f1b9e570
commit f717b0ce5a
1 changed files with 2 additions and 6 deletions

@ -1294,15 +1294,12 @@ For example, a remote control with one button to change speed. This rules simula
//Specify the rule set
//The `<trigger>` can be a a condition or an event sent from another device or home automation hub.
//`<topic>` corresponds to the device transmitting the code (e.g., [YTF IR Bridge](YTF-IR-Bridge)). This could also be modified to send an RF code from a [Sonoff RF Bridge](Sonoff-RF-Bridge-433).
// The `Delay` may not be necessary in your environment or can be adjust according to your device characteristics.
```
Rule 1
ON Event#tora DO Publish cmnd/<topic>/IRSend {"Protocol":"NEC","Bits":32,"Data":"0x00FF30CF"} ENDON
ON Event#tora DO Backlog Publish cmnd/<topic>/IRSend {"Protocol":"NEC","Bits":32,"Data":"0x00FF30CF"}; Delay 10 ENDON
ON <trigger> DO Backlog Event tora; Event tora; Event tora ENDON
```
Please note the rule could be quicker than necessary, in this case is advisable to use a delay between events calls:
```
ON <trigger> DO Backlog Event tora; Delay 10; Event tora; Delay 10; Event tora ENDON
```
//Enable the Rule set
```
@ -1310,4 +1307,3 @@ Rule1 1
```
[Back To Top](#top)