Ankündigung

Einklappen
Keine Ankündigung bisher.

KNX node for node-red

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

    Hi Stives,
    you need to get msg.payload from the KNX-Ultimate node, then do some manipulation on that payload and then send it to HA.
    In the property window, i see your're using {{time}}. From where you take this variable?
    Are you new on HA programming? This info will help us to help you.

    Kommentar


      Yes, I started a month ago with HA but I have already integrated all my KNX equipment

      With the KNXULTIMATE node I can retrieve a number from KNX to HA and I did something similar for Date and Time but the KNX format does not seem to be accepted by HA.
      The {{time}} comes from the node I imported with the link given previously.

      13/04/2021, 15:59:23node: 3bc14aa4.7df6f62/6/7 : msg : Object
      object
      topic: "2/6/7"
      payload: "2021-04-09T22:00:00.000Z"
      devicename: "2/6/7 ABA/S 1.2.1"
      payloadmeasureunit: "unknown"
      payloadsubtypevalue: "unknown"
      knx: object
      event: "GroupValue_Write"
      dpt: "11.001"
      dptdesc: "Date"
      source: "1.1.77"
      destination: "2/6/7"
      rawValue: buffer[3]
      previouspayload: "2021-04-08T22:00:00.000Z"
      _msgid: "6c38763e.f0d108"
      Zuletzt geändert von Stives; 13.04.2021, 15:00.

      Kommentar


        Sorry for this question, I am just starting to use node-red (via iobroker): How do I update knx-ultimate? I am still on .8
        Gruß Matthias
        EIB übersetzt meine Frau mit "Ehepaar Ist Beschäftigt"
        - PN nur für PERSÖNLICHES!

        Kommentar


          In Node-Red, click on top-right corner the three bars (so called "hamburger" symbol) and then Palette verwalten.
          Winston Churchill hat mal gesagt: "Ein kluger Mann macht nicht alle Fehler selbst. Er gibt auch anderen eine Chance.“

          Kommentar


            Zitat von MatthiasS Beitrag anzeigen
            Sorry for this question, I am just starting to use node-red (via iobroker): How do I update knx-ultimate? I am still on .8
            Hi Matthias,
            please take your time to read the WIKI and SAMPLES as well, because there are many new things.

            Kommentar


              Zitat von Stives Beitrag anzeigen
              Yes, I started a month ago with HA but I have already integrated all my KNX equipment
              ..
              payload: "2021-04-09T22:00:00.000Z"
              ..
              This is what you're looking for.
              Unfortunately, i don't use HA nodes, so i cannot help you anymore, but someone can help you. You need to write a function that parses this payload and send it to your HA node.

              Kommentar


                Zitat von TheMax74 Beitrag anzeigen

                This is what you're looking for.
                Unfortunately, i don't use HA nodes, so i cannot help you anymore, but someone can help you. You need to write a function that parses this payload and send it to your HA node.
                Very difficult for me to do a function because I don't even know the format expected by HA !

                I also have a problem with updating knxultimate on HA.
                I upgraded from HA / Node-red / manage palette / knxultimate / update and now I have the following message that displays "Node-RED must be restarted to enable upgraded modules".
                I restarted HA (so Node-red) but the message persists ...

                Kommentar


                  HA and Node-Red are two separate apps.
                  Restart the whole PC.

                  Kommentar


                    Zitat von TheMax74 Beitrag anzeigen
                    HA and Node-Red are two separate apps.
                    Restart the whole PC.
                    Thank you. It's up to date!
                    The most difficult remains to be done !

                    Kommentar


                      Stives,
                      if you can tell me what the HA node does expect as input, i can write the function for you.

                      Kommentar


                        It is very nice! I am trying to test this code which according to its author works.

                        I checked the knot. When I click on timestamp, the date and day are displayed in the Entity Lovelace card.

                        With this node connected to the KnxUltimate device node, on each write to the GA, only the time is transmitted to the HA entity. The date displayed is today's date.

                        [{"id":"4ebefd89.d69164","type":"function","z":" 712 9ee98.085df","name":"","func":"var d = new Date(); \nmsg.time = d.getFullYear() + "-" + ('0' + (d.getMonth()+1)).slice(-2) + "-" + d.getDate() + " " + ('0' + (d.getHours())).slice(-2) + ":" + ('0' + (d.getMinutes())).slice(-2) + ":" + ('0' + (d.getSeconds())).slice(-2);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","final ize":"","x":2360,"y":1140,"wires":[["fffa678.7820998"]]},{"id":"fffa678.7820998","type":"api-call-service","z":"7129ee98.085df","name":"","server":" 4bbca37b.1700ec","version":1,"debugenabled":false, "service_domain":"input_datetime","service":"s et_d atetime","entityId":"input_datetime.test","data":" {"entity_id":"input_datetime.test","datetime":" {{t ime}}"}","dataType":"json","mergecontext":"","outp ut_location":"","output_location_type":"none","mus tacheAltTags":false,"x":2600,"y":1140,"wires":[[]]},{"id":"e4e32bcd.1177b8","type":"inject","z":"71 2 9ee98.085df","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDel ay" :0.1,"topic":"","payload":"","payloadType":"date", "x":2210,"y":1080,"wires":[["4ebefd89.d69164"]]},{"id":"4bbca37b.1700ec","type":"server","z":"", " name":"Home Assistant","addon":true}]
                        KNX vers HA17.jpg
                        Zuletzt geändert von Stives; 13.04.2021, 17:41.

                        Kommentar


                          Hi Stives
                          Please use the code tags (the #) to paste here the code, otherwise the forum's editor will format the script and we cannot paste it into node-red.

                          Kommentar


                            Yes I am sorry

                            Code:
                            [{"id":"d67a3cc1.37528","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"ae17aadd.81de18","type":"knxUltimate","z":"d67a3cc1.37528","server":"e91643e.d9013c","topic":"2/6/40","outputtopic":"","dpt":"19.001","initialread":0,"notifyreadrequest":true,"notifyresponse":false,"notifywrite":true,"notifyreadrequestalsorespondtobus":false,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"0","listenallga":false,"name":"2/6/40 ABA","outputtype":"write","outputRBE":true,"inputRBE":false,"formatmultiplyvalue":1,"formatnegativevalue":"leave","formatdecimalsvalue":999,"passthrough":"no","x":420,"y":80,"wires":[["9cae0ad7.567548","6ca5111d.5c749"]]},{"id":"1a7e1d5d.ed5873","type":"api-call-service","z":"d67a3cc1.37528","name":"Fin arrosage","server":"6dbc60a4.9907","version":1,"debugenabled":false,"service_domain":"input_datetime","service":"set_datetime","entityId":"input_datetime.test","data":"{\"entity_id\":\"input_datetime.test\",\"datetime\":\"{{time}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":60,"wires":[[]]},{"id":"9cae0ad7.567548","type":"debug","z":"d67a3cc1.37528","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":780,"y":200,"wires":[]},{"id":"6ca5111d.5c749","type":"function","z":"d67a3cc1.37528","name":"","func":"var d = new Date(); \nmsg.time =  d.getFullYear() + \"-\" + ('0' + (d.getMonth()+1)).slice(-2) + \"-\" + d.getDate() + \" \" + ('0' + (d.getHours())).slice(-2) + \":\" + ('0' + (d.getMinutes())).slice(-2) + \":\" + ('0' + (d.getSeconds())).slice(-2);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":720,"y":60,"wires":[["1a7e1d5d.ed5873"]]},{"id":"e91643e.d9013c","type":"knxUltimate-config","host":"192.168.1.100","port":"3671","physAddr":"15.15.22","suppressACKRequest":false,"csv":"","KNXEthInterface":"Auto","KNXEthInterfaceManuallyInput":"","statusDisplayLastUpdate":true,"statusDisplayDeviceNameWhenALL":true,"statusDisplayDataPoint":false,"stopETSImportIfNoDatapoint":"skip","loglevel":"error","name":"Passerelle IP-KNX","localEchoInTunneling":true,"delaybetweentelegrams":"40","delaybetweentelegramsfurtherdelayREAD":"1"},{"id":"6dbc60a4.9907","type":"server","name":"Home Assistant","addon":true}]

                            Kommentar


                              Zitat von xrk Beitrag anzeigen
                              and then Palette verwalten.
                              Thanks for your help!


                              Unfortunately, there is no update button for this node!? Screenshot 2021-04-14 10.16.20.png
                              Gruß Matthias
                              EIB übersetzt meine Frau mit "Ehepaar Ist Beschäftigt"
                              - PN nur für PERSÖNLICHES!

                              Kommentar


                                Hi Stives
                                the function node contains
                                Code:
                                var d = new Date();
                                msg.time = d.getFullYear() + "-" + ('0' + (d.getMonth()+1)).slice(-2) + "-" + d.getDate() + " " + ('0' + (d.getHours())).slice(-2) + ":" + ('0' + (d.getMinutes())).slice(-2) + ":" + ('0' + (d.getSeconds())).slice(-2);
                                return msg;
                                You will obtain the current date everytime, because you get the value from the javascript object "Date".
                                Replace this:
                                Code:
                                var d = new Date();
                                with this:
                                Code:
                                var d = new Date(msg.payload);
                                Now, as soon as your 2/6/40 receives a datetime, the function get their msg.payload and transform it in a date.

                                Kommentar

                                Lädt...
                                X