Тема: Configuriing notifications using remote api
Hi,
If a want a notifications that triggers only on mondays from 1pm to 4 pm, wich parameters do i have to send on the url? I dont understand how "SCH" parameter works.
Вы не вошли. Пожалуйста, войдите или зарегистрируйтесь.
Hi,
If a want a notifications that triggers only on mondays from 1pm to 4 pm, wich parameters do i have to send on the url? I dont understand how "SCH" parameter works.
"sch":{
"f1":<uint>,
"f2":<uint>,
"t1":<uint>,
"t2":<uint>,
"m":<uint>,
"y":<uint>,
"w":<uint>
}
f1 - f2 - time in minutes from 12 am
m, y, w - days of a month, month of a year and day of week in binary system
ex. 1: 2^0=1, 15: 2^14=16384
In your case from 1pm to 4 pm on mondays:
"sch":{
"f1":780,
"f2":0,
"t1":960,
"t2":0,
"m":0,
"y":0,
"w":1
}
Oh thanks! that worked, and in case I want the same but on monday and wednesday?
Days of week in hex representation:
Monday 2^0 = 0x1 = 1
Tuesday 2^1 = 0x2 = 2
Wednesday 2^2 = 0x4 = 4
Thursday 2^3 = 0x8 = 8
Friday 2^4 = 0x10 = 16
Saturday 2^5 = 0x20 = 32
Sunday 2^6 = 0x40 = 64
To select several days of week use binary OR and put obtained value in 'sch.w' param:
Mondays or Wednesdays = 0x1 | 0x4 = 0x5 = 5
"sch":{
"f1":780,
"f2":0,
"t1":960,
"t2":0,
"m":0,
"y":0,
"w":5
}