node-red-contrib-chronos
Version:
Time-based Node-RED scheduling, repeating, queueing, routing, filtering and manipulating nodes
105 lines (104 loc) • 3.13 kB
JSON
[
{
"id": "671609705841dfab",
"type": "tab",
"label": "Advanced Evaluation",
"disabled": false,
"info": "",
"env": []
},
{
"id": "04b2823017743f50",
"type": "comment",
"z": "671609705841dfab",
"name": "",
"info": "# Expression\nTime filter node with an _expression_ condition that evaluates to true for working hours which are:\n- Monday to Friday from 8:00 to 17:00, and\n- Saturday from 10:00 to 16:00",
"x": 120,
"y": 60,
"wires": []
},
{
"id": "806dd38711a1c66b",
"type": "inject",
"z": "671609705841dfab",
"name": "input message",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "Let's go for work!",
"payloadType": "str",
"x": 160,
"y": 140,
"wires": [
[
"12dbcbe90c02fd14"
]
]
},
{
"id": "12dbcbe90c02fd14",
"type": "chronos-filter",
"z": "671609705841dfab",
"name": "expression",
"config": "5e581578.25c88c",
"baseTime": "",
"baseTimeType": "msgIngress",
"evaluation": "",
"evaluationType": "or",
"conditions": [
{
"operator": "expression",
"expression": "($matchesWeekdays(\t $baseTime,\t {\t \"monday\": true,\t \"tuesday\": true,\t \"wednesday\": true,\t \"thursday\": true,\t \"friday\": true\t }) and $isBetween(\t $baseTime,\t \"time\",\t \"8:00\",\t 0,\t false,\t \"time\",\t \"17:00\",\t 0,\t false\t )\t) or (\t $matchesWeekdays($baseTime, {\"saturday\": true}) and $isBetween(\t $baseTime,\t \"time\",\t \"10:00\",\t 0,\t false,\t \"time\",\t \"16:00\",\t 0,\t false\t )\t)"
}
],
"x": 390,
"y": 140,
"wires": [
[
"1ae9c7a084478411"
]
]
},
{
"id": "1ae9c7a084478411",
"type": "debug",
"z": "671609705841dfab",
"name": "work hours only",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 620,
"y": 140,
"wires": []
},
{
"id": "5e581578.25c88c",
"type": "chronos-config",
"name": "Berlin",
"timezone": "",
"sunPositions": [
{
"angle": -4,
"riseName": "blueHourDawn",
"setName": "blueHourDusk"
},
{
"angle": -8,
"riseName": "blueHourDawnBegin",
"setName": "blueHourDuskEnd"
}
]
}
]