Time basedΒΆ

Description

Trigger events based on time

Devices

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "currentdatetime": {
    "protocol": [ "datetime" ],
    "id": [{
      "longitude": 1.2345,
      "latitude": 12.3456
    }],
    "year": 2015,
    "month": 1,
    "day": 27,
    "hour": 14,
    "minute": 37,
    "second": 8,
    "weekday": 3,
    "dst": 1
  },
  "outsidelight": {
    "protocol": [ "kaku_switch" ],
    "id": [{
      "id": 123456,
      "unit": 0
    }],
    "state": "off"
  }
}

Rule

1
2
3
4
5
6
{
  "christmass-tree-off": {
    "rule": "IF DATE_FORMAT(currentdatetime, %H.%M%S) == 23.0000 THEN switch DEVICE outsidelight TO on AFTER RANDOM(0, 90) MINUTE FOR RANDOM(5, 15) MINUTE",
    "active": 1
  }
}

Changed in version 8.1.0.

1
2
3
4
5
6
{
  "christmass-tree-off": {
    "rule": "IF DATE_FORMAT(currentdatetime, %H%M%S) == 230000 THEN switch DEVICE outsidelight TO on AFTER RANDOM(0, 90) . ' MINUTE' FOR RANDOM(5, 15) . ' MINUTE'",
    "active": 1
  }
}