listeningdaemon/rule-listener/data.py

56 lines
2.1 KiB
Python
Raw Normal View History

2024-10-28 22:32:02 +00:00
rules = {
2024-10-29 13:46:41 +00:00
"main/fan/one": [
2024-10-28 22:32:02 +00:00
{ # 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
2024-10-29 13:46:41 +00:00
"doTopic": "main/fan/two", # i will send to topic
2024-10-28 22:32:02 +00:00
"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
2024-10-29 13:46:41 +00:00
"doTopic": "main/fan/two", # i will send to topic
2024-10-28 22:32:02 +00:00
"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
2024-10-31 16:45:52 +00:00
"doTopic": "main/fan/three", # i will send to topic
2024-10-28 22:32:02 +00:00
"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
2024-10-31 16:45:52 +00:00
"doTopic": "main/fan/three", # i will send to topic
2024-10-28 22:32:02 +00:00
"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",
2024-10-29 13:46:41 +00:00
"doTopic": "gesture/fan/one",
2024-10-28 22:32:02 +00:00
"doMessage": "on",
"delay": 5 * 60,
"reset": True
}
]
}
2024-10-31 16:45:52 +00:00
gestures = {
"hi": {
"on": "0",
"off": "1",
"delay": 1,
"multiplier": 0.7,
"range": [4, 8]
}
}