node-red-contrib-chronos
Version:
Time-based Node-RED scheduling, repeating, queueing, routing, filtering and manipulating nodes
109 lines (108 loc) • 2.77 kB
JSON
[
{
"id": "671609705841dfab",
"type": "tab",
"label": "Custom Repeat",
"disabled": false,
"info": "",
"env": []
},
{
"id": "04b2823017743f50",
"type": "comment",
"z": "671609705841dfab",
"name": "",
"info": "# Custom repeat\nRepeat incoming message every 2.5 seconds in case the property `msg.firstName` equals \"John\" and otherwise every amount of time stored in flow variable `interval`.",
"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": "Repeat me!",
"payloadType": "str",
"x": 160,
"y": 140,
"wires": [
[
"74acc50dfc65cda1"
]
]
},
{
"id": "74acc50dfc65cda1",
"type": "chronos-repeat",
"z": "671609705841dfab",
"name": "",
"config": "5e581578.25c88c",
"mode": "custom",
"interval": 1,
"intervalUnit": "minutes",
"crontab": "*/10 * * * * *",
"customRepetitionType": "jsonata",
"customRepetitionValue": "(firstName = \"John\") ? 2500 : $flowContext(\"interval\")",
"untilType": "nextMsg",
"untilValue": "",
"untilDate": "",
"untilOffset": 0,
"untilRandom": false,
"msgIngress": "forward",
"preserveCtrlProps": false,
"ignoreCtrlProps": false,
"x": 380,
"y": 140,
"wires": [
[
"b7863be942c1cd6c"
]
]
},
{
"id": "b7863be942c1cd6c",
"type": "debug",
"z": "671609705841dfab",
"name": "repeated message",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 610,
"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"
}
]
}
]