IoT Stadium

API Documentation

Automation

Automation - Add Automation Schedule: Week

Add the automation schedule repeated on which week

Post
https://api.iotstadium.com/ext/automations

Parameter

Field Type Description
schedule Array

Contain the detail about your new schedule automation

schedule.*.type Text

The type of your new schedule automation

schedule.*.start_time Number

The starting time for your schedule automation

schedule.*.end_time Number

The end time for your schedule automation

schedule.*.every_x_week Text

On which week (in a month) your schedule will be repeated

schedule.*.exec_at_day_week Number

On which exact day your schedule will be repeated

actions Array

Contains the detail about the action of your new automation

actions.*.type Text

The action type of your alarm (you can only choose controller)

actions.*.detail Array

The detail about your selected action type

actions.*.detail.*.controller Array

Contain further detail about the controller action

actions.*.detail.*.controller.*.device Number

The ID of the selected device to execute the action

actions.*.detail.*.controller.*.device_action_key Text

The key for the action of the selected device

actions.*.detail.*.controller.*.device_action_value Text

The value for the action of the selected device

name Text

The name for your new controller trigger automation

is_active Number

The condition of your automation

automation_type Text

The automation type that you select

description Text

Description of the new automation

{
    "message": "automation created",
    "data": {
        "id": 1001
    },
    "code": 200
}
{
    "message": "Invalid Message",
    "code": 400,
    "errors": [
        {
            "field": "schedule.every_x_week",
            "message": "The schedule.every x week field is required when schedule.type is weekly."
        },
        {
            "field": "schedule.exec_at_day_week",
            "message": "The schedule.exec at day week field is required when schedule.type is weekly."
        }
    ]
}