Automation - POST Add Automation Schedule: Month
Add the automation schedule on which month your schedule will be repeated
Post{{url_iot_backend}}/ext/automations
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{token}}"
},
Parameter
Field | Type | Description |
---|---|---|
name | String |
Name of your automation |
automation_type | String |
The type of automation (trigger) or (schedule) |
is_active | String |
Does your automation active(1) or not(0) |
description | String |
The automation description |
schedule.type | String |
Schedule type: "monthly" |
schedule.start_time | String |
Start time of the schedule |
schedule.end_time | String |
End time of the schedule |
schedule.every_x_month | Integer |
Repeat every X months (e.g., 1 = monthly) |
schedule.exec_at_day_month | Integer |
Day of the month to execute the automation (1 - 31) |
actions | Array |
Array of automation actions |
actions[].type | String |
Type of action: "controller" |
actions[].detail.controller.device | Integer |
Type of action: "controller" |
actions[].detail.controller.device_action_key | String |
Action key for the device |
actions[].detail.controller.device_action_value | String |
Value to send |
{
"schedule": {
"type": "monthly",
"start_time": "2024-05-31 13:15:00",
"end_time": "2024-07-31 13:15:00",
"every_x_month": 1,
"exec_at_day_month": 1
},
"actions": [
{
"type": "controller",
"detail": {
"controller": {
"device": 588,
"device_action_key": "2139129123",
"device_action_value": "off"
}
}
}
],
"name": "test schedule monthly",
"is_active": 0,
"automation_type": "schedule",
"description": "test schedule monthly"
}
{
"message": "automation created",
"data": {
"id": 1002
},
"code": 200
}
{
"message": "Invalid Message",
"code": 400,
"errors": [
{
"field": "schedule.every_x_month",
"message": "The schedule.every x month field is required when schedule.type is monthly."
},
{
"field": "schedule.exec_at_day_month",
"message": "The schedule.exec at day month field is required when schedule.type is monthly."
}
]
}