Invoke the Function

Once the Function is running, it's ready to be invoked.

  1. To invoke a Function, create a Trigger by clicking User Functions > Trigger.
    Note: A Trigger is a component that is capable of invoking serverless Functions from an event source. A Trigger works as a listener to a particular endpoint.
  2. Click Add.
  3. In the New Event Trigger panel, enter the Trigger description and Type.
  4. Under Config, enter the host as mqtt.swx.altairone.com.
  5. Enter your MQTT username and password same as in Interface tab inside the Thing in AnythingDB or Autogenerate it.
  6. Add Topic as follows:
    spaces/YourSpaceID/categories/YourCategory/things/YourThingUID/properties/start
  7. Click Create Trigger.
  8. To test the Trigger, update the start property to a date-time value considered in the condition.
    It will invoke the Function and send you a mobile phone notification including the updated date-time value .
    Figure 1. Notification sample for the motion alert