Entwicklung node-red-contrib-loxone für node-red

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • Asd1234
    LoxBus Spammer
    • 03.01.2016
    • 278

    Hallo

    Ich lese mit den stream in Node die Position des Rollos aus.
    Als Ausgabe im Dashboard bekomme ich zwischen 0% bis 1% alles.
    Jetzt würde ich den Wert der vom stream in Node ausgegeben wird mit den function Node gerne mit 100 mulziplizieren.
    Kann mir hierfür jemand die Formel veraten (kenne mich mit Programmierung leider überhaupt ned aus)
    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: dashboard.jpg
Ansichten: 1812
Größe: 67,4 KB
ID: 201221

    mfg asd1234

    Kommentar


    • somebuddy
      somebuddy kommentierte
      Kommentar bearbeiten
      msg.payload = msg.payload * 100;
      return msg
  • AlexAn
    Lebende Foren Legende
    • 25.08.2015
    • 4257

    Hab die 19.6 auf dem Raspberry laufen. Neuerdings sieht man NodeRed auch in deutscher Sprache. Kann man das einstellen oder muss man NodeRed neu aufsetzen?

    Hab´s gefunden:
    Code:
     [LEFT][COLOR=#553333][FONT=Ubuntu Mono][SIZE=16px]bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)[/SIZE][/FONT][/COLOR][/LEFT]
    In der 20.5er ist er dann in deutsch.
    Die ganzen Flows waren übrigens auch wieder da ohne weiteres zutun.
    Zuletzt geändert von AlexAn; 15.06.2019, 09:07.
    Grüße Alex

    Kommentar

    • Chris8519
      Extension Master
      • 19.12.2015
      • 106

      Hallo zusammen hat schon jemand mal einen flow ausprobiert in den die loxone rgb werte an zigbee2mqtt übergeben werden , hab den flow mal angehängt funktioniert soweit aber beim ausschalten werden leider noch Fehler erzeugt die aber der Funktion nicht schaden vielleicht hat der eine oder andere ja noch ne alternative Lösung

      Benötigt wird : node-red-contrib-loxone, node-red-contrib-zigbee , node-red-dashboard ,

      Code:
      [{"id":"72b458da.6b7578","type":"loxone-control-in","z":"404a0235.afabec","name":"HUE go","miniserver":"6fb76281.97d40c","control":"10a4432b-0032-ca3f-ffffb0eea9c6719d/AI9","state":"10a4432b-0032-ca30-ffff5d4268e64788","x":128,"y":189,"wires":[["8f534bb8.ca53d8"]]},{"id":"cbbc99b7.5c6508","type":"color-convert","z":"404a0235.afabec","input":"hsv","output":"rgb","outputType":"object","scaleInput":false,"x":639,"y":187.75,"wires":[["e333cb31.a2f7c8"]]},{"id":"b04c7a9b.d31c78","type":"function","z":"404a0235.afabec","name":"split hsv","func":"msg.payload = msg.payload.replace(\"hsv(\", \"\").replace(\")\", \"\").split(\",\");\nflow.set(\"brightness\", msg.payload[2]);\nreturn msg;","outputs":1,"noerr":0,"x":472.2500305175781,"y":188.25,"wires":[["cbbc99b7.5c6508"]]},{"id":"e333cb31.a2f7c8","type":"function","z":"404a0235.afabec","name":"RGB > msg","func":"var brightness = flow.get(\"brightness\");\nif (brightness == '0') {\n  return { payload: { state: \"off\" } };\n}\n\nreturn { payload: { state: \"on\", color: msg.payload, brightness: brightness } };\n\n","outputs":1,"noerr":0,"x":814.7500114440918,"y":187.25000381469727,"wires":[["e0914069.eb744","683b35f2.8c103c"]]},{"id":"8f534bb8.ca53d8","type":"switch","z":"404a0235.afabec","name":"hsv or temp","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"hsv(","vt":"str"},{"t":"cont","v":"temp(","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":293.75,"y":193.25,"wires":[["b04c7a9b.d31c78"],["fec9ff25.53c97"]]},{"id":"fec9ff25.53c97","type":"function","z":"404a0235.afabec","name":"spilt temp","func":"msg.payload = msg.payload.replace(\"temp(\", \"\").replace(\")\", \"\").split(\",\");\nreturn msg;","outputs":1,"noerr":0,"x":470.25,"y":226.75,"wires":[["5ef0f25f.760b6c"]]},{"id":"5ef0f25f.760b6c","type":"function","z":"404a0235.afabec","name":"Temp > RGB > msg","func":"var brightness = parseInt(msg.payload[0]);\nif (brightness == '0') {\n  return { payload: { state: \"off\" } };\n}\n\nvar kelvin = parseFloat(msg.payload[1]);\nvar temp = kelvin / 100;\nvar red, green, blue;\n\nif (temp <= 66) { \n  red = 255; \n\n  green = temp;\n  green = 99.4708025861 * Math.log(green) - 161.1195681661;\n\n  if (temp <= 19) {\n    blue = 0;\n  } \n  else {\n    blue = temp - 10;\n    blue = 138.5177312231 * Math.log(blue) - 305.0447927307;\n  }\n} \nelse {\n  red = temp - 60;\n  red = 329.698727446 * Math.pow(red, -0.1332047592);\n\n  green = temp - 60;\n  green = 288.1221695283 * Math.pow(green, -0.0755148492 );\n\n  blue = 255;\n\n}\n\nred = Math.round(Math.min(Math.max(red, 0), 255));\ngreen = Math.round(Math.min(Math.max(green, 0), 255));\nblue = Math.round(Math.min(Math.max(blue, 0), 255));\n\nreturn { payload: { state: \"on\", color: [ red, green, blue ], brightness: brightness } };","outputs":1,"noerr":0,"x":645,"y":225.75,"wires":[["e0914069.eb744","683b35f2.8c103c"]]},{"id":"b1b42663.8913b8","type":"debug","z":"404a0235.afabec","name":"test xy","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1258.972297668457,"y":227.94445991516113,"wires":[]},{"id":"ed2e7ba1.1f0258","type":"function","z":"404a0235.afabec","name":"ein","func":"msg.payload={\n\t\"state\" : \"on\"\n};\nmsg.topic = \"zigbee/Lampe1/set\";\nreturn msg;\n","outputs":1,"noerr":0,"x":519.2221984863281,"y":447,"wires":[["228b66f3.1e998a"]]},{"id":"465608f.f3d03f8","type":"function","z":"404a0235.afabec","name":"aus","func":"msg.payload={\n\t\"state\" : \"off\"\n};\nmsg.topic = \"zigbee/Lampe1/set\";\nreturn msg;\n\n","outputs":1,"noerr":0,"x":519.2221984863281,"y":487,"wires":[["228b66f3.1e998a"]]},{"id":"121da3f7.9b7b4c","type":"function","z":"404a0235.afabec","name":"helligkeit","func":"var hell= msg.payload;\nmsg.payload={\n\t\"brightness\":\"\" + hell + \"\" \n};\nmsg.topic = \"zigbee/Lampe1/set\";\nreturn msg;","outputs":1,"noerr":0,"x":529.2221984863281,"y":407,"wires":[["228b66f3.1e998a"]]},{"id":"49b67ac0.53af74","type":"function","z":"404a0235.afabec","name":"farbe","func":"  var laenge = msg.payload.length;\n  var pos1 = msg.payload.indexOf(\"(\");  \n  var stringneu = msg.payload.substring(pos1 + 1, laenge);\n  laenge = stringneu.length;  \n  var pos2 = stringneu.indexOf(\",\");\n  var r = stringneu.substring(0, pos2);\n  //-------------------\n  stringneu = stringneu.substring(pos2 + 1, laenge);\n  laenge = stringneu.length;  \n  var pos3 = stringneu.indexOf(\",\");\n  var g = stringneu.substring(1, pos3);\n  //----------------\n  stringneu = stringneu.substring(pos3 + 1, laenge);\n  laenge = stringneu.length;  \n  var pos4 = stringneu.indexOf(\")\");\n  var b = stringneu.substring(1, pos4);\n \nmsg.payload={\n\t\"state\" : \"on\",\n         \"color\" :\t{\n\t        \"r\" : \"\" + r + \"\",\n\t        \"g\" : \"\" + g + \"\",\n\t        \"b\" : \"\" + b + \"\"\n         \t}\n};\nmsg.topic = \"zigbee/Lampe1/set\";\nreturn msg;","outputs":1,"noerr":0,"x":519.2221984863281,"y":367,"wires":[["228b66f3.1e998a"]]},{"id":"228b66f3.1e998a","type":"zigbee-converter","z":"404a0235.afabec","shepherd":"19200a20.5b7c56","name":"HUE Go","topic":"zigbee/${ieeeAddr}","settopic":"zigbee/${ieeeAddr}/set","device":"0x001788010119656c","attribute":"","payload":"json","x":1231.7459678649902,"y":469.0952568054199,"wires":[[]]},{"id":"d544537d.1db0f","type":"ui_button","z":"404a0235.afabec","name":"Aus","group":"939f5d7c.a90a8","order":4,"width":0,"height":0,"passthru":false,"label":"Aus","tooltip":"","color":"","bgcolor":"red","icon":"","payload":"0","payloadType":"str","topic":"","x":299.2221984863281,"y":487,"wires":[["465608f.f3d03f8"]]},{"id":"b60bbfa.548a84","type":"ui_button","z":"404a0235.afabec","name":"Ein","group":"939f5d7c.a90a8","order":3,"width":0,"height":0,"passthru":false,"label":"Ein","tooltip":"","color":"","bgcolor":"green","icon":"","payload":"1","payloadType":"str","topic":"","x":299.2221984863281,"y":447,"wires":[["ed2e7ba1.1f0258"]]},{"id":"8cf43aa6.148628","type":"ui_colour_picker","z":"404a0235.afabec","name":"Farbe","label":"Farbe","group":"939f5d7c.a90a8","format":"rgb","outformat":"string","showSwatch":true,"showPicker":true,"showValue":true,"showHue":false,"showAlpha":false,"showLightness":false,"square":"false","dynOutput":"false","order":1,"width":0,"height":0,"passthru":true,"topic":"","x":299.2221984863281,"y":367,"wires":[["49b67ac0.53af74"]]},{"id":"8981e01c.a0c37","type":"ui_slider","z":"404a0235.afabec","name":"Helligkeit","label":"Helligkeit","tooltip":"","group":"939f5d7c.a90a8","order":2,"width":0,"height":0,"passthru":true,"outs":"all","topic":"","min":0,"max":"255","step":1,"x":309.2221984863281,"y":407,"wires":[["121da3f7.9b7b4c"]]},{"id":"e0914069.eb744","type":"function","z":"404a0235.afabec","name":"Umwandeln Zigbee2mqtt","func":" var red = (msg.payload.color.red);\n var green = (msg.payload.color.green);\n var blue = (msg.payload.color.blue);\n \n\nmsg.payload={\n    \"color\" :\t{\n\t   \"r\" : \"\" + red + \"\",\n\t   \"g\" : \"\" + green + \"\",\n\t   \"b\" : \"\" + blue + \"\"\n        }\n};\nmsg.topic = \"zigbee/Lampe1/set\";\nreturn msg;\n","outputs":1,"noerr":0,"x":1033,"y":190,"wires":[["228b66f3.1e998a","b1b42663.8913b8"]]},{"id":"683b35f2.8c103c","type":"function","z":"404a0235.afabec","name":"Helligkeit durchreichen","func":"var hell= (msg.payload.brightness);\nmsg.payload={\n\t\"brightness\":\"\" + hell + \"\" \n};\nmsg.topic = \"zigbee/Lampe1/set\";\nreturn msg;","outputs":1,"noerr":0,"x":1021,"y":232,"wires":[["228b66f3.1e998a","b1b42663.8913b8"]]},{"id":"6fb76281.97d40c","type":"loxone-miniserver","z":"","host":"192.168.178.32","port":"80","enctype":"0","active":true},{"id":"19200a20.5b7c56","type":"zigbee-shepherd","z":"","name":"zigbee shepherd","path":"/dev/ttyACM0","baudRate":"115200","rtscts":true,"channelList":[11],"led":"disabled"},{"id":"939f5d7c.a90a8","type":"ui_group","z":"","name":"Zigbee","tab":"ae37204a.047d1","order":1,"disp":true,"width":"7","collapse":false},{"id":"ae37204a.047d1","type":"ui_tab","z":"","name":"Zigbee1","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

      Klicke auf die Grafik für eine vergrößerte Ansicht

Name: zigbeelox.png
Ansichten: 1639
Größe: 68,8 KB
ID: 204679

      Kommentar


      • pmayer
        pmayer kommentierte
        Kommentar bearbeiten
        Das sieht schwer danach aus als ob in den function nodes fehlende Variablen in den verschiedenen Zuständen nicht korrekt behandelt werden.
        "Endpoint not found" ist eine Fehlermeldung vom Zigbee-Node.

      • Chris8519
        Chris8519 kommentierte
        Kommentar bearbeiten
        ja mein hauptsächliches Problem ist das in dem Funktionsbaustein (Temp > RGB > msg) mit den werten red, green, blue gearbeitet diese müssen aber für zigbee als "r","g" ,"b" ausgegeben werden

      • pmayer
        pmayer kommentierte
        Kommentar bearbeiten
        Node-RED node to convert between Color representations (e.g. RGB to HSV)


        :-)
    • Chris8519
      Extension Master
      • 19.12.2015
      • 106

      Color-convert ist ja im flow schon vorhanden wie gesagt aber die ausgabe muss noch abgeändert werden für zigbee
      Klicke auf die Grafik für eine vergrößerte Ansicht

Name: ausgabe1.png
Ansichten: 1266
Größe: 8,3 KB
ID: 204883Klicke auf die Grafik für eine vergrößerte Ansicht

Name: ausgabe2.png
Ansichten: 1326
Größe: 11,5 KB
ID: 204884

      Kommentar

      • pmayer
        LoxBus Spammer
        • 27.02.2017
        • 379

        Ouh, stimmt. Das hatte ich übersehen. Aber wo ist das Problem?

        msg.color = {r: msg.color.red, g: msg.color.green, b: msg.color.blue};

        Oder blicke ich es grade was nicht?
        https://allgeek.de/

        https://twitter.com/pregopm, https://github.com/codmpm/
        https://github.com/codmpm/node-red-contrib-loxone
        https://github.com/codm/wled-controller

        Kommentar

        • Chris8519
          Extension Master
          • 19.12.2015
          • 106

          Habe es hinbekommen .... der ansatz war gut und hilfreich musste das ganze jedoch noch etwas abändern ... Jetzt läuft es ohne fehler ...

          Hier der Flow Lox2CC2531

          Code:
          [{"id":"745d09ea.614458","type":"color-convert","z":"b85400d6.dccfc","input":"hsv","output":"rgb","outputType":"object","scaleInput":false,"x":497.1428527832031,"y":154.2857208251953,"wires":[["4fbb251e.ce59bc"]]},{"id":"b4e946f2.0b6a58","type":"function","z":"b85400d6.dccfc","name":"split hsv","func":"msg.payload = msg.payload.replace(\"hsv(\", \"\").replace(\")\", \"\").split(\",\");\nflow.set(\"brightness\", msg.payload[2]);\nreturn msg;","outputs":1,"noerr":0,"x":330.39288330078125,"y":154.7857208251953,"wires":[["745d09ea.614458"]]},{"id":"4fbb251e.ce59bc","type":"function","z":"b85400d6.dccfc","name":"RGB > msg","func":"\nvar brightness = flow.get(\"brightness\");\nif (brightness == '0') {\n  return { payload: { state: \"off\" } };\n}\nmsg.color = {\"r\": \"\" + msg.payload.red + \"\", \"g\": \"\" + msg.payload.green + \"\", \"b\": \"\" + msg.payload.blue + \"\"};\n\nreturn { payload: { state: \"on\", color: msg.color, brightness: brightness } };\n","outputs":1,"noerr":0,"x":672.8928756713867,"y":153.78572177886963,"wires":[["875c7af2.b3e368"]]},{"id":"f4db8c1f.1e49","type":"switch","z":"b85400d6.dccfc","name":"hsv or temp","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"hsv(","vt":"str"},{"t":"cont","v":"temp(","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":151.89285278320312,"y":159.7857208251953,"wires":[["b4e946f2.0b6a58"],["a906fe25.230e5"]]},{"id":"a906fe25.230e5","type":"function","z":"b85400d6.dccfc","name":"spilt temp","func":"msg.payload = msg.payload.replace(\"temp(\", \"\").replace(\")\", \"\").split(\",\");\nreturn msg;","outputs":1,"noerr":0,"x":328.3928527832031,"y":193.2857208251953,"wires":[["57476415.dd2a6c"]]},{"id":"57476415.dd2a6c","type":"function","z":"b85400d6.dccfc","name":"Temp > RGB > msg","func":"var brightness = parseInt(msg.payload[0]);\nif (brightness == '0') {\n  return { payload: { state: \"off\" } };\n}\n\nvar kelvin = parseFloat(msg.payload[1]);\nvar temp = kelvin / 100;\nvar red, green, blue;\n\nif (temp <= 66) { \n  red = 255; \n\n  green = temp;\n  green = 99.4708025861 * Math.log(green) - 161.1195681661;\n\n  if (temp <= 19) {\n    blue = 0;\n  } \n  else {\n    blue = temp - 10;\n    blue = 138.5177312231 * Math.log(blue) - 305.0447927307;\n  }\n} \nelse {\n  red = temp - 60;\n  red = 329.698727446 * Math.pow(red, -0.1332047592);\n\n  green = temp - 60;\n  green = 288.1221695283 * Math.pow(green, -0.0755148492 );\n\n  blue = 255;\n\n}\n\nred = Math.round(Math.min(Math.max(red, 0), 255));\ngreen = Math.round(Math.min(Math.max(green, 0), 255));\nblue = Math.round(Math.min(Math.max(blue, 0), 255));\n\nreturn { payload: { state: \"on\", color: [ red, green, blue ], brightness: brightness } };","outputs":1,"noerr":0,"x":503.1428527832031,"y":192.2857208251953,"wires":[["875c7af2.b3e368"]]},{"id":"875c7af2.b3e368","type":"function","z":"b85400d6.dccfc","name":"msg.topic = \"zigbee/Lampe1/set\"","func":"msg.payload=(msg.payload);\nmsg.topic = \"zigbee/Lampe1/set\";\nreturn msg;\n","outputs":1,"noerr":0,"x":943.8570327758789,"y":193.67857551574707,"wires":[[]]}]

          Kommentar


          • Chris8519
            Chris8519 kommentierte
            Kommentar bearbeiten
            Werde es die tage ins wiki eintragen damit jeder davon was hat :-)
            Habe gesehen das für den Loxberry ab version 1.6 node.js mitgeliefert werden soll vielleicht wir es ja dann noch was mit dem plugin für den loxberry
            Current stable Branch is: *** Please see Releases *** Current developer Branch is: *** master *** - 2.0 Milestone · mschlenstedt/Loxberry

          • Tico
            Tico kommentierte
            Kommentar bearbeiten
            Ich versuche, deinen Flow zu importieren. Nodered wird es mit Import - Zwischenablage nicht erkennen.
            Hast du Export - Zwischenablage benutzt?

          • Chris8519
            Chris8519 kommentierte
            Kommentar bearbeiten
            Kann gut sein ... kann dir leider im moment auch leider nicht weiterhelfen da ich node red im moment nicht auf dem system mehr habe warte noch bis der raspberry 4 unterstützt wird und werde dort einene neue installation machen ...
        • Walz83
          Smart Home'r
          • 04.11.2016
          • 34

          Hallo Zusammen

          Ich habe ein kleines Problem wenn ich den Miniserver neustarte: Ich prüfe in node red per "Loxone In" einen virtuellen Status ab ob dieser "active" gesetzt ist. Wenn dieser vor dem Neustart nicht "active" war werden die verlinkten Nodes nach dem Neustart ungewollt ausgeführt. Kann man diesen verhalten ändern?

          Falls nicht, wie funktioniert eine Kommunikation zwischen Miniserver und Node Red per http Befehle? - Gibt es dazu eine Anleitung?

          Kommentar

          • AlexAn
            Lebende Foren Legende
            • 25.08.2015
            • 4257

            Startimpuls des Miniserver mit Einschaltverzögerung
            Grüße Alex

            Kommentar

            • Walz83
              Smart Home'r
              • 04.11.2016
              • 34

              Danke für den Tipp. Ich hatte jedoch ein anderes Problem. Mein Flow wurde auch durch eine "0" gestartet. Beim Neustart des Miniservers wird beim Loxone IN automatisch eine 0 (="not active") gesendet. Dieser hat den Flow ausgelöst. Ich hab es nun mit einem Funcion node gelöst:

              if (msg.payload == 1) {
              return msg;
              }

              Kommentar

              • pmayer
                LoxBus Spammer
                • 27.02.2017
                • 379

                Dafür kann man auch einen switch-node nehmen und eben nur einen Ausgang (1) nutzen.
                https://allgeek.de/

                https://twitter.com/pregopm, https://github.com/codmpm/
                https://github.com/codmpm/node-red-contrib-loxone
                https://github.com/codm/wled-controller

                Kommentar

                • brau01ma
                  Extension Master
                  • 06.02.2017
                  • 147

                  Hallo zusammen,

                  ich möchte über nodered einige Variablen meines Tesla auslesen und in Loxone zur Ladung über Awattar weiterverarbeiten.
                  Nur bin ich leider in nodered sehr unerfahren.
                  Wie bekomme ich z.B. die Variable "battery_level" in Loxone?

                  Klicke auf die Grafik für eine vergrößerte Ansicht

Name: getstate.PNG
Ansichten: 1208
Größe: 73,4 KB
ID: 209590

                  Kommentar


                  • pmayer
                    pmayer kommentierte
                    Kommentar bearbeiten
                    Da es sich ja eigentlich um "Text" handelt, schau mal hier: https://www.loxforum.com/forum/faqs-...3773#post93773

                    Wichtig: Der Post bezieht sich noch auf eine alter Version von node-red-contrib-loxone. Mittlerweile kannst du zum Anhängen der msg.payload an die Webservice-URI einfach im node einen Haken setzen und brauchst den function node nicht mehr.
                • brau01ma
                  Extension Master
                  • 06.02.2017
                  • 147

                  pmayer
                  ich würde das dann so verstehen, tut aber leider nicht..
                  Klicke auf die Grafik für eine vergrößerte Ansicht

Name: noderedbatterystate.PNG
Ansichten: 971
Größe: 73,9 KB
ID: 209616
                  Angehängte Dateien

                  Kommentar


                  • brau01ma
                    brau01ma kommentierte
                    Kommentar bearbeiten
                    Okay, wir kommen der Sache näher
                    Würdest du mir noch kurz erklären wie ich mein battery_level in msg.payload verschiebe? Bzw kann ich mir das irgendwo nachlesen?

                  • pmayer
                    pmayer kommentierte
                    Kommentar bearbeiten
                    https://www.youtube.com/watch?v=PbEoHxFOdmE - zum Beispiel hier.

                    Change-Node -> set msg.payload to msg.payload.battery_level

                  • brau01ma
                    brau01ma kommentierte
                    Kommentar bearbeiten
                    Funktioniert, danke dir!
                • Tico
                  Lox Guru
                  • 31.08.2016
                  • 1035

                  Ich hoffe, ich kann etwas Hilfe bei NodeRed und einem Neulingsproblem anfordern. Es handelt sich um die Steuerung eines MiLight mit Loxone.

                  Ich habe die folgenden Arbeiten erfolgreich für den Flow "Off" und "White Scale/Brightness" durchgeführt. Ich kann den RGB-Wert auch erfolgreich an der angegebenen Stelle einfügen.

                  Die HSV zu RGB Komponente funktioniert aufgrund von Formatierungsproblemen nicht.

                  Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Loxone to MiLight.png Ansichten: 0 Größe: 77,6 KB ID: 209851
                  1. Der Knoten'HSV Reformat' überträgt die Nutzlast als Format -
                  Code:
                  [ "220,60,95" ]
                  Der Knoten'HSV>RGB' erwartet die Payload ohne Anführungszeichen -
                  Code:
                  [220,60,95]
                  2. Der Knoten'HSV>RGB' gibt den korrekten RGB-Wert aus, jedoch in einem Format -
                  Code:
                  [ 97,145,242 ]
                  Der Knoten'RGB' erwartet die eingehende Nutzlast als -
                  Code:
                  rgb(97,145,242)
                  Ich habe die exportierte Zwischenablage hier angehängt -

                  Code:
                  [{"id":"f47fccf4.5a047","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"eb0fa154.8addf","type":"loxone-control-in","z":"f47fccf4.5a047","name":"","miniserver":"","control":"12e6cd0f-00c8-1932-ffffd989fb12b87b/AI1","state":"12e6cd0f-00c8-195d-ffffd989fb12b87b","x":80,"y":340,"wires":[["de475700.267dc8"]]},{"id":"de475700.267dc8","type":"switch","z":"f47fccf4.5a047","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"hsv(0,0,0)","vt":"str"},{"t":"cont","v":"hsv","vt":"str"},{"t":"cont","v":"temp","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":250,"y":340,"wires":[["f9a52399.e1f99"],["9852ed42.ae1ae"],["83013b4a.43b6f8","a8ea244.e03fcd8"]]},{"id":"f9a52399.e1f99","type":"template","z":"f47fccf4.5a047","name":"Off","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"off","output":"str","x":690,"y":60,"wires":[["bf0c4e85.6266c"]]},{"id":"83013b4a.43b6f8","type":"function","z":"f47fccf4.5a047","name":"Temperature Split","func":"var temp= msg.payload.split(\",\");\n\ntemp[0] = temp[0].substr(5);\ntemp[1] = temp[1].substr(0, temp[1].length-1); \n\nmsg.h = temp[0];\n\nmsg.payload = temp[1];\n\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":640,"wires":[["1bb330fe.1f4d0f"]]},{"id":"e62fb939.310978","type":"function","z":"f47fccf4.5a047","name":"Temperature","func":"msg.command = 'temperature';\nreturn msg;","outputs":1,"noerr":0,"x":910,"y":640,"wires":[["bf0c4e85.6266c"]]},{"id":"1bb330fe.1f4d0f","type":"range","z":"f47fccf4.5a047","minin":"2700","maxin":"6500","minout":"0","maxout":"100","action":"scale","round":true,"property":"payload","name":"Scale White 0-100","x":710,"y":640,"wires":[["e62fb939.310978"]]},{"id":"bf0c4e85.6266c","type":"MiLight","z":"f47fccf4.5a047","name":"MiLight","bridgetype":"v6","bulbtype":"fullColor","zone":1,"ip":"10.1.1.9","broadcast":true,"x":1160,"y":340,"wires":[]},{"id":"94779e61.fced3","type":"function","z":"f47fccf4.5a047","name":"Brightness","func":"msg.command = 'brightness';\nreturn msg;","outputs":1,"noerr":0,"x":910,"y":580,"wires":[["bf0c4e85.6266c"]]},{"id":"a8ea244.e03fcd8","type":"function","z":"f47fccf4.5a047","name":"Brightness Split","func":"var temp= msg.payload.split(\",\");\n\ntemp[0] = temp[0].substr(5);\ntemp[1] = temp[1].substr(0, temp[1].length-1); \n\nmsg.h = temp[1];\n\nmsg.payload = temp[0];\n\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":580,"wires":[["94779e61.fced3"]]},{"id":"33ff655a.d82c9a","type":"function","z":"f47fccf4.5a047","name":"RGB","func":"msg.command = 'rgb';\nreturn msg;","outputs":1,"noerr":0,"x":950,"y":340,"wires":[["bf0c4e85.6266c"]]},{"id":"9852ed42.ae1ae","type":"function","z":"f47fccf4.5a047","name":"HSV Reformat","func":"var hsv = msg.payload.split(\",\");\n\nhsv[0] = hsv[0].substr(4);\nhsv[2] = hsv[2].substr(0, hsv[2].length-1); \n\nmsg.h = hsv[0];\nmsg.s = hsv[1];\nmsg.v = hsv[2];\n\ncommand = [msg.h +',' +msg.s +','+ msg.v +''];\nmsg.payload = command;\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":340,"wires":[["e93fda85.3acef8","e638218f.8bc0f"]]},{"id":"e93fda85.3acef8","type":"color-convert","z":"f47fccf4.5a047","input":"hsv","output":"rgb","outputType":"array","scaleInput":true,"x":710,"y":340,"wires":[["33ff655a.d82c9a","75aaa0b6.e557c"]]},{"id":"c8bf1773.db7158","type":"inject","z":"f47fccf4.5a047","name":"","topic":"","payload":"rgb(97,145,242)","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":780,"y":280,"wires":[["33ff655a.d82c9a"]]},{"id":"e638218f.8bc0f","type":"debug","z":"f47fccf4.5a047","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":670,"y":400,"wires":[]},{"id":"75aaa0b6.e557c","type":"debug","z":"f47fccf4.5a047","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":870,"y":400,"wires":[]},{"id":"97719a0a.2f3428","type":"inject","z":"f47fccf4.5a047","name":"","topic":"","payload":"[220,60,95]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":540,"y":280,"wires":[["e93fda85.3acef8"]]}]
                  Zuletzt geändert von Tico; 17.08.2019, 09:32.
                  Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

                  Kommentar


                  • pmayer
                    pmayer kommentierte
                    Kommentar bearbeiten
                    You've built a comma separated string in an array (line 10, function node before color convert), but color convert expects an array with values as stated in the info.

                    Try command = [msg.h, msg.s,msg.v];
                • AlexAn
                  Lebende Foren Legende
                  • 25.08.2015
                  • 4257

                  Hi,
                  hab da ein kleines Problem das mich einfach stört obwohl es keine Funktion beeinträchtigt.

                  Kann man Fehlermeldungen unterbinden da mir die Verbindung zur APC immer abhanden kommt??
                  Klicke auf die Grafik für eine vergrößerte Ansicht  Name: Fehlermeldung NodeREd.JPG Ansichten: 0 Größe: 206,0 KB ID: 209901
                  Grüße Alex

                  Kommentar

                • Tico
                  Lox Guru
                  • 31.08.2016
                  • 1035

                  Als Antwort auf das Problem an Post #373, hier ist der Ablauf für die Steuerung eines MiLight von Loxone.

                  Die Beleuchtungssteuerung sollte mit Lumitech 'type' verwendet werden und bietet eine kombinierte GUI mit RGB, CW/WW und Brightness.

                  pmayer - Danke für die Hilfe.

                  Code:
                  [{"id":"70d6f2e9.572edc","type":"loxone-control-in","z":"cdb8d889.f1d428","name":"","miniserver":"","control":"12e6cd0f-00c8-1932-ffffd989fb12b87b/AI1","state":"12e6cd0f-00c8-195d-ffffd989fb12b87b","x":80,"y":220,"wires":[["8da65c62.02aaf"]]},{"id":"8da65c62.02aaf","type":"switch","z":"cdb8d889.f1d428","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"hsv(0,0,0)","vt":"str"},{"t":"cont","v":"hsv","vt":"str"},{"t":"cont","v":"temp","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":250,"y":220,"wires":[["59f77549.b5533c"],["df4e162b.e8ae88"],["3bd6e5df.d376aa","8232faa0.1460d8"]]},{"id":"59f77549.b5533c","type":"template","z":"cdb8d889.f1d428","name":"Off","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"off","output":"str","x":690,"y":60,"wires":[["2149d78b.29d358"]]},{"id":"3bd6e5df.d376aa","type":"function","z":"cdb8d889.f1d428","name":"Temperature Split","func":"var temp= msg.payload.split(\",\");\n\ntemp[0] = temp[0].substr(5);\ntemp[1] = temp[1].substr(0, temp[1].length-1); \n\nmsg.h = temp[0];\n\nmsg.payload = temp[1];\n\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":420,"wires":[["d20df7bf.a38238"]]},{"id":"3661dca9.4a9864","type":"function","z":"cdb8d889.f1d428","name":"Temperature","func":"msg.command = 'temperature';\nreturn msg;","outputs":1,"noerr":0,"x":890,"y":420,"wires":[["2149d78b.29d358"]]},{"id":"d20df7bf.a38238","type":"range","z":"cdb8d889.f1d428","minin":"2700","maxin":"6500","minout":"0","maxout":"100","action":"scale","round":true,"property":"payload","name":"Scale White 0-100","x":690,"y":420,"wires":[["3661dca9.4a9864"]]},{"id":"2149d78b.29d358","type":"MiLight","z":"cdb8d889.f1d428","name":"MiLight","bridgetype":"v6","bulbtype":"fullColor","zone":1,"ip":"","broadcast":true,"x":1160,"y":220,"wires":[]},{"id":"ecb0023f.fc074","type":"function","z":"cdb8d889.f1d428","name":"Brightness","func":"msg.command = 'brightness';\nreturn msg;","outputs":1,"noerr":0,"x":890,"y":360,"wires":[["2149d78b.29d358"]]},{"id":"8232faa0.1460d8","type":"function","z":"cdb8d889.f1d428","name":"Brightness Split","func":"var temp= msg.payload.split(\",\");\n\ntemp[0] = temp[0].substr(5);\ntemp[1] = temp[1].substr(0, temp[1].length-1); \n\nmsg.h = temp[1];\n\nmsg.payload = temp[0];\n\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":360,"wires":[["ecb0023f.fc074"]]},{"id":"33aa72bb.1dd07e","type":"color-convert","z":"cdb8d889.f1d428","input":"hsv","output":"rgb","outputType":"string","scaleInput":false,"x":690,"y":220,"wires":[["787a9882.61cf68"]]},{"id":"787a9882.61cf68","type":"function","z":"cdb8d889.f1d428","name":"RGB format","func":"m = msg.payload\nreturn {topic:\"rgb\",payload:\"rgb(\"+m+\")\"};","outputs":1,"noerr":0,"x":890,"y":220,"wires":[["2149d78b.29d358"]]},{"id":"df4e162b.e8ae88","type":"function","z":"cdb8d889.f1d428","name":"HSV format","func":"m = msg.payload\nr = /\\((.*?),(.*?),(.*?)\\)/gm;\no = r.exec(m)\n\nh = parseInt(o[1])\ns = parseInt(o[2])\nv = parseInt(o[3])\n\nreturn {payload:[h,s,v]};","outputs":1,"noerr":0,"x":490,"y":220,"wires":[["33aa72bb.1dd07e"]]}]
                  Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

                  Kommentar

                  Lädt...