Hi There - I don't suppose there is an easy way to do this, I have 2 messages, one with a start time and one with an end time. I'd like to trigger a response/set a global message if the start and end time are within the current time.. does this make sense? My Node red skills are pretty poor but am trying!
[
{
"id": "14aabb1a.e5d4a5",
"type": "tab",
"label": "Octopus Agile",
"disabled": false,
"info": ""
},
{
"id": "5fbec1e803d8affe",
"type": "exec",
"z": "14aabb1a.e5d4a5",
"command": "python3 C:\\data\\Intelligent.py",
"addpay": false,
"append": "",
"useSpawn": "true",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 800,
"y": 300,
"wires": [
[
"b746e564625d7942"
],
[],
[]
]
},
{
"id": "d9b881bcbf47a662",
"type": "inject",
"z": "14aabb1a.e5d4a5",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 540,
"y": 300,
"wires": [
[
"5fbec1e803d8affe"
]
]
},
{
"id": "9c0e3991c5b122fb",
"type": "debug",
"z": "14aabb1a.e5d4a5",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1770,
"y": 260,
"wires": []
},
{
"id": "b746e564625d7942",
"type": "split",
"z": "14aabb1a.e5d4a5",
"name": "",
"splt": ",",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 1050,
"y": 280,
"wires": [
[
"69a76f6ba6ad1639"
]
]
},
{
"id": "69a76f6ba6ad1639",
"type": "join",
"z": "14aabb1a.e5d4a5",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "num",
"reduceFixup": "",
"x": 1250,
"y": 280,
"wires": [
[
"c7125c80bee630b5",
"e655eb5323e137e4"
]
]
},
{
"id": "c7125c80bee630b5",
"type": "change",
"z": "14aabb1a.e5d4a5",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload[0]",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1440,
"y": 260,
"wires": [
[
"c308d480c5647904"
]
]
},
{
"id": "c308d480c5647904",
"type": "string",
"z": "14aabb1a.e5d4a5",
"name": "",
"methods": [
{
"name": "between",
"params": [
{
"type": "str",
"value": "\"nextRunStart\": \""
},
{
"type": "str",
"value": ":00+00:00\""
}
]
}
],
"prop": "payload",
"propout": "payload",
"object": "msg",
"objectout": "msg",
"x": 1610,
"y": 260,
"wires": [
[
"9c0e3991c5b122fb"
]
]
},
{
"id": "d336940e73599754",
"type": "debug",
"z": "14aabb1a.e5d4a5",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1770,
"y": 320,
"wires": []
},
{
"id": "e655eb5323e137e4",
"type": "change",
"z": "14aabb1a.e5d4a5",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload[1]",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1440,
"y": 320,
"wires": [
[
"0535d0b676e9eac2"
]
]
},
{
"id": "0535d0b676e9eac2",
"type": "string",
"z": "14aabb1a.e5d4a5",
"name": "",
"methods": [
{
"name": "between",
"params": [
{
"type": "str",
"value": " \"nextRunEnd\": \""
},
{
"type": "str",
"value": ":00+00:00\""
}
]
}
],
"prop": "payload",
"propout": "payload",
"object": "msg",
"objectout": "msg",
"x": 1610,
"y": 320,
"wires": [
[
"d336940e73599754"
]
]
},
{
"id": "d92e6fbc84e11bd3",
"type": "inject",
"z": "14aabb1a.e5d4a5",
"name": "Sample returned string from script",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{ \"nextRunStart\": \"2022-11-03 23:30:00+00:00\", \"nextRunEnd\": \"2022-11-04 06:30:00+00:00\", \"timesObj\": [ { \"startDt\": \"2022-11-03 23:30:00+00:00\", \"endDt\": \"2022-11-04 06:30:00+00:00\" } ], \"updatedAt\": \"2022-11-03 21:06:45.308625+00:00\" }",
"payloadType": "str",
"x": 780,
"y": 240,
"wires": [
[
"b746e564625d7942"
]
]
},
{
"id": "4186ce1216c2f68f",
"type": "comment",
"z": "14aabb1a.e5d4a5",
"name": "Splits the string for extracting the paths",
"info": "",
"x": 1150,
"y": 220,
"wires": []
}
]