Skip to content

Instantly share code, notes, and snippets.

@kumajaya
Created November 2, 2021 16:40
Show Gist options
  • Save kumajaya/af788119a6eaedbc76d9649e84c485b2 to your computer and use it in GitHub Desktop.
Save kumajaya/af788119a6eaedbc76d9649e84c485b2 to your computer and use it in GitHub Desktop.
[
{
"id": "7a898578.d176fc",
"type": "inject",
"z": "540fcd8a.0bd3e4",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "\"01.01.2021 00:00:00\" CET Europe / Berlin",
"payloadType": "str",
"x": 130,
"y": 440,
"wires": [
[
"86cba40c.b8cd88"
]
]
},
{
"id": "aa9c1ae.6d627e8",
"type": "debug",
"z": "540fcd8a.0bd3e4",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 730,
"y": 460,
"wires": []
},
{
"id": "86cba40c.b8cd88",
"type": "function",
"z": "540fcd8a.0bd3e4",
"name": "",
"func": "var tmp = msg.payload.replace(/[\\\"]/g, '');\ntmp = tmp.split(' ');\nmsg.payload = { time:tmp[0] + ' ' + tmp[1], zone1:tmp[2], zone2:tmp[3] + '/' + tmp[5]};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 280,
"y": 440,
"wires": [
[
"b273c32f.3bf96",
"f2b64fad.417fc",
"1cfa153f.b4491b"
]
]
},
{
"id": "b273c32f.3bf96",
"type": "change",
"z": "540fcd8a.0bd3e4",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$moment($.payload.time).tz($$.payload.zone1).format()\t",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 440,
"wires": [
[
"aa9c1ae.6d627e8"
]
]
},
{
"id": "f2b64fad.417fc",
"type": "debug",
"z": "540fcd8a.0bd3e4",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 490,
"y": 400,
"wires": []
},
{
"id": "1cfa153f.b4491b",
"type": "change",
"z": "540fcd8a.0bd3e4",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$moment($.payload.time).tz($$.payload.zone2).format()\t",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 500,
"y": 480,
"wires": [
[
"aa9c1ae.6d627e8"
]
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment