NittyGritty icon

Untitled

NittyGritty | PRO | 05/22/22 12:37:03 PM UTC | 0 ⭐ | 1724 👁️ | Never ⏰ | []
JavaScript |

4.14 KB

|

None

|

0 👍

/

0 👎

[
    {
        "id": "acb26b85.d853b8",
        "type": "function",
        "z": "8bb86979.658488",
        "name": "Aktuelles Wetter ausgeben",
        "func": "// var weather = JSON.parse(msg.payload);\n\n// var SunSet  = new Date(weather.sys.sunset * 1000) ;\n// var SunRise = new Date(weather.sys.sunrise * 1000);\n\nvar SunSet  = new Date(msg.payload.sys.sunset * 1000) ;\nvar SunRise = new Date(msg.payload.sys.sunrise * 1000);\n\n\n\nSunRiseForm = (SunRise.toLocaleTimeString([], {\n    hourCycle: 'h23',\n    hour: '2-digit',\n    minute: '2-digit',\n    second: '2-digit'\n}));\n\nSunSetForm = (SunSet.toLocaleTimeString([], {\n    hourCycle: 'h23',\n    hour: '2-digit',\n    minute: '2-digit',\n    second: '2-digit'\n}));\n\nvar newMsg  = \"Temperatur in \" + msg.payload.name +\n    \" ist \"+((msg.payload.main.temp-273).toFixed(1)) + \"°C.\\r\\n\" + \n    \"Luftdruck in Koßdorf \"+ msg.payload.main.pressure + \"hPa.\\r\\n\" + \n    \"Luftfeuchte in Koßdorf ist \"+ msg.payload.main.humidity + \"%rH.\\r\\n\"+\n    \"Sonnenaufgang ist um  \"  + SunRiseForm + \" Uhr\\r\\n\" + \n    \"Sonnenuntergang ist um \" + SunSetForm + \" Uhr\\r\\n\" \n\nmsg.payload = {}\nmsg.payload.chatId = '1528582458'\nmsg.payload.type = 'message'\nmsg.payload.content = newMsg\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 660,
        "y": 60,
        "wires": [
            [
                "bc410cc.8ffc9f",
                "c077e1ac.8ab92"
            ]
        ]
    },
    {
        "id": "969f682e.9bbe28",
        "type": "http request",
        "z": "8bb86979.658488",
        "name": "OpenWeatherMap API",
        "method": "GET",
        "paytoqs": false,
        "url": "https://api.openweathermap.org/data/2.5/weather?q=Pusemucle,de&appid=<musstdudirbesorgen>",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "credentials": {},
        "x": 380,
        "y": 60,
        "wires": [
            [
                "24f932a.e3a98ce"
            ]
        ]
    },
    {
        "id": "faf93626.968808",
        "type": "inject",
        "z": "8bb86979.658488",
        "name": "Wetter anfordern",
        "repeat": "",
        "crontab": "",
        "once": false,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 60,
        "wires": [
            [
                "969f682e.9bbe28"
            ]
        ]
    },
    {
        "id": "bc410cc.8ffc9f",
        "type": "debug",
        "z": "8bb86979.658488",
        "name": "Ausgabe",
        "active": true,
        "complete": "payload",
        "x": 920,
        "y": 40,
        "wires": []
    },
    {
        "id": "c077e1ac.8ab92",
        "type": "telegram sender",
        "z": "8bb86979.658488",
        "name": "",
        "bot": "69cbe584.7c618c",
        "haserroroutput": false,
        "outputs": 1,
        "x": 930,
        "y": 100,
        "wires": [
            [
                "bc410cc.8ffc9f"
            ]
        ]
    },
    {
        "id": "24f932a.e3a98ce",
        "type": "json",
        "z": "8bb86979.658488",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 520,
        "y": 120,
        "wires": [
            [
                "acb26b85.d853b8"
            ]
        ]
    },
    {
        "id": "69cbe584.7c618c",
        "type": "telegram bot",
        "botname": "<deinBot>",
        "usernames": "<DeinName>",
        "chatids": "1528582458",
        "baseapiurl": "",
        "updatemode": "webhook",
        "pollinterval": "300",
        "usesocks": false,
        "sockshost": "",
        "socksport": "6667",
        "socksusername": "anonymous",
        "sockspassword": "",
        "bothost": "",
        "botpath": "",
        "localbotport": "8443",
        "publicbotport": "8443",
        "privatekey": "",
        "certificate": "",
        "useselfsignedcertificate": false,
        "sslterminated": false,
        "verboselogging": false
    }
]

Comments