31.03.2025, 07:54
Code:
webrequest = require('webrequest')
data = {
value = '0', -- value to send
scheduler = 1, -- parent scheduler ID
name = 'new event',
active = 'on', -- 'on' or 'off'
type = '', -- '' (run at specific time), 'sunrise' or 'sunset'
start_hour = 13, -- only for run at specific time
start_min = 0, -- only for run at specific time
offset_hour = -1, -- only for 'sunrise' or 'sunset'
offset_min = 30, -- only for 'sunrise' or 'sunset'
year = 0, -- 0 = all years, specific year otherwise
months = '111111111111', -- Jan to Dec, 1 = on, 0 = off
daysofmonth = '1111111111111111111111111111111', -- 1..31, 1 = on, 0 = off
daysofweek = '1111111', -- Monday to Sunday, 1 = on, 0 = off
dayweeknrs = '111111', -- week 1 to 5 in month, 6th value = Last week of the month, 1 = on, 0 = off
holidays = '', -- '' (don't care), 'y' (run on holidays), 'n' (don't run on holidays)
}
res, err = webrequest('schedulers', 'events-save', { data = data })
log(res, err)