[
{
"id": "890ea8cb.4e8e78",
"type": "inject",
"z": "5a11cc5.689e934",
"name": "Heute",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 130,
"y": 140,
"wires": [
[
"acff889d.7e7018"
]
]
},
{
"id": "acff889d.7e7018",
"type": "http request",
"z": "5a11cc5.689e934",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": false,
"url": "http://api.sunrise-sunset.org/json?lat=48.8&lng=8.97&date=today&formatted=0",
"tls": "",
"proxy": "",
"x": 330,
"y": 140,
"wires": [
[
"ae22c280.9564d"
]
]
},
{
"id": "9f29b4fc.89b898",
"type": "debug",
"z": "5a11cc5.689e934",
"name": "SunRise-SunSet",
"active": true,
"console": "false",
"complete": "payload",
"x": 1070,
"y": 120,
"wires": []
},
{
"id": "ae22c280.9564d",
"type": "function",
"z": "5a11cc5.689e934",
"name": "",
"func": "var EspEasy=JSON.parse(msg.payload);\n\nSun_Rise = {payload:Date.parse(EspEasy.results.sunrise)};\nSun_Set = {payload:Date.parse(EspEasy.results.sunset)};\n\n// var seconds = msg.payload;\n// convert to microseconds\n// msg.payload = seconds * 1000;\n\nDuration = {payload:(EspEasy.results.day_length)*1000};\nreturn [Sun_Rise, Sun_Set, Duration];",
"outputs": "3",
"noerr": 0,
"x": 510,
"y": 160,
"wires": [
[
"578b9378.c5734c",
"aad2e005.32f7d"
],
[
"578b9378.c5734c",
"aad2e005.32f7d"
],
[
"21390d1a.51ec02"
]
]
},
{
"id": "578b9378.c5734c",
"type": "moment",
"z": "5a11cc5.689e934",
"name": "",
"topic": "",
"input": "",
"inputType": "msg",
"inTz": "ETC/GMT",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "dddd, DD. MMMM YYYY HH:mm:ss Z",
"locale": "de_DE",
"output": "",
"outputType": "msg",
"outTz": "Europe/Berlin",
"x": 820,
"y": 120,
"wires": [
[
"9f29b4fc.89b898"
]
]
},
{
"id": "aad2e005.32f7d",
"type": "function",
"z": "5a11cc5.689e934",
"name": "",
"func": "var d = new Date(msg.payload);\nmsg = {payload:new Date(msg.payload)};\nnode.status({fill:\"blue\",shape:\"ring\",text:\"var d: \" + d });\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 770,
"y": 160,
"wires": [
[
"b87080d3.390c8"
]
]
},
{
"id": "b87080d3.390c8",
"type": "debug",
"z": "5a11cc5.689e934",
"name": "NewDate",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 1040,
"y": 160,
"wires": []
},
{
"id": "5c636ca4.9d6fd4",
"type": "inject",
"z": "5a11cc5.689e934",
"name": "Morgen",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 130,
"y": 200,
"wires": [
[
"e0c9788b.8be288"
]
]
},
{
"id": "e0c9788b.8be288",
"type": "http request",
"z": "5a11cc5.689e934",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": false,
"url": "http://api.sunrise-sunset.org/json?lat=48.8&lng=8.97&date=tomorrow&formatted=0",
"tls": "",
"proxy": "",
"x": 330,
"y": 200,
"wires": [
[
"ae22c280.9564d"
]
]
},
{
"id": "71347c15.a461b4",
"type": "debug",
"z": "5a11cc5.689e934",
"name": "Tagesdauer",
"active": true,
"console": "false",
"complete": "payload",
"x": 1050,
"y": 220,
"wires": []
},
{
"id": "21390d1a.51ec02",
"type": "moment",
"z": "5a11cc5.689e934",
"name": "",
"topic": "",
"input": "",
"inputType": "msg",
"inTz": "ETC/GMT",
"adjAmount": 0,
"adjType": "days",
"adjDir": "add",
"format": "HH:mm:ss",
"locale": "de_DE",
"output": "",
"outputType": "msg",
"outTz": "ETC/GMT",
"x": 820,
"y": 220,
"wires": [
[
"71347c15.a461b4"
]
]
}
]
Comments