IOT-ESP32
smartapp.h File Reference

Communicate with SmartThings via our SmartApp. More...

Functions

req_status_t st_configure_device (device_t *)
 Update a local device config from SmartThings. More...
 
uint8_t st_create_device (char *, sensor_type_t)
 Create a device in smartthings of specific type. More...
 
uint8_t st_init_device (char *)
 Initialize a new unconfigured device in SmartThings. More...
 
uint8_t st_send_payload (device_data_t *)
 Send device payload as SmartThings Device Event. More...
 

Detailed Description

Communicate with SmartThings via our SmartApp.

Function Documentation

◆ st_init_device()

uint8_t st_init_device ( char *  )

Initialize a new unconfigured device in SmartThings.

PUT /devices/:device_id

This informas the service of a new device, and any additioanl functionality for defining configuration will be done by the smartapp and notify us.

Returns
uint8_t evaluates boolean

◆ st_create_device()

uint8_t st_create_device ( char *  ,
sensor_type_t   
)

Create a device in smartthings of specific type.

POST /devices {body}

Creates a new device while declaring its type and will be created using that devie type, and immediately usable.

Returns
uint8_t evaluates boolean

◆ st_configure_device()

req_status_t st_configure_device ( device_t )

Update a local device config from SmartThings.

GET /configs/:device_id

Given a new/unconfigured device, query smartthings for the type and configure our record

Returns
uint8_t evaluates boolean

◆ st_send_payload()

uint8_t st_send_payload ( device_data_t *  )

Send device payload as SmartThings Device Event.

POST /devices/:device_id {body}

Parse the entries of a device payload and perform the REST calls to sent the Device Events to SmartThings

Returns
uint8_t evaluates boolean