diff --git a/Rules.md b/Rules.md index 2ddfaf1f..021d8189 100644 --- a/Rules.md +++ b/Rules.md @@ -366,6 +366,16 @@ on SI7021#temperature>%var1% do backlog var1 %value%; publish stat/sonoff/temp % on SI7021#temperature<%var2% do backlog var2 %value%; publish stat/sonoff/temp %value%; var1 %value%; add1 2; sub2 2 endon ``` +* Example: Adjust the value of a sensor and send it by MQTT + +This example adds 2 degrees to the measured temperature and then sends that value to a MQTT topic. + +``` +rule +on tele-SI7021#temperature do backlog var1 %value%; add1 2; event sendtemp endon +on event#sendtemp do publish stat/sonoff/temp %var1% endon +``` + ------------------------------------------------------------------------------ #### 9. Simple Thermostat Example