Invoke the Function
Once the Function is running, it's ready to be invoked.
-
To invoke a Function, create a Trigger by clicking
. 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.
- Click Add.
- In the New Event Trigger panel, enter the Trigger description and Type.
- Under Config, enter the host as mqtt.swx.altairone.com.
- Enter your MQTT username and password same as in Interface tab inside the Thing in AnythingDB or Autogenerate it.
-
Add Topic as follows:
status/Your space name/categories/Your categories name/things/Your thing ID/properties/humidity
- Click Create Trigger.
-
To test the Trigger, update the humidity property to 30.
It will update the humidity_status property. Also, the Invocation count will change to 1.This Trigger points to the property humidity, of the thing “Your Thing ID” that is in the Category “Your category's name” inside the space “Your space name”.
Figure 1.