Triggering Events from the device

If something happens on your device that should initiate some external activity like starting an Action logic or informing Alexa you would send a special ChipChop triggerevent command.

Trigger events execute immediately and have priority over heartbeats (you don't want to be waiting 10 seconds to be notified that someone has pressed the doorbell button!)
If applicable a Trigger Event will send a "ChangeReport" notification to Alexa immediately so it can initiate any Alexa routines even before starting any ChipChop Actions logic.

A triggerevent is sent in the same format as a heartbeat with certain rules applied:
  • Only the status of one component can be sent at a time
  • Maxiumum of 10 Trigger Events per minute can be sent
  • Trigger Events can be sent in "bursts" with 500 milliseconds appart but not exceeding 10 events a minute
  • Must not be used as a replacement for a heartbeat and excessive use could result in your account getting suspended or even a full ban from the platform


Sending a triggerevent
The device "triggerevent" is nothing more than a JSON formatted string containing some properties that you send when something important happens.

You can also find examples for every device and its component in the Dev Console > Devices
Here is a "triggerevent" JSON example sent by a device: {"api_call":"heartbeat","command":"triggerevent","uuid":"ChpChpUsRf5c40b64c03f0b607ae9b51a3803","device_id":"0000001","status":{"motion_sensor":{"value":"DETECTED"}}
On success you should receive a response from ChipChop {"status":"OK","timestamp":1668870714611}

Triggerevent JSON explained
api_call
Should be set as:
heartbeat
command
Should be set as:
triggerevent
uuid
Your ChipChop UUID
You can find your UUID in the Dev Console > My Account
device_id
Device ID as you have set it in the Dev Console > Devices
status
JSON object containing the status of only one component that you have specified in the Dev Console

{"motion_sensor":{"value":"DETECTED"}}

The "value" property can be either a string or a number so pay attention when using quotes. Incorrectly formatted JSON will be rejected by ChipChop.