Automation - POST Add Automation Schedule: Minute
Add the automation schedule minutely
Post{{url_iot_backend}}/ext/automations
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
},
Parameter
Field | Type | Description |
---|---|---|
name | String |
Name for your schedule automation |
automation_type | String |
The type of automation (trigger) or (schedule) |
is_active | Integer |
Does your automation active(1) or not(0) |
description | String |
The automation description |
schedule.type | String |
Schedule type: "minutely" |
schedule.start_time | String |
Start time in format: YYYY-MM-DD HH:MM:SS |
schedule.end_time | String |
End time in format: YYYY-MM-DD HH:MM:SS |
schedule.every_x_minute | Integer |
Interval in minutes for the minutely trigger |
actions | Array |
Array of automation actions |
actions[].type | String |
Type of action: "controller" |
actions[].detail.controller.device | Integer |
Device ID to control |
actions[].detail.controller.device_action_key | String |
Action key for the device |
actions[].detail.controller.device_action_value | String |
Value to send |
{
"schedule": {
"type": "minutely",
"start_time": "2024-05-30 08:50:00",
"end_time": "2024-05-31 18:50:00",
"every_x_minute": 25
},
"actions": [
{
"type": "controller",
"detail": {
"controller": {
"device": 588,
"device_action_key": "2139129123",
"device_action_value": "off"
}
}
}
],
"name": "test scheduler minute and hour with active recurring postman",
"is_active": 1,
"automation_type": "schedule",
"description": "test scheduler minute and hour with active recurring"
}
{
"message": "automation created",
"data": {
"id": 989
},
"code": 200
}
{
"message": "Invalid Message",
"code": 400,
"errors": [
{
"field": "schedule.every_x_minute",
"message": "The schedule.every x minute field is required when schedule.type is minutely."
}
]
}
{
"message": "Invalid Message",
"code": 400,
"errors": [
{
"field": "name",
"message": "The name field is required.."
},
{
"field": "is_active",
"message": "The is active field is required.."
},
{
"field": "automation_type",
"message": "The automation type field is required.."
},
{
"field": "schedule.every_x_minute",
"message": "The schedule.every x minute field is required when schedule.type is minutely."
}
]
}