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:
spaces/{Your space name}/things/{Your thing ID}/properties/led_blink
- Click Create Trigger.
-
To test the Trigger, update led_blink property to
"on"
.The blink_count property is updated. Also, the Invocation count will change to 1.