Ankündigung

Einklappen
Keine Ankündigung bisher.

KNX node for node-red

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    #31
    Hi TheMax74,

    you KNX-ultimate Node is just awesome.
    I am currently working on receiving several Data from openweathermap to My KNX.
    I am struggling with the Sunset datapoint.
    OWM offers the Sunset as
    Code:
    [LIST][*]sys.sunset Sunset time, unix, UTC[/LIST]
    , See https://openweathermap.org/current

    I would like to have the local sunset Time at KNX.
    I used your example [/URL]https://github.com/Supergiovane/node...ateTime-to-BUS
    https://openweathermap.org/current" to send the unixtime to KNX via DPT 10.001- unfortunatly not in local time.

    What way do you recommend to convert UTC unixtime to local timezone and send that via your node to KNX?
    can I use the js DateObject Functions (
    https://developer.mozilla.org/de/doc...caleDateString)

    kind regards
    Alex
    Gruß
    alexbeer

    Kommentar


      #32
      Schau mal dazu node-red-contrib-moment an.
      Winston Churchill hat mal gesagt: "Ein kluger Mann macht nicht alle Fehler selbst. Er gibt auch anderen eine Chance.“

      Kommentar


        #33
        Zitat von alexbeer Beitrag anzeigen
        Hi TheMax74,

        ...X via DPT 10.001- unfortunatly not in local time.

        What way do you recommend to convert UTC unixtime to local timezone and send that via your node to KNX?
        can I use the js DateObject Functions (
        https://developer.mozilla.org/de/doc...caleDateString)

        kind regards
        Alex
        Hello Alex
        Thank you for using my node.
        try this in a function Node. Please replace "Rome" with your current city of reference and “new Date” with wheater service’s datevalue.

        For DATE:
        return {payload:new Date().toLocaleDateString('it-IT',
        {year:"2-digit",
        month:"2-digit",
        day:"2-digit",
        timeZone: 'Europe/Rome'})}

        For TIME:
        return {payload:new Date().toLocaleTimeString('it-IT',
        {hour: '2-digit', hour12: false,
        minute: '2-digit',
        second: '2-digit',
        timeZone: 'Europe/Rome'})}

        But the xrk solution may work better.
        Zuletzt geändert von TheMax74; 05.01.2020, 11:01.

        Kommentar


          #34
          Thanks for quick Response.
          Have Not tried IT yet. Will it be still possible to send a Date-String to KNX DPT 10.001 instead of a Unixtime?
          Gruß
          alexbeer

          Kommentar


            #35
            Knx-ultimate accepts string as datetime, so yes.

            Kommentar


              #36
              Hi,

              I tried the following:

              Code:
              var unix_timestamp = {payload: msg.payload.sunset}; // i.e.: unix_timestamp = 1578238021
              
              dateObj = new Date(unix_timestamp * 1000); // timestamp in  ms
              
              return {payload: dateObj.toLocaleTimeString('de-DE',
              {hour: '2-digit', hour12: false,
              minute: '2-digit',
              second: '2-digit',
              timeZone: 'Europe/Berlin'})}
              As a result I do receive: "Invalid Date" - something seems to be wrong with the declaration of dateObj.
              What do I miss?
              Gruß
              alexbeer

              Kommentar


                #37
                Hello Alex
                unable to try now with my pc, but try to replace

                var unix_timestamp = {payload: msg.payload.sunset};

                with

                var unix_timestamp = msg.payload.sunset;

                Kommentar


                  #38
                  Thanks, that is the solution!
                  Gruß
                  alexbeer

                  Kommentar


                    #39
                    Alex,
                    if i can assist you more in the javascript programming, feel free to ask and wellcome into this wonderful world.

                    Kommentar


                      #40
                      Zitat von TheMax74 Beitrag anzeigen
                      if i can assist you more in the javascript programming, feel free to ask and wellcome into this wonderful world.
                      i have a question.

                      i have two function nodes on the Exit of the Hue with following Code:

                      Node1:
                      return {payload: msg.payload.on};

                      Node2:
                      return {payload: msg.payload.brightness};

                      Is it possible to have this in one function with two outputs. In the settings of the function node I can select how many outputs I need.


                      Gruß
                      Thorsten

                      Meine Installation: EFH mit EIB und Powernet; BJ Triton RTR 5fach; BJ Triton 3/5fach; BJ Wave Fenstermelder; Gira HS; Gira SmartSensor; Gira TK mit Fingerprint und TK-Gateway, Agfeo AS30 mit ST40IP; Dialogic Touch 15" mit Homecockpit und Schnittstelle zur Gira TK-Anlage; ipod Touch 1G und iphone 3G mit WHD iphone Docking-Station; Dreambox 7000; Kathrein UFS 910; Beleuchtung über DALI gesteuert

                      Kommentar


                        #41
                        Hello
                        yes. Please see here.
                        https://nodered.org/docs/user-guide/writing-functions

                        Kommentar


                          #42
                          I appreciate that!
                          As soon as I have further NR challenges, I will come back to you.
                          Gruß
                          alexbeer

                          Kommentar


                            #43
                            Sorry for OT:

                            Wie hast du das hinbekommen, dass die Bridge nach einem weiteren Deploy aktiv bleibt?

                            Zitat von MGK Beitrag anzeigen
                            This is INCREDIBLY EASY with your node and the "node-red-homekit-bridged" node.
                            Bei mir funktioniert es immer so lange, bis ich irgendetwas ändere, danach geht über das iPhone gar nichts mehr..
                            Magst du mir vielleicht mal deinen Flow zeigen/schicken?

                            Gruß Fischi

                            Kommentar


                              #44
                              Zitat von Fischi404 Beitrag anzeigen
                              Sorry for OT:

                              Wie hast du das hinbekommen, dass die Bridge nach einem weiteren Deploy aktiv bleibt?

                              Gruß Fischi
                              try RedMatic-HomeKit. I have the same problem and I mean there is a Issue on Github.
                              Gruß
                              Thorsten

                              Meine Installation: EFH mit EIB und Powernet; BJ Triton RTR 5fach; BJ Triton 3/5fach; BJ Wave Fenstermelder; Gira HS; Gira SmartSensor; Gira TK mit Fingerprint und TK-Gateway, Agfeo AS30 mit ST40IP; Dialogic Touch 15" mit Homecockpit und Schnittstelle zur Gira TK-Anlage; ipod Touch 1G und iphone 3G mit WHD iphone Docking-Station; Dreambox 7000; Kathrein UFS 910; Beleuchtung über DALI gesteuert

                              Kommentar


                                #45
                                Awesome node. I use it to log all KNX traffic to influxDB

                                Annotation 2020-01-06 212819.jpg
                                Gruß Sven

                                Kommentar

                                Lädt...
                                X