When a condition within a rule is met, an SMS message or email can be sent from JEDI One. It is also possible to run a program on the platform where JEDI One is installed, using an Action Plugin. These are executable files written in any language available on the platform and can do anything imaginable. JEDI One passes the metrics that triggered the action on stdin, see details at the end of this article. These can be ignored as is the case in the example below. This example turns on an LED attached to a Raspberry Pi GPIO, if the temperature is above 68.
- Place the action plugin in the plugins sub-directory. Here’s an action plugin that is written as a Python script. It toggles GPIO17 on a Raspberry Pi:
- Setup a rule if “Temperature” is greater than 68. Call the action plug in, “actionGPIO.py” with the parameter “On”. This will set a GPIO on the Raspberry Pi to high (1).
- Setup a rule if “Temperature” is less than or equal to 68. Call the action plug in, “actionGPIO.py” with the parameter “Off”. This will set a GPIO on the Raspberry Pi to low (0).