Connect-150 Webhook POST

From I-CubeX Wiki
Revision as of 17:03, 12 January 2018 by Admin (talk | contribs)
Jump to: navigation, search

Connect can output sensor data to the web, for use in IoT (Internet of Things) applications. This enables use of I-CubeX devices to trigger an event on the web using an IoT platform such as IFTTT. The Web field in the digitizer view window requires a Webhook URL address. Connect will send the sensor data using a POST message with a JSON attachment, with one of the following formats:

Analog sensors

{\"value1\":\"<sensor_input_number>\", \"value2\":\"<sensor_parameter_number>\", \"value3\":\"<sensor_parameter_value>\"}

where <sensor_input_number> is any number between 0 and 7 representing the sensor inputs 1 .. 8, and <sensor_parameter> is always 0 since analog sensors only output one parameter, ie. the sensor output voltage.

Digital (I2C) sensors

{\"value1\":\"<sensor_input_number>\", \"value2\":\"<sensor_parameter_number>\", \"value3\":\"<sensor_parameter_value>\", \"value<2 + 2 * sensor_parameter_number>\":\"<sensor_parameter_number>\", \"value<3 + 2 * sensor_parameter_number>\":<sensor_value>\"<sensor_parameter_value>\"}.

where <sensor_input_number> is any number between 0 and 7 representing the sensor inputs 1 .. 8, and <sensor_parameter> is any number between 0 and 15 depending on the method selected for the digital sensor. The method determines how many parameter values the sensor outputs.

When POSTing to the IFTTT IoT platform, the sensor_parameter_number is limited by Connect to 1, since IFTTT doesn't accept a larger JSON attachment.

Use EditorX to configure the digitizer to output a sensor value. Note that sending messages to the web at a high rate, eg. at 100 ms interval could have unexpected or even undesirable results. With EditorX you can configure the digitizer to use eg. the Threshold or Peak signal processing methods to only output a sensor value as a way to trigger an event.