Create a Function to Automate the Process
Functions provide the capability to execute the custom business rules.
In this example, you will use Functions to check the starting motion date and time, and give it a statement to send a mobile notification as an alert.
-
To create a Function, click
.
- Click New Function.
-
Add the Function name as notification.
- In the Code field, enter the code provided in notification_Functions.py. Complete with the information required at the beginning. Complete the PATH with your own values.
-
Add an Event Trigger as follows:
spaces/YourSpaceID/categories/YourCategory/things/YourThingUID/properties/start
When using this method, the function will be invoked whenever there is a change on the Property
start
on the Thing you have created. -
Deploy your Function by clicking Save.
The Function is created. This could take a few minutes. The status of your Function will be updated to a Building status and, eventually, it will become Running. At this point, your Function is ready to be called.