rules = { "main/fan/one": [ { # after the fan has been on 2 times, another fan should be turned on "count": 2, # the amount of times "state": "on", # it has had this state "doTopic": "main/fan/two", # i will send to topic "doMessage": "on", # this message "delay": False, # after this amount of seconds "reset": True, # and i should reset my count afterwards }, { # After the fan is turned off, the next fan should be turned on "count": 4, # the amount of times "state": "off", # it has had this state "doTopic": "main/fan/two", # i will send to topic "doMessage": "on", # this message "delay": 4, # after this amount of seconds "reset": True, # and i should reset my count afterwards }, { # Turn the fan off every time after 1 minute "count": False, # the amount of times. If its false, just do it. "state": "on", # it has had this state "doTopic": "main/fan/three", # i will send to topic "doMessage": "off", # this message "delay": 4, # after this amount of seconds "reset": False, # and i should reset my count afterwards }, { # Turn the fan on every time after 6 minute "count": 3, # the amount of times. If its false, just do it. "state": "on", # it has had this state "doTopic": "main/fan/three", # i will send to topic "doMessage": "off", # this message "delay": 360, # after this amount of seconds "reset": False, # and i should reset my count afterwards }, { # Every 5 minutes, do gesture X "count": 1, "state": "on", "doTopic": "gesture/fan/one", "doMessage": "on", "delay": 5 * 60, "reset": True } ] } gestures = { "hi": { "on": "0", "off": "1", "delay": 1, "multiplier": 0.7, "range": [4, 8] } }