stefanbode / Sonoff-Tasmota

Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE, enhanced with I2C options
GNU General Public License v3.0
127 stars 41 forks source link

rules support: reporting position and direction #111

Closed bjeram closed 5 years ago

bjeram commented 5 years ago

I would like to use rulle with the shutter(s). So I changed the format of the message (FUNC_JSON_APPEND) that is JSON fromat supported by rules mechansim. Biseds I add to the code that it sends out a mqtt message with postion and direction when it stops.

So we can have rules like: when we top moving on SHUTTER-1#direction=0 do ..... endon

on TELE-SHUTTER-1#position>50 do ..... endon

stefanbode commented 5 years ago

Thank you for sharing. I merged without testing.will look into it when back in feb.

bjeram commented 5 years ago

Just a note: by mistake I removed line: 499 DomoticzSensor(DZ_SHUTTER, position); So please put it back.