Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. Umrechung Grad in Windrichtung HTML

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Umrechung Grad in Windrichtung HTML

    This topic has been deleted. Only users with topic management privileges can see it.
    • paul53
      paul53 @Alero last edited by

      @Alero

      const idGrad = 'hm-rpc.N.seriennummer.1.WIND_DIR'; // Datenpunkt-ID für Windrichtung in Grad
      const idDir  = 'Wetter.Windrichtung'; // Datenpunkt-Name für Windrichtung
      

      N.seriennummer durch die tatsächlichen Zahlen ersetzen !

      A 1 Reply Last reply Reply Quote 0
      • A
        Alero @paul53 last edited by Alero

        @paul53
        Habs so eingetragen.
        Zeigt aber immer N an obwohl die Wetterstation 130 anzeigt.
        Sollte doch SO sein, oder?

        Gruß
        Alero

        paul53 1 Reply Last reply Reply Quote 0
        • paul53
          paul53 @Alero last edited by

          @Alero sagte:

          Zeigt aber immer N an

          Wird denn getriggert ? Bau zum Test vor setState(idDir, dir, true) ein Log ein:

          log(dp.state.val + ' --> ' + dir);
          
          A 1 Reply Last reply Reply Quote 0
          • A
            Alero @paul53 last edited by Alero

            @paul53
            Hi,
            wenn ich die Objekte unter Javascript.0 gehe sehe ich das der Wert immer aktualisiert wird. Nur die Windrichtung (N) ändert sich nicht.

            Gruß
            Alero

            paul53 1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @Alero last edited by

              @Alero Vielleicht liefert WIND_DIR keine Zahl, was aber bei HomeMatic unwahrscheinlich ist. Füge mal als erstes im Trigger dieses Log ein:

              log(dp.state.val + ' Typ: ' + typeof dp.state.val);
              
              A 1 Reply Last reply Reply Quote 0
              • A
                Alero @paul53 last edited by Alero

                @paul53
                Hi, ist eingetragen.

                const idGrad = 'hm-rpc.2.001858A992B979.WIND_DIR'; // Datenpunkt-ID für Windrichtung in Grad

                const idDir = 'Wetter.Windrichtung'; // Datenpunkt-Name für Windrichtung

                const dirs = ['N','NNO','NO','ONO','O','OSO','SO','SSO','S','SSW','SW','WSW','W','WNW','NW','NNW','N'];

                createState(idDir, 'N', {type: 'string'});

                on(idGrad, function(dp) {'{"time":{"start":"00:00","end":"23:59","mode":"hours","interval":1},"period":{"days":1}}'

                var dir = dirs[Math.floor((dp.state.val + 11.25) / 22.5)];
                log(dp.state.val + ' Typ: ' + typeof dp.state.val);

                setState(idDir, dir, true);

                });


                Komisch, er aktualisiert nicht mehr unter Objekten. letzte Aktualisierung 13:59.

                Gruß
                Alero

                paul53 1 Reply Last reply Reply Quote 0
                • paul53
                  paul53 @Alero last edited by paul53

                  @Alero sagte:

                  er aktualisiert nicht mehr unter Objekten

                  Es wird nur getriggert, wenn sich die Windrichtung ändert. Welche Ausgabe erscheint im Log ?
                  Was ist das ?

                  on(idGrad, function(dp) {'{"time":{"start":"00:00","end":"23:59","mode":"hours","interval":1},"period":{"days":1}}'
                  
                  A 1 Reply Last reply Reply Quote 0
                  • A
                    Alero @paul53 last edited by Alero

                    @paul53
                    habs entfernt. War bestimmt der Grund für das nicht aktualisieren.

                    const idGrad = 'hm-rpc.2.001858A992B979.WIND_DIR'; // Datenpunkt-ID für Windrichtung in Grad

                    const idDir = 'Wetter.Windrichtung'; // Datenpunkt-Name für Windrichtung

                    const dirs = ['N','NNO','NO','ONO','O','OSO','SO','SSO','S','SSW','SW','WSW','W','WNW','NW','NNW','N'];

                    createState(idDir, 'N', {type: 'string'});

                    on(idGrad, function(dp) {

                    var dir = dirs[Math.floor((dp.state.val + 11.25) / 22.5)];
                    log(dp.state.val + ' Typ: ' + typeof dp.state.val);

                    setState(idDir, dir, true);

                    });


                    Im Log vom IOBroker ist nichts dazu gekommen.
                    Oder gibt es noch ein anderes Log?

                    Gruß
                    Alero

                    paul53 1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 @Alero last edited by paul53

                      @Alero sagte:

                      Im Log vom IOBroker ist nichts dazu gekommen.

                      Dann wird auch nicht getriggert. Ändert sich die Windrichtung im Datenpunkt 'hm-rpc.2.001858A992B979.WIND_DIR' (Reiter "Objekte") ?

                      A 1 Reply Last reply Reply Quote 0
                      • A
                        Alero @paul53 last edited by Alero

                        @paul53
                        Hi, der letzte Zeitstempel an der wetterstation selber ist 14:31.36
                        Gruß
                        Alero

                        paul53 1 Reply Last reply Reply Quote 0
                        • paul53
                          paul53 @Alero last edited by paul53

                          @Alero sagte:

                          der letzte Zeitstempel an der wetterstation selber ist 14:36

                          Das spielt keine Rolle. Die Windrichtung (Wert von WIND_DIR) muss sich ändern, damit getriggert wird !!

                          A 1 Reply Last reply Reply Quote 0
                          • A
                            Alero @paul53 last edited by

                            @paul53
                            Also an der Wetterstation ändert sich der wert und die Aktualisierungszeit.
                            Im Javascript nicht.

                            Gruß
                            Alero

                            paul53 1 Reply Last reply Reply Quote 0
                            • paul53
                              paul53 @Alero last edited by paul53

                              @Alero sagte:

                              Im Javascript nicht.

                              Und im Reiter "Objekte" ?

                              Du hast hoffentlich nicht das Skript unter der Gruppe global erstellt ?

                              A 1 Reply Last reply Reply Quote 0
                              • A
                                Alero @paul53 last edited by

                                @paul53
                                Da bin ich ja drin. un unter der Wetterstation ändert sich der Wert und die Zeit. Weiterunten in Objekte steht ja das Java.0 mit Wetter usw. Da wird es nicht aktualisiert.
                                Oder bin ich jetzt völlig falsch?
                                Gruß
                                Alero

                                paul53 1 Reply Last reply Reply Quote 0
                                • paul53
                                  paul53 @Alero last edited by

                                  @Alero sagte:

                                  Oder bin ich jetzt völlig falsch?

                                  Das ist schon richtig.

                                  Das Skript ist aktiv und läuft nicht unter der Gruppe global ?

                                  A 1 Reply Last reply Reply Quote 0
                                  • A
                                    Alero @paul53 last edited by

                                    @paul53
                                    Ich ich stelle immer alle unter common

                                    Gruß
                                    Alero

                                    paul53 2 Replies Last reply Reply Quote 0
                                    • paul53
                                      paul53 @Alero last edited by

                                      @Alero Wenn die ID stimmt

                                      const idGrad = 'hm-rpc.2.001858A992B979.WIND_DIR'; // Datenpunkt-ID für Windrichtung in Grad
                                      

                                      muss auch getriggert werden, also Log-Einträge unter dem Javascript-Editor-Fenster erfolgen.

                                      A 1 Reply Last reply Reply Quote 0
                                      • A
                                        Alero @paul53 last edited by

                                        @paul53
                                        Also habe ein neues Javascript erstellt. (Unter Common)
                                        Im Log welches unter dem Javascript ist (erscheint auch im Log von Iobroker) stehtr folgendes.:
                                        14:53:33.399 info javascript.0 Start javascript script.js.common.Windrichtung
                                        14:53:33.401 info javascript.0 script.js.common.Windrichtung: registered 1 subscription and 0 schedules

                                        1 Reply Last reply Reply Quote 0
                                        • paul53
                                          paul53 @Alero last edited by

                                          @Alero Die ID stimmt nicht: Es fehlt der Kanal 1:

                                          const idGrad = 'hm-rpc.2.001858A992B979.1.WIND_DIR'; // Datenpunkt-ID für Windrichtung in Grad 
                                          
                                          A 1 Reply Last reply Reply Quote 0
                                          • A
                                            Alero @paul53 last edited by

                                            @paul53
                                            hab sie nachgetragen
                                            onst idGrad = 'hm-rpc.2.001858A992B979.1.WIND_DIR'

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            509
                                            Online

                                            31.6k
                                            Users

                                            79.5k
                                            Topics

                                            1.3m
                                            Posts

                                            8
                                            62
                                            4254
                                            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