Automation - POST Add Automation Schedule: Week
Add the automation schedule repeated on which week
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 | String |
Does your automation active(1) or not(0) |
description | String |
The automation description |
schedule.type | String |
Schedule type: "weekly" |
schedule.start_time | String |
Start time of the schedule |
schedule.end_time | String |
Start time of the schedule |
schedule.every_x_week | Integer |
Repeat every X weeks (e.g., 2 = every 2 weeks) |
schedule.exec_at_day_week | String |
Day of the week to execute the automation: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" |
actions | Array |
Array of automation actions |
actions[].type | String |
Type of action: "controller" |
actions[].detail.controller.device | Integer |
ID of the device 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": "weekly",
"start_time": "2024-05-31 13:10:00",
"end_time": "2024-06-06 13:10:00",
"every_x_week": 2,
"exec_at_day_week": "wednesday"
},
"actions": [
{
"type": "controller",
"detail": {
"controller": {
"device": 588,
"device_action_key": "2139129123",
"device_action_value": "off"
}
}
}
],
"name": "test schedule weekly postman",
"is_active": 0,
"automation_type": "schedule",
"description": "test schedule weekly"
}
{
"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."
}
]
}