Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. Daten an wunderground senden

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Daten an wunderground senden

    This topic has been deleted. Only users with topic management privileges can see it.
    • mickym
      mickym Most Active last edited by mickym

      @hafo Ich mache gerade ähnliches mit der AccuWeather - Du kannst Dir das ja mal anschauen. Allerdings frage ich mich gerade für wunderground gibts doch einen iobroker Adapter. Hast Du Dir schon mal angeschaut ?

      Ansonsten kannst ja mal anschauen, was ich gerade mit dem AccuWeather Projekt mache: https://forum.iobroker.net/topic/44684/accuweather-mit-nodered-für-iobroker-verfügbar-machen/2

      Da siehst Du auch ganz generelle - wenn Du die URL hast wie Du in Node Red die HTTP Request Nodes verwendest.

      Du nimmst wie ich in dem Subflow - einfach eine Template Node und kannst dann die URL in die HTTP Node schicken.

      Wie Du den JSON String auseinander nimmst weißt Du? Ansonsten habe ich noch eine Node gebastelt, die Dir das einen JSON in einzelne Nachrichten oder in eine iobroker Stuktur speichern:

      https://forum.iobroker.net/topic/43856/json-string-oder-java-object-in-iobroker-struktur

      H 1 Reply Last reply Reply Quote 0
      • H
        hafo @mickym last edited by

        @mickym Danke für die Antwort. Mein Hauptproblem ist wahrscheinlich dass ich Daten an Wunderground.com senden möchte. Für das abrufen gibt es wirklich einen Adapter, aber zum senden habe ich nichts gefunden.
        Mein Flow sieht aktuell so aus
        1.jpg
        Kann das soweit funktionieren, oder muss ich die beiden Strings zuerst noch zusammenführen? Alternativ könnte ich auch alle Punkte zusammenführen welche ich bereits herausextrahiert habe.
        Ich arbeite mich nun als erstes etwas ins template node ein.

        mickym 1 Reply Last reply Reply Quote 0
        • mickym
          mickym Most Active @hafo last edited by mickym

          @hafo Du arbeitest am besten damit, dass Du die Werte, die verschicken musst in einer Flowvariablen speicherst, am Besten in einem Objekt. Die Eigenschaften dieses Objektes in der Flowvariablen kannst Du dann aus unterschiedlichen Nachrichten speichern.

          Wenn Du verschicken willst, dann lädst Du die Flowvariable wieder in eine Payload und verteilst die Eigenschaften in der Template Node. Nachrichten warten nicht auf Dich.

          Verschicken geht definitiv weder mit einer Websocketout, noch mit einer http out Node, sondern einzig und alleine über die http request Node.

          Die ganzen http oder websocket out Nodes dienen einzig und alleine für Clients, die Dein Node-Red als Webserver ansprechen.

          Ich poste gleich mal Deine URL mit den ersten 3 Variablen. (http://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID="xxx"&PASSWORD="xxx"&dateutc=now&tempf="#tempf#"&humidity="#humidity#"&windspeedmph="#windspeedmph#")

          Das ist alles was Du machen musst - die Inject Node machst Du dann halt alle 12 Stunden:

          9d85c047-da07-4ea5-a40c-a70fd2711e72-image.png

          Hier die Nodes für den Import:

          [
             {
                 "id": "c9b05b51.c64b88",
                 "type": "template",
                 "z": "fa118e30.35a26",
                 "name": "Create URL",
                 "field": "url",
                 "fieldType": "msg",
                 "format": "handlebars",
                 "syntax": "mustache",
                 "template": "http://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=%22xxx%22&PASSWORD=%22xxx%22&dateutc=now&tempf=%22#{{payload.tempf}}#%22&humidity=%22#{{payload.humidity}}#%22&windspeedmph=%22#{{payload.windspeedmph}}#%22",
                 "output": "str",
                 "x": 610,
                 "y": 420,
                 "wires": [
                     [
                         "818e4b2c.4a4228",
                         "d49fc304.cb1a8"
                     ]
                 ]
             },
             {
                 "id": "818e4b2c.4a4228",
                 "type": "debug",
                 "z": "fa118e30.35a26",
                 "name": "",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "url",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 810,
                 "y": 460,
                 "wires": []
             },
             {
                 "id": "d49fc304.cb1a8",
                 "type": "http request",
                 "z": "fa118e30.35a26",
                 "name": "",
                 "method": "GET",
                 "ret": "txt",
                 "paytoqs": false,
                 "url": "",
                 "persist": false,
                 "authType": "",
                 "x": 820,
                 "y": 420,
                 "wires": [
                     []
                 ]
             },
             {
                 "id": "f74fc486.48ef58",
                 "type": "inject",
                 "z": "fa118e30.35a26",
                 "name": "tempf",
                 "props": [
                     {
                         "p": "payload"
                     }
                 ],
                 "repeat": "",
                 "crontab": "",
                 "once": false,
                 "onceDelay": 0.1,
                 "topic": "",
                 "payload": "65",
                 "payloadType": "num",
                 "x": 550,
                 "y": 260,
                 "wires": [
                     [
                         "424f27a8.3e7958"
                     ]
                 ]
             },
             {
                 "id": "13c542b8.196c9d",
                 "type": "inject",
                 "z": "fa118e30.35a26",
                 "name": "humidity",
                 "props": [
                     {
                         "p": "payload"
                     }
                 ],
                 "repeat": "",
                 "crontab": "",
                 "once": false,
                 "onceDelay": 0.1,
                 "topic": "",
                 "payload": "55",
                 "payloadType": "num",
                 "x": 540,
                 "y": 300,
                 "wires": [
                     [
                         "8c5310ac.97a0a"
                     ]
                 ]
             },
             {
                 "id": "1ced602f.570d1",
                 "type": "inject",
                 "z": "fa118e30.35a26",
                 "name": "windspeedmph",
                 "props": [
                     {
                         "p": "payload"
                     }
                 ],
                 "repeat": "",
                 "crontab": "",
                 "once": false,
                 "onceDelay": 0.1,
                 "topic": "",
                 "payload": "15",
                 "payloadType": "num",
                 "x": 530,
                 "y": 340,
                 "wires": [
                     [
                         "878a8da0.736b7"
                     ]
                 ]
             },
             {
                 "id": "424f27a8.3e7958",
                 "type": "change",
                 "z": "fa118e30.35a26",
                 "name": "",
                 "rules": [
                     {
                         "t": "set",
                         "p": "send.tempf",
                         "pt": "flow",
                         "to": "payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 780,
                 "y": 260,
                 "wires": [
                     []
                 ]
             },
             {
                 "id": "8c5310ac.97a0a",
                 "type": "change",
                 "z": "fa118e30.35a26",
                 "name": "",
                 "rules": [
                     {
                         "t": "set",
                         "p": "send.humidity",
                         "pt": "flow",
                         "to": "payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 790,
                 "y": 300,
                 "wires": [
                     []
                 ]
             },
             {
                 "id": "878a8da0.736b7",
                 "type": "change",
                 "z": "fa118e30.35a26",
                 "name": "",
                 "rules": [
                     {
                         "t": "set",
                         "p": "send.windspeedmph",
                         "pt": "flow",
                         "to": "payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 810,
                 "y": 340,
                 "wires": [
                     []
                 ]
             },
             {
                 "id": "d6af3414.4be5b8",
                 "type": "inject",
                 "z": "fa118e30.35a26",
                 "name": "Alle 12 stunden",
                 "props": [
                     {
                         "p": "payload"
                     }
                 ],
                 "repeat": "43200",
                 "crontab": "",
                 "once": false,
                 "onceDelay": 0.1,
                 "topic": "",
                 "payload": "true",
                 "payloadType": "bool",
                 "x": 190,
                 "y": 420,
                 "wires": [
                     [
                         "f37cdb6a.a53528"
                     ]
                 ]
             },
             {
                 "id": "f37cdb6a.a53528",
                 "type": "change",
                 "z": "fa118e30.35a26",
                 "name": "",
                 "rules": [
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "send",
                         "tot": "flow"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 410,
                 "y": 420,
                 "wires": [
                     [
                         "c9b05b51.c64b88"
                     ]
                 ]
             }
          ]
          

          H 1 Reply Last reply Reply Quote 0
          • H
            hafo @mickym last edited by hafo

            @mickym Vielen Dank für deine Hilfe. Mein Flow sieht nun so aus und funktioniert!!! Wie du siehst muss ich einige Daten aus meiner eigenen Wetterstation eifügen.
            1.jpg
            Hast du dir das etwa so vorgestellt? Es ist etwas irritierend dass einige Nodes ins leere laufen aber die Daten dennoch verarbeitet werden.

            mickym 1 Reply Last reply Reply Quote 0
            • mickym
              mickym Most Active @hafo last edited by mickym

              @hafo Nein das passt schon - ist so wie ich es mir vorgestellt habe. So wird immer nach der Datenermittlung der Request gesendet, theoretisch wäre es auch möglich die Trigger nun zeitlich unabhängig zu gestalten. 😉

              Schwärze mal zur Sicherheit in den DebugAusgaben - Deine Authentisierungsangaben. 😉

              H 1 Reply Last reply Reply Quote 0
              • H
                hafo @mickym last edited by

                @mickym so schnell geht das mit den passwörter🤦 genau das wollte ich vermeiden

                mickym 1 Reply Last reply Reply Quote 0
                • mickym
                  mickym Most Active @hafo last edited by

                  @hafo Ich weiß - deswegen habe ich Dich ja darauf aufmerksam gemacht.

                  H 1 Reply Last reply Reply Quote 0
                  • H
                    hafo @mickym last edited by

                    @mickym Ich habe noch eine Frage zum Change Nod. Ich muss die Windrichtung in Grad angeben. Eigentlich eine einfache Sache, N wird durch 0 ersetzt, S durch 180, SSW durch 202.5 usw. Mein Problem ist nun aber dass er bei mehreren Buchstaben z.B NW nicht 315 schreibt, sondern 0270.

                    [
                        {
                            "id": "e2027318.ff3fd8",
                            "type": "change",
                            "z": "632ef6cf.cb9b68",
                            "name": "",
                            "rules": [
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "N",
                                    "fromt": "str",
                                    "to": "0",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "NNE",
                                    "fromt": "str",
                                    "to": "22.5",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "NE",
                                    "fromt": "str",
                                    "to": "45",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "ENE",
                                    "fromt": "str",
                                    "to": "67.5",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "E",
                                    "fromt": "str",
                                    "to": "90",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "ESE",
                                    "fromt": "str",
                                    "to": "112.5",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "SE",
                                    "fromt": "str",
                                    "to": "135",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "SSE",
                                    "fromt": "str",
                                    "to": "157.5",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "S",
                                    "fromt": "str",
                                    "to": "180",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "SSW",
                                    "fromt": "str",
                                    "to": "202.5",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "SW",
                                    "fromt": "str",
                                    "to": "225",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "WSW",
                                    "fromt": "str",
                                    "to": "247.5",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "W",
                                    "fromt": "str",
                                    "to": "270",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "WNW",
                                    "fromt": "str",
                                    "to": "292.5",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "NW",
                                    "fromt": "str",
                                    "to": "315",
                                    "tot": "num"
                                },
                                {
                                    "t": "change",
                                    "p": "payload",
                                    "pt": "msg",
                                    "from": "NNW",
                                    "fromt": "str",
                                    "to": "337.5",
                                    "tot": "num"
                                }
                            ],
                            "action": "",
                            "property": "",
                            "from": "",
                            "to": "",
                            "reg": false,
                            "x": 650,
                            "y": 260,
                            "wires": [
                                [
                                    "5803242.8b8315c",
                                    "5aabce05.21a9f"
                                ]
                            ]
                        }
                    ]
                    

                    Was muss ich ändern damit er in diesem Fall nicht N und W erkennt, sondern NW?
                    Gruss
                    Hansjürg

                    mickym 1 Reply Last reply Reply Quote 0
                    • mickym
                      mickym Most Active @hafo last edited by mickym

                      @hafo Die Reihenfolge ändern. Die Regeln werden von oben nach unten abgearbeitet. Deswegen die spezifischen nach oben (3 Buchstaben, dann 2 Buchstaben, dann 1 Buchstabe). Die erste Regel halt ändern oder die payloads. Und E gegen O ersetzen. 😉

                      Ich habe schon einen Node fertig, da ich mein Icon auch rotieren lasse:

                      [
                          {
                              "id": "5211424a.60543c",
                              "type": "change",
                              "z": "6a421c3f.cc35f4",
                              "name": "set msg.windDirection",
                              "rules": [
                                  {
                                      "t": "set",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "to": "payload.Wind.Direction.English",
                                      "tot": "msg"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "SSW",
                                      "fromt": "str",
                                      "to": "23",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "WSW",
                                      "fromt": "str",
                                      "to": "68",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "WNW",
                                      "fromt": "str",
                                      "to": "113",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "NNW",
                                      "fromt": "str",
                                      "to": "158",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "NNE",
                                      "fromt": "str",
                                      "to": "203",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "ENE",
                                      "fromt": "str",
                                      "to": "248",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "ESE",
                                      "fromt": "str",
                                      "to": "293",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "SSE",
                                      "fromt": "str",
                                      "to": "338",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "SW",
                                      "fromt": "str",
                                      "to": "45",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "NW",
                                      "fromt": "str",
                                      "to": "135",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "NE",
                                      "fromt": "str",
                                      "to": "225",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "SE",
                                      "fromt": "str",
                                      "to": "315",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "S",
                                      "fromt": "str",
                                      "to": "0",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "W",
                                      "fromt": "str",
                                      "to": "90",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "N",
                                      "fromt": "str",
                                      "to": "180",
                                      "tot": "str"
                                  },
                                  {
                                      "t": "change",
                                      "p": "windDirection",
                                      "pt": "msg",
                                      "from": "E",
                                      "fromt": "str",
                                      "to": "270",
                                      "tot": "str"
                                  }
                              ],
                              "action": "",
                              "property": "",
                              "from": "",
                              "to": "",
                              "reg": false,
                              "x": 1140,
                              "y": 3340,
                              "wires": [
                                  [
                                      "b6ff2952.633758"
                                  ]
                              ]
                          }
                      ]
                      
                      H 1 Reply Last reply Reply Quote 0
                      • H
                        hafo @mickym last edited by

                        @mickym wau bist du flink, vielen Dank. Und ich suche stundenlang nach dem richtigen Vorzeichen, Klammer oder was es noch geben könnte.

                        1 Reply Last reply Reply Quote 0
                        • H
                          hafo last edited by

                          Aber weshalb ist bei dir N 180 und S 0? Gemäss dieser Tabelle ist es umgekehrt.

                          mickym 1 Reply Last reply Reply Quote 0
                          • mickym
                            mickym Most Active @hafo last edited by mickym

                            @hafo Ganz einfach weil man beim Wind nicht anzeigt woher er kommt, sondern wohin er bläst-;) Deswegen musst Du alles um 180° ändern.

                            d1b5a201-f212-4870-ad6d-230847301048-image.png

                            Also zeigt der Westwind nach Osten. 😉

                            H 1 Reply Last reply Reply Quote 0
                            • H
                              hafo @mickym last edited by

                              @mickym Klingt logisch. aber zum hochladen werde ich das richtigstellen müssen. Nochmals vielen Dank und bald ein schönes Wochenende.

                              mickym 1 Reply Last reply Reply Quote 0
                              • mickym
                                mickym Most Active @hafo last edited by

                                @hafo Hast Recht - ich hab das natürlich nicht zum Hochladen. Du kannst ja einfach wieder N gegen S und W gegen O bzw. E gegen W tauschen. Dir auch ein schönes WE.

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post

                                Support us

                                ioBroker
                                Community Adapters
                                Donate

                                832
                                Online

                                31.7k
                                Users

                                79.7k
                                Topics

                                1.3m
                                Posts

                                2
                                15
                                677
                                Loading More Posts
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes
                                Reply
                                • Reply as topic
                                Log in to reply
                                Community
                                Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                The ioBroker Community 2014-2023
                                logo