Difference between revisions of "ESPEasy Event Reference"
Jump to navigation
Jump to search
(Created page with "The rules engine can be used to implement some custom actions based on events. ESP Easy tasks that read sensors will produce events that are run through the engine processor i...") |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | {{WorkInProgress}} | ||
+ | |||
+ | |||
The rules engine can be used to implement some custom actions based on events. ESP Easy tasks that read sensors will produce events that are run through the engine processor in the following format: | The rules engine can be used to implement some custom actions based on events. ESP Easy tasks that read sensors will produce events that are run through the engine processor in the following format: | ||
− | <Taskname>#<ValueName> | + | <Taskname>#<ValueName> |
There will be one event for each reading. When a device reads multiple values like temperature and humidity, it will produce two events. | There will be one event for each reading. When a device reads multiple values like temperature and humidity, it will produce two events. | ||
Line 7: | Line 10: | ||
So if you have a task with the name "DHT11-Outside" and the default valuenames, there will be these events: | So if you have a task with the name "DHT11-Outside" and the default valuenames, there will be these events: | ||
− | DHT11-Outside#Temperature | + | DHT11-Outside#Temperature |
− | DHT11-Outside#Humidity | + | DHT11-Outside#Humidity |
− | Besides the task generated events, there can be other system events | + | Besides the task generated events, there can be other system events or events that are generated using the rules engine: |
Line 31: | Line 34: | ||
|- | |- | ||
| Clock#Time | | Clock#Time | ||
− | | Triggered every minute | + | | Triggered every minute with day and time like: Mon,12:30 or Tue,14:45. You can define triggers on specific days or all days using "All" for days indicator. You can also use wildcards in the time setting like All,**:00 to run every hour. |
| on Clock#Time=All,12:00<BR>gpio 2,1<BR>endon | | on Clock#Time=All,12:00<BR>gpio 2,1<BR>endon | ||
|- | |- |
Latest revision as of 15:48, 22 October 2016
You may hear some construction noise in the background...
The rules engine can be used to implement some custom actions based on events. ESP Easy tasks that read sensors will produce events that are run through the engine processor in the following format:
<Taskname>#<ValueName>
There will be one event for each reading. When a device reads multiple values like temperature and humidity, it will produce two events.
So if you have a task with the name "DHT11-Outside" and the default valuenames, there will be these events:
DHT11-Outside#Temperature DHT11-Outside#Humidity
Besides the task generated events, there can be other system events or events that are generated using the rules engine:
Event | Detailed info | Sample |
---|---|---|
<taskname>#<valuename> | Each task can produced one or more events, one each for each measured value | on DHT11-Outside#Temperature>20 gpio 2,1 endon |
System#Boot | Triggered at boot time | on System#Boot gpio 2,1 timerSet 1,30 endon |
System#Sleep | Triggered just before the ESP goes to deep sleep | on System#Sleep gpio 2,0 endon |
Clock#Time | Triggered every minute with day and time like: Mon,12:30 or Tue,14:45. You can define triggers on specific days or all days using "All" for days indicator. You can also use wildcards in the time setting like All,**:00 to run every hour. | on Clock#Time=All,12:00 gpio 2,1 endon |
Rules#Timer | Triggered when a rules timer ends | on Rules#Timer=1 gpio 2,1 endon |