Skip to content

Node-Red

Hilfe für Skripterstellung mit Node-RED

952 Themen 13.1k Beiträge

NEWS

  • Ältere Version eines Moduls installieren

    9
    0 Stimmen
    9 Beiträge
    593 Aufrufe
    P
    @libertyx82 Möglich, dass eine der Abhängigkeiten aktualisiert wurde, welche nun die Probleme bereitet. Die letzte Änderung ist einen Monat her. Da sollten sich evtl. schon weitere Nutzer gemeldet haben. Wie wird die Abfrage getriggert? Automatisch, oder gibst Du den Intervall vor?
  • AppleTV steuern über NodeRed

    multimedia node-red javascript
    8
    0 Stimmen
    8 Beiträge
    736 Aufrufe
    S
    mal wieder etwas Zeit gehabt: Die Installation und auch den richtigen Pfad gefunden: /home/pi/pyatv_venv/bin Auch die AppleTVs habe ich jetzt gefunden und konnte mich sich verbinden: atvremote --id XX:XX:XX:XX:XX --protocol companion pair Enter PIN on screen: 2723 Pairing seems to have succeeded, yey! You may now use these credentials: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (pyatv_venv) pi@raspberrypi:~ $ atvremote --id XX:XX:XX:XX:XX --protocol airplay pair Enter PIN on screen: 5178 Pairing seems to have succeeded, yey! You may now use these credentials: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX leider bekomme ich jetzt im Debug Fehler: Error: Got pyatv Error: Odd-length string pyatv Stacktrace: Traceback (most recent call last): File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py", line 395, in appstart args.output(await _handle_command(args, abort_sem, storage, loop)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py", line 273, in _handle_command atv = await connect(config, loop, storage=storage) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/__init__.py", line 155, in connect await atv.connect() File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/core/facade.py", line 723, in connect if await setup_data.connect(): ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 644, in _connect await api.connect() File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 151, in connect await self._protocol.start() File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 103, in start self.srp.pairing_id = parse_credentials(self.service.credentials).client_id ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/auth/hap_pairing.py", line 141, in parse_credentials ltpk = binascii.unhexlify(split[0]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ binascii.Error: Odd-length string
  • Payload bedingt ausführen!?

    8
    0 Stimmen
    8 Beiträge
    415 Aufrufe
    mickymM
    @dirkl Diesen Haken musst Du immer rausmachen - da du ja nicht unterschiedliche Topics überprüfen willst.
  • Object Daten in Influx db speichern

    50
    2
    0 Stimmen
    50 Beiträge
    7k Aufrufe
    mickymM
    @icebear Wenn Du die Influx-Out Nodes nimmst, dann hast Du keine Eigenschaften im Objekt, wie fields und measurement, sondern nur verschachtelte Arrays: [ [ { "temperature": 24, "humidity": 52 }, { "room": "Wohnzimmer" } ], [ { "temperature": 25, "humidity": 70 }, { "room": "Bad" } ] ] Das äussere Array enthält die Datenpunkte, jeder Datenpunkt besteht wieder aus einem Array mit 2 Objekten. Im Ersten sind die "Fields" mit den Werten, im Zweiten die Tags. Insofern ist die Batch-Verarbeitung etwas übersichtlicher und kannst so halt auch mit einer Node in verschiedene measurements schreiben.
  • JSON Input in Datei ergänzen

    8
    0 Stimmen
    8 Beiträge
    728 Aufrufe
    mickymM
    @_r_a_l_f_ sagte in JSON Input in Datei ergänzen: Daher leider Ansatz mit dem codieren Na meine Meinung hierzu kennst Du ja. Insbesondere da der Flow nicht kompliziert ist und ich das Einlesen der Datei bei jedem Update unnötig finde, aber letztlich musst Du selbst wissen, was Dir wichtig ist. Chat GPT wird Dir in der Regel immer Code vorschlagen, da NodeRed als grafisches Tool genau das Gegenteil ist, was Chat GPT kann.
  • Trigger Node reset senden

    2
    0 Stimmen
    2 Beiträge
    238 Aufrufe
    Marc BergM
    @hotspot_2 sagte in Tri Node reset senden: Wie sieht den die Reset message genau aus? Ist das msg.payload mit dem Text "reset"? Ich habe dazu in der Hilfe nichts gefunden. Entweder setzt du die Eigenschaft "msg.reset" auf einen beliebigen Inhalt oder msg.payload auf den Inhalt, den du bei den Eigenschaften festgelegt hast (statt des Textes "optional"). [image: 1728735623850-01cb12e6-5fc2-4162-bd14-548c06c4f708-grafik.png] Wie kann ich dann von einer anderen Funktion an den Trigger einen Reset senden ohne jetzt eine Verbindung kreuz und quer ziehen zu müssen? Gibt es da eine Möglichkeit? Mit den "Link" Nodes kannst du dir die langen Verbinder sparen.
  • Text im ioBroker Protokoll ausgeben

    6
    0 Stimmen
    6 Beiträge
    346 Aufrufe
    mickymM
    @hotspot_2 bzw. Du kannst ja auch jede Nachrichteneigenschaft ausgeben. [image: 1728389864221-83ba3a97-4b7c-4289-9fb3-af47fbf64190-image-resized.png] [image: 1728389879825-adff3ff0-2447-4033-a155-3882833d8d77-image.png] Spoiler [ { "id": "bb6b10bafe8a9a01", "type": "inject", "z": "517cd16e4d7e6ae4", "name": "", "props": [ { "p": "trigger", "v": "true", "vt": "bool" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 290, "y": 6920, "wires": [ [ "33f0037a4f78ea5e" ] ] }, { "id": "33f0037a4f78ea5e", "type": "change", "z": "517cd16e4d7e6ae4", "name": "Schalte Licht", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "true", "tot": "bool" }, { "t": "set", "p": "note", "pt": "msg", "to": "Licht eingeschaltet", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 490, "y": 6920, "wires": [ [ "4f53d8783c85da77", "58781438c2b474cc" ] ] }, { "id": "4f53d8783c85da77", "type": "debug", "z": "517cd16e4d7e6ae4", "name": "debug", "active": true, "tosidebar": true, "console": false, "tostatus": true, "complete": "payload", "targetType": "msg", "statusVal": "payload", "statusType": "auto", "x": 690, "y": 6920, "wires": [] }, { "id": "58781438c2b474cc", "type": "debug", "z": "517cd16e4d7e6ae4", "name": "Lichtschalter Wohnzimmer", "active": true, "tosidebar": false, "console": true, "tostatus": false, "complete": "note", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 760, "y": 6980, "wires": [] } ]
  • [gelöst] Passwort für Node Red "vergessen"

    3
    0 Stimmen
    3 Beiträge
    835 Aufrufe
    P
    @_r_a_l_f_ Danke, hat funktioniert.
  • Diagramm ohne Zeitachse

    4
    0 Stimmen
    4 Beiträge
    511 Aufrufe
    HomeWolfH
    @bernd1967 hast du hier ein Ergebnis hinbekommen ?
  • Einfacher Taster mit Node-Red

    4
    1
    0 Stimmen
    4 Beiträge
    1k Aufrufe
    mickymM
    Ich hab mal einen Flow mit vis oder NR dashboard gemacht. Letztlich brauchst Du nur einen Taster, der beim Loslassen false und beim Drücken true liefert. Spoiler [ { "id": "9485df68.fd8ba", "type": "tab", "label": "Tutorial vis Taster", "disabled": false, "info": "" }, { "id": "b0c81813.4154f8", "type": "ioBroker in", "z": "9485df68.fd8ba", "d": true, "name": "taster", "attrname": "", "topic": "0_userdata.0.dimmer.taster", "payloadType": "value", "onlyack": "", "func": "rbe", "gap": "", "fireOnStart": "false", "x": 130, "y": 100, "wires": [ [ "16e2170a.87ef89" ] ] }, { "id": "dc014311.a8d3f", "type": "debug", "z": "9485df68.fd8ba", "name": "Taste gedrückt", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 600, "y": 60, "wires": [] }, { "id": "16e2170a.87ef89", "type": "trigger", "z": "9485df68.fd8ba", "name": "", "op1": "true", "op2": "", "op1type": "bool", "op2type": "payl", "duration": "-250", "extend": true, "overrideDelay": false, "units": "ms", "reset": "false", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 370, "y": 100, "wires": [ [ "dc014311.a8d3f", "a123b62d.af5fa8" ] ] }, { "id": "9982d6c4.29e058", "type": "switch", "z": "9485df68.fd8ba", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 310, "y": 220, "wires": [ [ "d38eb95d.854638", "a123b62d.af5fa8" ] ] }, { "id": "d38eb95d.854638", "type": "debug", "z": "9485df68.fd8ba", "name": "Taste losgelassen", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 490, "y": 280, "wires": [] }, { "id": "a123b62d.af5fa8", "type": "function", "z": "9485df68.fd8ba", "name": "", "func": "var count = context.get('count') || 0;\nvar longpress = context.get('longpress') || false;\nif (msg.payload){\n count += 1;\n context.set('count',count);\n if (count > 5) { // Wert erhöhen wenn Longpress zu früh erkannt wird\n longpress = true;\n context.set('longpress',longpress);\n return [null,msg];\n }\n} else {\n msg.payload=true;\n count = 0;\n context.set('count',count); \n if (!longpress) return [msg,null];\n longpress = false;\n context.set('longpress',longpress);\n}\n", "outputs": 2, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 590, "y": 180, "wires": [ [ "65393650.6cfcd8", "1dbf19e0.f8af96" ], [ "faaddc42.671cf", "c5e2ef2d.6e447" ] ], "outputLabels": [ "shortpress", "longpress" ] }, { "id": "65393650.6cfcd8", "type": "debug", "z": "9485df68.fd8ba", "name": "shortpress", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 810, "y": 100, "wires": [] }, { "id": "faaddc42.671cf", "type": "debug", "z": "9485df68.fd8ba", "name": "longpress", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 800, "y": 340, "wires": [] }, { "id": "a9311da5.e0c66", "type": "ioBroker in", "z": "9485df68.fd8ba", "d": true, "name": "status", "attrname": "", "topic": "mqtt.1.shellies.shellydimmer.light.0.status", "payloadType": "value", "onlyack": "", "func": "rbe", "gap": "", "fireOnStart": "false", "x": 130, "y": 520, "wires": [ [ "15d1fa89.761575" ] ] }, { "id": "35413631.c8570a", "type": "debug", "z": "9485df68.fd8ba", "name": "status", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 430, "y": 460, "wires": [] }, { "id": "15d1fa89.761575", "type": "json", "z": "9485df68.fd8ba", "name": "", "property": "payload", "action": "", "pretty": false, "x": 270, "y": 520, "wires": [ [ "35413631.c8570a", "eeebcf13.9b2fd", "af96a9a1.7e48c8" ] ] }, { "id": "eeebcf13.9b2fd", "type": "change", "z": "9485df68.fd8ba", "name": "setze flow Variablen", "rules": [ { "t": "set", "p": "ison", "pt": "flow", "to": "payload.ison", "tot": "msg" }, { "t": "set", "p": "brightness", "pt": "flow", "to": "payload.brightness", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 480, "y": 520, "wires": [ [] ] }, { "id": "1dbf19e0.f8af96", "type": "change", "z": "9485df68.fd8ba", "name": "switch (toggle)", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "ison", "tot": "flow" }, { "t": "set", "p": "payload", "pt": "msg", "to": "$not(payload)\t", "tot": "jsonata" }, { "t": "set", "p": "ison", "pt": "flow", "to": "payload", "tot": "msg" }, { "t": "set", "p": "down", "pt": "flow", "to": "payload", "tot": "msg" }, { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "on", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "off", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 800, "y": 140, "wires": [ [ "f48be0e6.d432f", "c4574d9a.44f53", "f2909e1e.20a93" ] ] }, { "id": "f48be0e6.d432f", "type": "debug", "z": "9485df68.fd8ba", "name": "command", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1040, "y": 200, "wires": [] }, { "id": "c4574d9a.44f53", "type": "ioBroker out", "z": "9485df68.fd8ba", "d": true, "name": "command", "topic": "mqtt.1.shellies.shellydimmer.light.0.command", "ack": "false", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1040, "y": 140, "wires": [] }, { "id": "f2909e1e.20a93", "type": "change", "z": "9485df68.fd8ba", "name": "", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "off", "fromt": "str", "to": "0", "tot": "num" }, { "t": "change", "p": "payload", "pt": "msg", "from": "on", "fromt": "str", "to": "brightness", "tot": "flow" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1050, "y": 80, "wires": [ [ "6d903925.3ff818" ] ] }, { "id": "6d903925.3ff818", "type": "ioBroker out", "z": "9485df68.fd8ba", "d": true, "name": "brightness", "topic": "0_userdata.0.dimmer.brightness", "ack": "true", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 1240, "y": 80, "wires": [] }, { "id": "88d6e66a.ddb258", "type": "inject", "z": "9485df68.fd8ba", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "false", "payloadType": "bool", "x": 110, "y": 720, "wires": [ [ "e9fb15f5.98b588" ] ] }, { "id": "e9fb15f5.98b588", "type": "change", "z": "9485df68.fd8ba", "name": "", "rules": [ { "t": "set", "p": "down", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 290, "y": 720, "wires": [ [] ] }, { "id": "c5e2ef2d.6e447", "type": "switch", "z": "9485df68.fd8ba", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "istype", "v": "boolean", "vt": "boolean" }, { "t": "istype", "v": "number", "vt": "number" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 810, "y": 300, "wires": [ [ "ca4f99bd.cfa6f8" ], [ "ff1bde73.7c88" ] ] }, { "id": "ca4f99bd.cfa6f8", "type": "change", "z": "9485df68.fd8ba", "name": "", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "brightness", "tot": "flow" }, { "t": "change", "p": "payload", "pt": "msg", "from": "100", "fromt": "num", "to": "98", "tot": "num" }, { "t": "change", "p": "payload", "pt": "msg", "from": "0", "fromt": "num", "to": "2", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1020, "y": 240, "wires": [ [ "c5e2ef2d.6e447" ] ] }, { "id": "ff1bde73.7c88", "type": "switch", "z": "9485df68.fd8ba", "name": "brightness zwischen 2 und 98", "property": "payload", "propertyType": "msg", "rules": [ { "t": "btwn", "v": "2", "vt": "num", "v2": "98", "v2t": "num" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 1050, "y": 320, "wires": [ [ "4f962993.612978" ] ] }, { "id": "4f962993.612978", "type": "switch", "z": "9485df68.fd8ba", "name": "", "property": "down", "propertyType": "flow", "rules": [ { "t": "true" }, { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 1270, "y": 320, "wires": [ [ "ece0bc1e.1d06c" ], [ "a0118b8f.a7ca18" ] ] }, { "id": "ece0bc1e.1d06c", "type": "change", "z": "9485df68.fd8ba", "name": "Verringere Brightness um 2", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload - 2", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1510, "y": 280, "wires": [ [ "71a8a0f2.c1756" ] ] }, { "id": "a0118b8f.a7ca18", "type": "change", "z": "9485df68.fd8ba", "name": "Erhöhe Brightness um 2", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "payload + 2", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1500, "y": 340, "wires": [ [ "71a8a0f2.c1756" ] ] }, { "id": "71a8a0f2.c1756", "type": "switch", "z": "9485df68.fd8ba", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "gt", "v": "98", "vt": "num" }, { "t": "lt", "v": "2", "vt": "str" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 1740, "y": 300, "wires": [ [ "879502b2.7de07" ], [ "f57bd65b.705688" ], [ "58308d21.de8e84" ] ] }, { "id": "879502b2.7de07", "type": "change", "z": "9485df68.fd8ba", "name": "= 100", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "100", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1900, "y": 260, "wires": [ [ "58308d21.de8e84" ] ] }, { "id": "f57bd65b.705688", "type": "change", "z": "9485df68.fd8ba", "name": "= 0", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "0", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1900, "y": 300, "wires": [ [ "58308d21.de8e84" ] ] }, { "id": "58308d21.de8e84", "type": "change", "z": "9485df68.fd8ba", "name": "Update flow.brightness", "rules": [ { "t": "set", "p": "brightness", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2120, "y": 340, "wires": [ [ "33d29b3d.a84344", "fb67d520.bc8208" ] ] }, { "id": "33d29b3d.a84344", "type": "rbe", "z": "9485df68.fd8ba", "name": "", "func": "rbe", "gap": "", "start": "", "inout": "out", "septopics": true, "property": "payload", "topi": "topic", "x": 2330, "y": 340, "wires": [ [ "8ef3400d.e495", "d66fdb59.ee3d88" ] ] }, { "id": "fb67d520.bc8208", "type": "trigger", "z": "9485df68.fd8ba", "name": "", "op1": "", "op2": "true", "op1type": "nul", "op2type": "bool", "duration": "1", "extend": true, "overrideDelay": false, "units": "s", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 2350, "y": 420, "wires": [ [ "1110ff6a.6c0661" ] ] }, { "id": "1110ff6a.6c0661", "type": "change", "z": "9485df68.fd8ba", "name": "", "rules": [ { "t": "set", "p": "down", "pt": "flow", "to": "$not($flowContext('down'))\t", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2550, "y": 420, "wires": [ [] ] }, { "id": "8ef3400d.e495", "type": "ioBroker out", "z": "9485df68.fd8ba", "d": true, "name": "brightness", "topic": "0_userdata.0.dimmer.brightness", "ack": "false", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 2510, "y": 340, "wires": [] }, { "id": "b2d86076.b0a04", "type": "change", "z": "9485df68.fd8ba", "name": "", "rules": [ { "t": "move", "p": "payload", "pt": "msg", "to": "brightness", "tot": "msg" }, { "t": "set", "p": "payload", "pt": "msg", "to": "{\"brightness\":70,\"turn\":\"on\"}", "tot": "json" }, { "t": "move", "p": "brightness", "pt": "msg", "to": "payload.brightness", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2680, "y": 280, "wires": [ [ "3fe9eb1.ff60414" ] ] }, { "id": "d66fdb59.ee3d88", "type": "switch", "z": "9485df68.fd8ba", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "0", "vt": "num" }, { "t": "gt", "v": "0", "vt": "num" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 2490, "y": 260, "wires": [ [ "b3cabeb1.02f96" ], [ "b2d86076.b0a04" ] ] }, { "id": "b3cabeb1.02f96", "type": "change", "z": "9485df68.fd8ba", "name": "", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "{\"brightness\":0,\"turn\":\"off\"}", "tot": "json" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 2690, "y": 240, "wires": [ [ "3fe9eb1.ff60414" ] ] }, { "id": "3fe9eb1.ff60414", "type": "json", "z": "9485df68.fd8ba", "name": "", "property": "payload", "action": "", "pretty": false, "x": 2890, "y": 260, "wires": [ [ "583ee091.d82b2" ] ] }, { "id": "583ee091.d82b2", "type": "ioBroker out", "z": "9485df68.fd8ba", "d": true, "name": "", "topic": "mqtt.1.shellies.light.0.set", "ack": "false", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 3110, "y": 260, "wires": [] }, { "id": "98936af7.b84158", "type": "ioBroker in", "z": "9485df68.fd8ba", "d": true, "name": "taster", "attrname": "", "topic": "0_userdata.0.dimmer.taster", "payloadType": "value", "onlyack": "", "func": "rbe", "gap": "", "fireOnStart": "false", "x": 130, "y": 220, "wires": [ [ "9982d6c4.29e058" ] ] }, { "id": "af96a9a1.7e48c8", "type": "change", "z": "9485df68.fd8ba", "name": "", "rules": [ { "t": "move", "p": "payload", "pt": "msg", "to": "status", "tot": "msg" }, { "t": "change", "p": "status.ison", "pt": "msg", "from": "false", "fromt": "bool", "to": "0", "tot": "num" }, { "t": "change", "p": "status.ison", "pt": "msg", "from": "true", "fromt": "bool", "to": "status.brightness", "tot": "msg" }, { "t": "set", "p": "payload", "pt": "msg", "to": "status.ison", "tot": "msg" }, { "t": "delete", "p": "status", "pt": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 460, "y": 580, "wires": [ [ "c281079b.e9e728" ] ] }, { "id": "c281079b.e9e728", "type": "ioBroker out", "z": "9485df68.fd8ba", "d": true, "name": "brightness", "topic": "0_userdata.0.dimmer.brightness", "ack": "false", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 670, "y": 580, "wires": [] }, { "id": "b9b257e.70ef5a8", "type": "ui_template", "z": "9485df68.fd8ba", "group": "57f13d6f733e5c9d", "name": "momentary", "order": 17, "width": 3, "height": 1, "format": "<style>\n.nr-dashboard-template {\n padding: 0px;\n}\n</style>\n<div class=\"momentary_1\">\n <md-button style=\"width:100%; height:48px; margin: 0px; background-color: var(--nr-dashboard-widgetBackgroundColor); padding-top: 10px;\" ><i class=\"fa fa-lightbulb-o fa-2x\"> </i></md-button>\n</div>\n\n<script>\n\n(function($scope) {\n\n$('.momentary_1').on('touchstart mousedown', function(e) {\n // e.preventDefault(); //prevent default behavior\n $scope.send({\"payload\": true});\n});\n\n$('.momentary_1').on('touchend mouseup', function(e) {\n // e.preventDefault(); //prevent default behavior\n $scope.send({\"payload\": false});\n});\n \n})(scope);\n</script>", "storeOutMessages": false, "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", "className": "", "x": 130, "y": 160, "wires": [ [ "16e2170a.87ef89", "9982d6c4.29e058" ] ] }, { "id": "bd9be677d25dbd6b", "type": "inject", "z": "9485df68.fd8ba", "name": "Test", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"ison\":false,\"brightness\":0}", "payloadType": "json", "x": 230, "y": 460, "wires": [ [ "eeebcf13.9b2fd" ] ] }, { "id": "57f13d6f733e5c9d", "type": "ui_group", "name": "Test", "tab": "20b3095113f94d70", "order": 1, "disp": true, "width": "6", "collapse": false, "className": "" }, { "id": "20b3095113f94d70", "type": "ui_tab", "name": "Home", "icon": "dashboard", "order": 2, "disabled": false, "hidden": false } ]
  • Node Red UND Verknüpfung

    6
    1
    0 Stimmen
    6 Beiträge
    1k Aufrufe
    mickymM
    So hier nochmal die Lösung mit der JOIN Node - um ein Objekt aus Position und Kommando zu erstellen: [image: 1727300736712-a7cd02ec-5d77-4f39-acdc-fe5be336a23e-image-resized.png] nun sind aus beiden Ästen die Werte in einem Nachrichtenobjekt und können verglichen werden. Ich nutze wie gesagt keine UND Nodes - aber im Prinzip sollte man damit auch die Eigenschaften kombinieren können. Ich nutze einfach mal eine herkömmliche switch Node. Ob es eine UND Verknüpfung ist oder ob es nicht sinnvoller ist auf Gleichheit zu prüfen, dass also Kommando und Position übereinstimmt. [image: 1727301255507-56db0a6b-9af3-4a7d-a91b-23970dc760e7-image-resized.png] Hier zum Test und Import: Spoiler [ { "id": "95c4f5aa0e5be2f7", "type": "inject", "z": "517cd16e4d7e6ae4", "g": "a42120ea2999ca28", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "true", "payloadType": "bool", "x": 110, "y": 6200, "wires": [ [ "1951798dc9461062" ] ] }, { "id": "3c52dbf6be6a8aec", "type": "inject", "z": "517cd16e4d7e6ae4", "g": "a42120ea2999ca28", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "false", "payloadType": "bool", "x": 110, "y": 6240, "wires": [ [ "1951798dc9461062" ] ] }, { "id": "9d3e01934f058bbf", "type": "inject", "z": "517cd16e4d7e6ae4", "g": "19f3685c99fcdc4a", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "true", "payloadType": "bool", "x": 110, "y": 6380, "wires": [ [ "715a58cae92106bf" ] ] }, { "id": "7e4246a16bb59778", "type": "inject", "z": "517cd16e4d7e6ae4", "g": "19f3685c99fcdc4a", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "false", "payloadType": "bool", "x": 110, "y": 6420, "wires": [ [ "715a58cae92106bf" ] ] }, { "id": "1951798dc9461062", "type": "delay", "z": "517cd16e4d7e6ae4", "name": "", "pauseType": "delay", "timeout": "6", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "allowrate": false, "outputs": 1, "x": 300, "y": 6220, "wires": [ [ "0664a6b7867b1019" ] ] }, { "id": "715a58cae92106bf", "type": "change", "z": "517cd16e4d7e6ae4", "name": "Tor offen", "rules": [], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 320, "y": 6400, "wires": [ [ "9eecd47ad11c87fe" ] ] }, { "id": "0664a6b7867b1019", "type": "change", "z": "517cd16e4d7e6ae4", "name": "", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "command", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 500, "y": 6220, "wires": [ [ "6f2453256b50df08" ] ] }, { "id": "9eecd47ad11c87fe", "type": "change", "z": "517cd16e4d7e6ae4", "name": "", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "position", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 500, "y": 6400, "wires": [ [ "6f2453256b50df08" ] ] }, { "id": "6f2453256b50df08", "type": "join", "z": "517cd16e4d7e6ae4", "name": "", "mode": "custom", "build": "object", "property": "payload", "propertyType": "msg", "key": "topic", "joiner": "\\n", "joinerType": "str", "accumulate": false, "timeout": "", "count": "2", "reduceRight": false, "reduceExp": "", "reduceInit": "", "reduceInitType": "", "reduceFixup": "", "x": 670, "y": 6300, "wires": [ [ "23b0738ffe91dbda", "a7dce32474e819c9" ] ] }, { "id": "23b0738ffe91dbda", "type": "debug", "z": "517cd16e4d7e6ae4", "name": "Objekt", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 830, "y": 6240, "wires": [] }, { "id": "a7dce32474e819c9", "type": "switch", "z": "517cd16e4d7e6ae4", "name": "position UND command", "property": "payload.position = payload.command", "propertyType": "jsonata", "rules": [ { "t": "true" }, { "t": "false" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 870, "y": 6300, "wires": [ [ "415bc3c99d8b1269" ], [ "90abb22c58c4f696", "8cc3f991b55c7b8c" ] ] }, { "id": "415bc3c99d8b1269", "type": "debug", "z": "517cd16e4d7e6ae4", "name": "Kommando und Position sind gleich, keine Aktion", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1210, "y": 6240, "wires": [] }, { "id": "90abb22c58c4f696", "type": "debug", "z": "517cd16e4d7e6ae4", "name": "Kommando und Position ungleich => Aktion", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1190, "y": 6380, "wires": [] }, { "id": "8cc3f991b55c7b8c", "type": "trigger", "z": "517cd16e4d7e6ae4", "name": "", "op1": "1", "op2": "0", "op1type": "val", "op2type": "val", "duration": "250", "extend": "false", "overrideDelay": "false", "units": "ms", "reset": "", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 1120, "y": 6320, "wires": [ [] ] } ]
  • json mit Zeilenumbruch versehen in Nodered

    2
    0 Stimmen
    2 Beiträge
    221 Aufrufe
    mickymM
    @flehmann1234 das macht man so nicht. Das ist ja ein fertiges Array, da kann man eine Tabelle zaubern. Aber wenn du es halt lieber kaputt mavhen willst, dann nimm in Jsonata die $join Funktion (change node)
  • [gelöst]SET Temperatur Homematic wird nicht übernommen

    heating node-red
    4
    1
    0 Stimmen
    4 Beiträge
    383 Aufrufe
    S
    @marc-berg @mickym wie peinlich........ Fehler 40 Dankeschöööön ...in der RaspberryMatic war auch noch so einiges im Argen... aber jetzt geht es ohweh :blush:
  • [Gelöst] NodeRed lässt sich nicht mehr starten

    3
    0 Stimmen
    3 Beiträge
    348 Aufrufe
    geschildG
    @peterfido Ich danke dir. Läuft wieder.:+1:
  • Abfrage von Parameter in JSON mit "%"

    3
    3
    0 Stimmen
    3 Beiträge
    334 Aufrufe
    A
    @marc-berg Vielen Dank :)
  • Toggle-Funktion auf zwei unterschiedliche Datenpunkte

    node-red
    5
    0 Stimmen
    5 Beiträge
    354 Aufrufe
    MichMeinM
    Guten Morgen @mickym, ich bin nun dazu gekommen deinen flow zu integrieren und es funktioniert ganz hervorragend. Vielen Dank für deine Hilfe und einen schönen Sonntag noch!
  • Laden des Autos mit festem Wert

    13
    1
    0 Stimmen
    13 Beiträge
    960 Aufrufe
    mickymM
    @gr ich bin unterwegs. Ja dann hast NodeRed noch nicht verstanden. Im Moment wird der Flow nur durch Dein Dashboard getriggert. Willst du dass das zyklisch automatisch aktualisiert wird, musst du mit einer trigger Node und der payload, die Change Node immer wieder triggern und so den Kontext erneut abrufen und somit aktualisieren
  • Injection mit ioBroker in triggern

    3
    1
    0 Stimmen
    3 Beiträge
    235 Aufrufe
    P
    Ciao @peterfido Vielen Dank für deine Antwort und Hilfe! Ich schätze das sehr. Mit ein paar grauen Haaren mehr konnte ich es nun lösen. Für alle die vor einem ähnlichen Problem stehen, wäre dies die Lösung: [image: 1725044627214-910916c5-0b08-44af-a711-90b4f66d4d50-image.png]
  • Iobroker Geräte an Philips Hue

    6
    0 Stimmen
    6 Beiträge
    435 Aufrufe
    AphofisA
    @peterfido ok
  • Hilfe bei debuggen einer übernommenen Funktion

    157
    0 Stimmen
    157 Beiträge
    15k Aufrufe
    mickymM
    @bf0911 Also ich kann Dir nur sagen, dass sich das Dashboard von sich aus nichts merkt. Wie gesagt werden die Defaultwerte nur gesetzt, wenn Du Alle Flows neustartest Den Adapter oder iobroker neu startest. Wenn in den Objekten alles richtig ist, dann lies die halt beim Start von NodeRed ein. So was sieht mir danach aus, als ob beim Start undefinierte Werte vorliegen. [image: 1725021445387-6a0f302b-aa19-4aa2-988e-49e41027bdb8-image-resized.png] Schau mal, ob Du beim Start von NodeRed das Objekt auch einliest. [image: 1725021550345-4083a4cc-2294-4f3b-8955-bb79e4dddd60-image.png] Ansonsten musst Du schauen, woher die Werte kommen und wann das auftritt. Das Dashboard setzt sich nur bei Neustart oder beim Zurücksetzen aller Flows zurück. Also Flows neustarten setzt auch das Dashboard zurück: [image: 1725021728909-71038981-26b9-4252-bc4f-80c9b26745fa-image.png]

772

Online

32.4k

Benutzer

81.4k

Themen

1.3m

Beiträge