Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Node-Red
    5. [Gelöst] Benötige Hilfe mit Node-Red in Verbindung mit homee

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [Gelöst] Benötige Hilfe mit Node-Red in Verbindung mit homee

    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      Oli @mickym last edited by Oli

      @mickym
      habe jetzt endlich mal die Zeit gefunden, mich wieder etwas intensiver mit dem Thema zu beschäftigen und schon kommen die ersten Fragen.

      Auf youtube einen Flow aus dem homee Forum gefunden und versucht ihn auf meine Bedürfnisse anzupassen

      [
         {
             "id": "9c280ddf049b2b4d",
             "type": "tab",
             "label": "homee Geräte nicht verfügbar",
             "disabled": false,
             "info": "",
             "env": []
         },
         {
             "id": "abe0cd5c.e4eb6",
             "type": "template",
             "z": "9c280ddf049b2b4d",
             "name": "",
             "field": "payload",
             "fieldType": "msg",
             "format": "handlebars",
             "syntax": "mustache",
             "template": "put:/homeegrams/57/actions/233?message={{payload}}",
             "output": "str",
             "x": 1240,
             "y": 340,
             "wires": [
                 [
                     "639fad52.c9ee84"
                 ]
             ]
         },
         {
             "id": "639fad52.c9ee84",
             "type": "link out",
             "z": "9c280ddf049b2b4d",
             "name": "",
             "mode": "link",
             "links": [
                 "c275701dad5fdd80"
             ],
             "x": 1365,
             "y": 300,
             "wires": []
         },
         {
             "id": "f9934298.666fd",
             "type": "delay",
             "z": "9c280ddf049b2b4d",
             "name": "",
             "pauseType": "delay",
             "timeout": "2",
             "timeoutUnits": "seconds",
             "rate": "1",
             "nbRateUnits": "1",
             "rateUnits": "second",
             "randomFirst": "1",
             "randomLast": "5",
             "randomUnits": "seconds",
             "drop": false,
             "outputs": 1,
             "x": 1080,
             "y": 260,
             "wires": [
                 [
                     "70933105.d6b9c"
                 ]
             ]
         },
         {
             "id": "70933105.d6b9c",
             "type": "template",
             "z": "9c280ddf049b2b4d",
             "name": "",
             "field": "payload",
             "fieldType": "msg",
             "format": "handlebars",
             "syntax": "mustache",
             "template": "put:/homeegrams/57?play=1",
             "output": "str",
             "x": 1240,
             "y": 260,
             "wires": [
                 [
                     "639fad52.c9ee84"
                 ]
             ]
         },
         {
             "id": "5a033afd.574fd4",
             "type": "link in",
             "z": "9c280ddf049b2b4d",
             "name": "",
             "links": [
                 "d87f2174cf715cf2"
             ],
             "x": 275,
             "y": 260,
             "wires": [
                 [
                     "9b6ffccc.91e0b"
                 ]
             ]
         },
         {
             "id": "9b6ffccc.91e0b",
             "type": "function",
             "z": "9c280ddf049b2b4d",
             "name": "nicht Verfügbar",
             "func": "const nodes = global.get('homee.nodes');\nconst ausschluss = [321,354,371,590]; // Ausgeschlossene ID \nvar zaehlerein = 0;\nvar zaehleraus = 0;\nvar zaehler3=0;\nvar nichterreichbar=\"\";\nvar aktualisiert = \"\";\nvar test =nodes;\nvar test1;\nvar test2;\nvar name;\nvar komponente;\nvar erreichger;\nvar aktualger;\nvar textName =\"\";\nif((msg.payload.node && ((msg.payload.node.state === 2)||(msg.payload.node.state === 12)))||msg.payload === true){\n    test.forEach(\n        function(id){\n            test2 = false\n            ausschluss.forEach(\n                function(aus){\n                    if(id.id === aus){\n                        test2 = true\n                    }\n                }\n            )\n     \n            name = id.name;\n            textName = decodeURIComponent(name);\n            textName = textName.replace(\" / \", \"-\");\n            textName = textName.replace(\" / \", \"-\");            \n            komponente = textName;\n            test1 = id.state;\n\n            if (test2 === true){\n                return\n            } \n\n            if(test1 === 1 ) {\n                zaehlerein++\n            }\n\n            if(test1 === 2 ) {\n                if(nichterreichbar.length > 1 ){\n                    nichterreichbar = nichterreichbar + \"und\"\n                }\n                nichterreichbar = nichterreichbar + \" \" + komponente + \" \";zaehleraus++\n            }\n\n            if(test1 === 12 ){\n                if(aktualisiert.length > 1 ){\n                    aktualisiert =aktualisiert + \"und\"\n                }\n                aktualisiert = aktualisiert + \" \" + komponente + \" \";zaehler3++\n            }\n        }\n    )\n\n    node.status({fill:\"green\",shape:\"ring\",text:`Verfügbar: ${zaehlerein}  nicht Verfügbar:${zaehleraus} werden aktualisiert ${zaehler3}`})\n\n    if(zaehleraus === 1){\n        erreichger = \"Gerät ist nicht erreichbar\"\n    } else {\n        erreichger = \"Geräte sind nicht erreichbar\"\n    };\n\n    if(zaehler3 === 1){\n        aktualger = \"Gerät wird aktualisiert\"\n    } else {\n        aktualger = \"Geräte werden aktualisiert\"\n    };\n\n    if (zaehleraus === 0 && zaehler3 === 0) {\n        return {\"payload\": \"Es sind alle Geräte verfügbar!\"}\n    } else {\n        return{\"payload\":`${zaehleraus} ${erreichger} - ${nichterreichbar} und ${zaehler3} ${aktualger} - ${aktualisiert}`,\"Nicht Verfügbar\":{\"Anzahl\":zaehleraus,\"Geraete\":nichterreichbar}}\n    }\n}",
             "outputs": 1,
             "noerr": 0,
             "initialize": "",
             "finalize": "",
             "libs": [],
             "x": 520,
             "y": 260,
             "wires": [
                 [
                     "fb09e5771dbf080b",
                     "5855e180c10a8b75"
                 ]
             ]
         },
         {
             "id": "cf58866b.189f28",
             "type": "inject",
             "z": "9c280ddf049b2b4d",
             "name": "",
             "props": [
                 {
                     "p": "payload"
                 },
                 {
                     "p": "topic",
                     "vt": "str"
                 }
             ],
             "repeat": "",
             "crontab": "",
             "once": false,
             "onceDelay": 0.1,
             "topic": "",
             "payload": "true",
             "payloadType": "bool",
             "x": 130,
             "y": 260,
             "wires": [
                 [
                     "9b6ffccc.91e0b"
                 ]
             ]
         },
         {
             "id": "6c5886aecc8bf8ed",
             "type": "comment",
             "z": "9c280ddf049b2b4d",
             "name": "homee Geräte nicht verfügbar",
             "info": "",
             "x": 180,
             "y": 80,
             "wires": []
         },
         {
             "id": "fb09e5771dbf080b",
             "type": "ioBroker out",
             "z": "9c280ddf049b2b4d",
             "name": "homee Geräteinfo",
             "topic": "0_userdata.0.System.homee.Geräteinfo",
             "ack": "true",
             "autoCreate": "true",
             "stateName": "0_userdata.0.System.homee.Geräteinfo",
             "role": "",
             "payloadType": "string",
             "readonly": "false",
             "stateUnit": "",
             "stateMin": "",
             "stateMax": "",
             "x": 1270,
             "y": 420,
             "wires": []
         },
         {
             "id": "5855e180c10a8b75",
             "type": "switch",
             "z": "9c280ddf049b2b4d",
             "name": "",
             "property": "payload",
             "propertyType": "msg",
             "rules": [
                 {
                     "t": "neq",
                     "v": "Es sind alle Geräte verfügbar!",
                     "vt": "str"
                 }
             ],
             "checkall": "true",
             "repair": false,
             "outputs": 1,
             "x": 810,
             "y": 260,
             "wires": [
                 [
                     "f9934298.666fd",
                     "abe0cd5c.e4eb6"
                 ]
             ]
         },
         {
             "id": "bda5c562ce50b7f0",
             "type": "ioBroker in",
             "z": "9c280ddf049b2b4d",
             "name": "start",
             "topic": "0_userdata.0.System.homee.StartGeräteinfo",
             "payloadType": "value",
             "onlyack": "update",
             "func": "all",
             "gap": "",
             "fireOnStart": "false",
             "outFormat": "MQTT",
             "x": 110,
             "y": 180,
             "wires": [
                 [
                     "9b6ffccc.91e0b"
                 ]
             ]
         }
      ]
      

      Ich möchte den Flow zusätzlich mit einem Button aus der Vis auslösen, dass funktioniert aber leider so nicht, wie ich es mir vorgestellt habe, wo muss ich den Startbutton anschließen, damit der Flow ausgeführt wird?

      Zudem möchte ich aus der Funktions-Node die Variable "zaeleraus" in deinen zusätzlichen Datenpunkt in ioBroker schreiben, muss ich mir da eine zusätzliche Funktion anlegen, oder wie stelle ich das am besten an?

      mickym 1 Reply Last reply Reply Quote 0
      • mickym
        mickym Most Active @Oli last edited by mickym

        @oli Also ehrlich gesagt - werde ich Dir auf diese Art nicht viel helfen können. Insbesondere wenn man fremde Flows übernimmt und sich da erst rein denken muss, ist es oft besser man schreibt die selbst.

        Triggern als via Button im Vis tust Du wenn Du den Datenpunkt beschreibst - also zum Beispiel Deinen Start-datenpunkt:

        8dcd449c-b4f4-4a68-bd80-9ae901872fc6-image.png

        Das Problem ist aber da VIS nur unbestätigte Werte schickt, dass Du diese heraus filterst, also entweder auf all events oder auf ack = false stellen.

        Dann halte ich es gerade am Anfang wenn Du mit NodeRed beginnen willst - es für einen furchtbaren Fehler mit function NOdes zu codieren. NodeRed ist ein grafisches Tool, womit man sowas weitgehenst vermeiden will und das ist Spaghetti-Code.

        Diese ganze Funktion kann zumindest isoliert so nicht funktionieren. Es fehlt der Kontext (globaler Kontext) und die verlinkten Flows. (s. 1. Zeile).

        Dann werden sogenannte Template Literals in seinem JavaScript Code verwendet - alles gut und schön, ist aber für Laien schlecht zu lesen (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)

        Diese ganze function Node ist für mich so nicht nachvollziehbar und deshalb kann ich da nicht helfen.

        Ich würde an Deiner Stelle lieber selber was entwickeln, als solche Flows aus dem Netz zu nehmen.

        Zudem möchte ich aus der Funktions-Node die Variable "zaeleraus" in deinen zusätzlichen Datenpunkt in ioBroker schreiben, muss ich mir da eine zusätzliche Funktion anlegen, oder wie stelle ich das am besten an?

        Ich habs mal versucht zu simulieren - ich finde es ehrlich gesagt ...

        Ich hab mal die Ausgabe simuliert:

        877474f3-3806-4a25-9267-310685bb42d2-image.png

        Die Zählerausvariable wird in dem Objekt "Nicht Verfügbar" und dort in Anzahl ausgegeben. Alleine Leerzeichen in Eigenschaftsnamen ist einfach schlechter Stil:

        Du kannst hinter die function Node noch folgende Change Node dahinter hängen;

        39910f85-7ede-406d-8182-131c7968e80d-image.png

        Das extrahiert Dir dann die zähleraus Variable wieder aus dem Objekt und Du kannst es wegschreiben.

        835d8fb9-6f68-4ba7-8d36-c8c8cad61f3d-image.png

        Also wie gesagt - wenn es bei Dir tut ist es ja fein - wenn dann musst du ggf. halt die Daten mitliefern.

        O 1 Reply Last reply Reply Quote 0
        • O
          Oli @mickym last edited by

          @mickym
          erstmal danke für deine Antwort, sorry wahrscheinlich ein typischer Anfängerfehler (kopieren, versuchen zu verstehen und versuchen dieses anzupassen).

          Die homeeApi spuckt leider nur zahlen und kryptische Wörter aus, hier mal ein Beispiel eines Heizungsthermostats:

          msg.payload : Object
          object
          node: object
          id: 5
          name: "EG%20%2F%20WC%20%2F%20Heizung"
          profile: 3006
          image: "nodeicon_temperature"
          favorite: 0
          order: 6
          protocol: 1
          routing: 0
          state: 1
          state_changed: 1678443567
          added: 1571490280
          history: 0
          cube_type: 1
          note: "%23%20EUROtronic%20Spirit%20Z-Wave%20Plus"
          services: 7
          phonetic_name: "Heizung%20Toilette"
          owner: 1
          security: 0
          attributes: array[15]
          [0 … 9]
          0: object
          id: 74
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 0
          current_value: 0
          target_value: 0
          last_value: 0
          unit: "text"
          step_value: 1
          editable: 0
          type: 44
          state: 1
          last_changed: 1571490280
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: "4.61"
          name: ""
          1: object
          id: 75
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 0
          current_value: 0
          target_value: 0
          last_value: 0
          unit: "text"
          step_value: 1
          editable: 0
          type: 45
          state: 1
          last_changed: 1571490280
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: "0.16"
          name: ""
          2: object
          id: 76
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 1
          current_value: 0
          target_value: 0
          last_value: 0
          unit: ""
          step_value: 1
          editable: 1
          type: 91
          state: 1
          last_changed: 1583340481
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          3: object
          id: 77
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 100
          current_value: 35
          target_value: 35
          last_value: 37
          unit: "%25"
          step_value: 1
          editable: 0
          type: 18
          state: 1
          last_changed: 1678471005
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          4: object
          id: 78
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 100
          current_value: 55
          target_value: 55
          last_value: 55
          unit: "%25"
          step_value: 1
          editable: 0
          type: 8
          state: 1
          last_changed: 1678459725
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          options: object
          5: object
          id: 79
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 4
          current_value: 1
          target_value: 1
          last_value: 1
          unit: ""
          step_value: 1
          editable: 1
          type: 258
          state: 1
          last_changed: 1678428356
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          6: object
          id: 80
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 180
          current_value: 0
          target_value: 0
          last_value: 0
          unit: "%C2%B0"
          step_value: 180
          editable: 1
          type: 90
          state: 1
          last_changed: 1571490280
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          7: object
          id: 81
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 30
          current_value: 0
          target_value: 0
          last_value: 0
          unit: "s"
          step_value: 5
          editable: 1
          type: 259
          state: 1
          last_changed: 1571490280
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          8: object
          id: 82
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 1
          current_value: 1
          target_value: 1
          last_value: 0
          unit: ""
          step_value: 1
          editable: 1
          type: 260
          state: 1
          last_changed: 1571490280
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          9: object
          id: 83
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 3
          current_value: 2
          target_value: 2
          last_value: 0
          unit: ""
          step_value: 1
          editable: 1
          type: 261
          state: 1
          last_changed: 1571490280
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          [10 … 14]
          10: object
          id: 84
          node_id: 5
          instance: 0
          minimum: -5
          maximum: 5
          current_value: 0
          target_value: 0
          last_value: 0
          unit: "%C2%B0C"
          step_value: 0.1
          editable: 1
          type: 64
          state: 1
          last_changed: 1571490280
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          11: object
          id: 85
          node_id: 5
          instance: 0
          minimum: -50
          maximum: 125
          current_value: 18.93
          target_value: 18.93
          last_value: 18.84
          unit: "%C2%B0C"
          step_value: 1
          editable: 0
          type: 5
          state: 1
          last_changed: 1678471005
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          options: object
          can_observe: array[1]
          0: 5
          history: object
          day: 1
          week: 26
          month: 6
          12: object
          id: 86
          node_id: 5
          instance: 0
          minimum: 8
          maximum: 28
          current_value: 19
          target_value: 19
          last_value: 8
          unit: "%C2%B0C"
          step_value: 0.5
          editable: 1
          type: 6
          state: 1
          last_changed: 1678443559
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          options: object
          can_observe: array[1]
          0: 6
          automations: array[1]
          0: "step"
          history: object
          day: 35
          week: 5
          month: 1
          stepped: true
          13: object
          id: 87
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 1
          current_value: 0
          target_value: 0
          last_value: 0
          unit: ""
          step_value: 1
          editable: 0
          type: 69
          state: 1
          last_changed: 1661403111
          changed_by: 1
          changed_by_id: 0
          based_on: 1
          data: ""
          name: ""
          options: object
          history: object
          day: 182
          week: 26
          month: 6
          stepped: true
          14: object
          id: 459
          node_id: 5
          instance: 0
          minimum: 0
          maximum: 1
          current_value: 1
          target_value: 1
          last_value: 0
          unit: ""
          step_value: 1
          editable: 1
          type: 385
          state: 1
          last_changed: 0
          changed_by: 0
          changed_by_id: 0
          based_on: 0
          data: ""
          name: ""
          Made 2 formatting edits on line 33
          

          Der ursprüngliche Flow liest den Punkt "state" aus, 1 = Verfügbar, 2 = nicht Verfügbar, 12 = wird Aktualisiert, erstellt einen Text und löst eine Pushnachricht in der homee App mit diesem Text aus. Dieses funktioniert auch. Das schreiben in einen Datenpunkt von ioBroker und den Startbutton habe ich zusätzlich noch hinzugefügt.

          Ich fange auch gerne nochmal bei null an, wie würdest du das denn umsetzen?

          mickym 2 Replies Last reply Reply Quote 0
          • mickym
            mickym Most Active @Oli last edited by

            @oli Wenn Du Daten hier rein kopieren möchtest das man die verwenden kann, dann bitte nicht über kopieren des Textes aus dem Debugfenster sondern in dem Du den Wert direkt aus dem Debugfenster direkt kopierst und hier in Code-Tags einfügst.

            copy path.gif

            Also immer rechts neben den Wert und dann über Wert kopieren hier in CodeTags einfügen.

            1 Reply Last reply Reply Quote 0
            • mickym
              mickym Most Active @Oli last edited by

              @oli sagte in Benötige Hilfe mit Node-Red in Verbindung mit homee:

              Ich fange auch gerne nochmal bei null an, wie würdest du das denn umsetzen?

              Nun da würde ich generell immer mit den Daten anfangen und dann was Du alles erreichen möchtest.

              O 1 Reply Last reply Reply Quote 0
              • O
                Oli @mickym last edited by

                @mickym

                {"node":{"id":5,"name":"EG%20%2F%20WC%20%2F%20Heizung","profile":3006,"image":"nodeicon_temperature","favorite":0,"order":6,"protocol":1,"routing":0,"state":1,"state_changed":1678443567,"added":1571490280,"history":0,"cube_type":1,"note":"%23%20EUROtronic%20Spirit%20Z-Wave%20Plus","services":7,"phonetic_name":"Heizung%20Toilette","owner":1,"security":0,"attributes":[{"id":74,"node_id":5,"instance":0,"minimum":0,"maximum":0,"current_value":0,"target_value":0,"last_value":0,"unit":"text","step_value":1,"editable":0,"type":44,"state":1,"last_changed":1571490280,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"4.61","name":""},{"id":75,"node_id":5,"instance":0,"minimum":0,"maximum":0,"current_value":0,"target_value":0,"last_value":0,"unit":"text","step_value":1,"editable":0,"type":45,"state":1,"last_changed":1571490280,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"0.16","name":""},{"id":76,"node_id":5,"instance":0,"minimum":0,"maximum":1,"current_value":0,"target_value":0,"last_value":0,"unit":"","step_value":1,"editable":1,"type":91,"state":1,"last_changed":1583340481,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":""},{"id":77,"node_id":5,"instance":0,"minimum":0,"maximum":100,"current_value":34,"target_value":34,"last_value":35,"unit":"%25","step_value":1,"editable":0,"type":18,"state":1,"last_changed":1678473765,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":""},{"id":78,"node_id":5,"instance":0,"minimum":0,"maximum":100,"current_value":55,"target_value":55,"last_value":55,"unit":"%25","step_value":1,"editable":0,"type":8,"state":1,"last_changed":1678459725,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":"","options":{"history":{"day":182,"week":26,"month":6}}},{"id":79,"node_id":5,"instance":0,"minimum":0,"maximum":4,"current_value":1,"target_value":1,"last_value":1,"unit":"","step_value":1,"editable":1,"type":258,"state":1,"last_changed":1678428356,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":""},{"id":80,"node_id":5,"instance":0,"minimum":0,"maximum":180,"current_value":0,"target_value":0,"last_value":0,"unit":"%C2%B0","step_value":180,"editable":1,"type":90,"state":1,"last_changed":1571490280,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":""},{"id":81,"node_id":5,"instance":0,"minimum":0,"maximum":30,"current_value":0,"target_value":0,"last_value":0,"unit":"s","step_value":5,"editable":1,"type":259,"state":1,"last_changed":1571490280,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":""},{"id":82,"node_id":5,"instance":0,"minimum":0,"maximum":1,"current_value":1,"target_value":1,"last_value":0,"unit":"","step_value":1,"editable":1,"type":260,"state":1,"last_changed":1571490280,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":""},{"id":83,"node_id":5,"instance":0,"minimum":0,"maximum":3,"current_value":2,"target_value":2,"last_value":0,"unit":"","step_value":1,"editable":1,"type":261,"state":1,"last_changed":1571490280,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":""},{"id":84,"node_id":5,"instance":0,"minimum":-5,"maximum":5,"current_value":0,"target_value":0,"last_value":0,"unit":"%C2%B0C","step_value":0.1,"editable":1,"type":64,"state":1,"last_changed":1571490280,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":""},{"id":85,"node_id":5,"instance":0,"minimum":-50,"maximum":125,"current_value":19.1,"target_value":19.1,"last_value":19.02,"unit":"%C2%B0C","step_value":1,"editable":0,"type":5,"state":1,"last_changed":1678476525,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":"","options":{"can_observe":[5],"history":{"day":1,"week":26,"month":6}}},{"id":86,"node_id":5,"instance":0,"minimum":8,"maximum":28,"current_value":19,"target_value":19,"last_value":8,"unit":"%C2%B0C","step_value":0.5,"editable":1,"type":6,"state":1,"last_changed":1678443559,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":"","options":{"can_observe":[6],"automations":["step"],"history":{"day":35,"week":5,"month":1,"stepped":true}}},{"id":87,"node_id":5,"instance":0,"minimum":0,"maximum":1,"current_value":0,"target_value":0,"last_value":0,"unit":"","step_value":1,"editable":0,"type":69,"state":1,"last_changed":1661403111,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":"","options":{"history":{"day":182,"week":26,"month":6,"stepped":true}}},{"id":459,"node_id":5,"instance":0,"minimum":0,"maximum":1,"current_value":1,"target_value":1,"last_value":0,"unit":"","step_value":1,"editable":1,"type":385,"state":1,"last_changed":0,"changed_by":0,"changed_by_id":0,"based_on":0,"data":"","name":""}]}}
                

                Vom Prinzip möchte ich das umsetzten, was der der Flow bis jetzt zum großen Teil auch schon macht:

                1. Alles Geräte nach ihrem Status abfragen
                2. Die Anzahl der Geräte nach dem jeweilen Status zählen
                3. Einen Text mit Namen, Status und Anzahl verfassen
                4. Eine Pushnachricht in der homee App mit dem Text auslösen
                5. Den Text in einen Datenpunkt schreiben.
                6. Die Anzahl der nicht Verfügbaren Geräte in einen Datenpunkt schreiben
                7. Die ganze Aktion zusätzlich mit einem Button starten
                mickym 1 Reply Last reply Reply Quote 0
                • mickym
                  mickym Most Active @Oli last edited by

                  Nun wie gesagt . wenn du zufrieden bist - ist ja OK.

                  Ich habe mal deine Daten genommen:

                  4ede6d45-f97d-4f64-a50b-bb9a9a51bd10-image.png

                  Ist das nun ein Gerät - und was sind die 15 Attribute zu dem Gerät. Sorry kenn mich halt mit homee 0,0 aus.

                  O 1 Reply Last reply Reply Quote 0
                  • O
                    Oli @mickym last edited by

                    @mickym

                    ja, dass ist nur 1 Gerät von 46. In den Attributen stehen die einzelnen Werte drin, wie z.B. Temperatur und Batteriestand u.s.w

                    mickym 1 Reply Last reply Reply Quote 0
                    • mickym
                      mickym Most Active @Oli last edited by

                      @oli OK . das heisst die Attribute interessieren nicht, sondern es ist nur der Status in der "node" Eigenschaft selbst relevant und nicht die Attribute?

                      7f896b62-df67-4927-a0d1-4c670c16a8f7-image.png

                      Kannst Du mir dann auch das komplette Array - oder halt mehrere Geräte mit unterschiedlichem Status genauso zur Verfügung stellen. Wenn das ggf. zu groß ist, dann halt in eine Datei packen.

                      O 1 Reply Last reply Reply Quote 0
                      • O
                        Oli @mickym last edited by

                        @mickym

                        homee.txt

                        Aber gerne doch, danke für deine Hilfe!!!

                        mickym 1 Reply Last reply Reply Quote 0
                        • mickym
                          mickym Most Active @Oli last edited by mickym

                          So hier mal wieder eine Version ohne function Node - mit Spaghetti-Code. 😉

                          Ja ich musste auch erst lernen, wie man JSONATA liest - wir können das gerne genauer anschauen, aber Du musst Dich halt generell mit Objekte und Arrays auseinandersetzen.

                          567ff4a3-21da-4e99-8181-c965db4f1d83-image.png

                          Ich hab einfach die verschiedenen Filterfunktionen und Möglichkeiten von JSONATA genutzt. Im Prinzip dient dir diese ganzen Debug Nodes, damit du siehst, wie Du selektierst und auf verschiedenene Eigenschaften der Objekte zugreifst.

                          Im Prinzip habe ich alle Geräte nicht nur nach den Status (aktiv, inaktiv, updating) getrennt, sondern dies auch im Flow-Kontext gespeichert, so dass Du zeitlich unabhängig auf diese Informationen zugreifen kannst.

                          ad415215-7d83-4a49-b4b0-4de3b6c6d19c-image.png

                          Hier eine Inject Node - aber das kann natürlich auch ein trigger Datenpunkt über VIS sein.

                          Ich hab jetzt mal bewusst nicht die Namen, sondern die phonetischen Namen gewählt - aber das dient ja alles nur der Demo.

                          Es wird unten nicht nur mit der template Node gezeigt, wie Du eine Textausgabe erzeugst, sondern ich hab mal HTML Code verwendet.
                          Diese seite wird im iobroker Home Verzeichnis gespeichert. So könnte dann ein Report aussehen:

                          1519756f-dcab-4d2f-b9d3-2c2c7c5e40a0-image.png

                          Somit schau ich mal - was ich von Deinem Pflichtenheft erledigt habe:

                          1. Alles Geräte nach ihrem Status abfragen => erledigt
                          2. Die Anzahl der Geräte nach dem jeweilen Status zählen => erledigt
                          3. Einen Text mit Namen, Status und Anzahl verfassen => erledigt - ich habe HTML code erzeugt, aber reiner Text ist ja einfacher
                          4. Eine Pushnachricht in der homee App mit dem Text auslösen => musst Du machen - bzw. halt das von dem bestehenden Flow übernehmen
                          5. Den Text in einen Datenpunkt schreiben. => Nun da brauchst Du ja nur ein iobroker Out Node an die Ausgabe die Du wünschst dranhängen
                          6. Die Anzahl der nicht Verfügbaren Geräte in einen Datenpunkt schreiben => erledigt nur noch iobroker-Out Node dranhängen
                          7. Die ganze Aktion zusätzlich mit einem Button starten => erledigt, trigger mit VIS

                          Hier nun der Flow zum Import und Ausprobieren:

                          [
                             {
                                 "id": "1a49f3e7a72eeb98",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "inaktive Geräte",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1340,
                                 "y": 1120,
                                 "wires": []
                             },
                             {
                                 "id": "6f4c16eed7166074",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "decodeUrlComponents",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload ~> |$.nodes|{\"name\":$decodeUrlComponent(name),\t\"note\":$decodeUrlComponent(note),\t\"phonetic_name\":$decodeUrlComponent(phonetic_name)},\"attributes\"|",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 340,
                                 "y": 1180,
                                 "wires": [
                                     [
                                         "5c62dbd7992ee76d"
                                     ]
                                 ]
                             },
                             {
                                 "id": "5c62dbd7992ee76d",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Alle Geräte",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload.nodes",
                                         "tot": "msg"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 550,
                                 "y": 1180,
                                 "wires": [
                                     [
                                         "9ed44d883152b608"
                                     ]
                                 ]
                             },
                             {
                                 "id": "99528e0bbb0f2491",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Alle inaktiven Geräte",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload[state = 2]",
                                         "tot": "jsonata"
                                     },
                                     {
                                         "t": "set",
                                         "p": "homee.inactive",
                                         "pt": "flow",
                                         "to": "payload",
                                         "tot": "msg"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 1060,
                                 "y": 1180,
                                 "wires": [
                                     [
                                         "1a49f3e7a72eeb98",
                                         "79c90e3a205144c8",
                                         "852a4580fa93381d"
                                     ]
                                 ]
                             },
                             {
                                 "id": "139fe3d8efb20402",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Alle aktiven Geräte",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload[state = 1]",
                                         "tot": "jsonata"
                                     },
                                     {
                                         "t": "set",
                                         "p": "homee.active",
                                         "pt": "flow",
                                         "to": "payload",
                                         "tot": "msg"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 1050,
                                 "y": 940,
                                 "wires": [
                                     [
                                         "f8402a89bc3c1103",
                                         "b1946c337b7d80ef",
                                         "d95e18df200eadee"
                                     ]
                                 ]
                             },
                             {
                                 "id": "f8402a89bc3c1103",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "aktive Geräte",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1270,
                                 "y": 900,
                                 "wires": []
                             },
                             {
                                 "id": "43f88f1028d1af0a",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Geräte, die aktualisiert werden",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload[state = 12] ",
                                         "tot": "jsonata"
                                     },
                                     {
                                         "t": "set",
                                         "p": "homee.updating",
                                         "pt": "flow",
                                         "to": "payload",
                                         "tot": "msg"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 1090,
                                 "y": 1440,
                                 "wires": [
                                     [
                                         "ceb8932892417bf3",
                                         "4e3680fd1ba7cc1e",
                                         "21b0ae03da03035d"
                                     ]
                                 ]
                             },
                             {
                                 "id": "ceb8932892417bf3",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Geräte die aktualisiert werden",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1410,
                                 "y": 1380,
                                 "wires": []
                             },
                             {
                                 "id": "4e3680fd1ba7cc1e",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Anzahl",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload ? $count(payload) : \"Keine Geräte im Aktualisierungsstatus\"",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 1350,
                                 "y": 1440,
                                 "wires": [
                                     [
                                         "d629bd7188fa7121"
                                     ]
                                 ]
                             },
                             {
                                 "id": "d629bd7188fa7121",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Anzahl Geräte im Aktualisierungsstatus",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1600,
                                 "y": 1440,
                                 "wires": []
                             },
                             {
                                 "id": "79c90e3a205144c8",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Anzahl",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload ? $count(payload) : \"Keine Geräte im Aktualisierungsstatus\"",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 1330,
                                 "y": 1180,
                                 "wires": [
                                     [
                                         "6636132bd627fd5a"
                                     ]
                                 ]
                             },
                             {
                                 "id": "6636132bd627fd5a",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Anzahl inaktive Geräte",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1520,
                                 "y": 1180,
                                 "wires": []
                             },
                             {
                                 "id": "b1946c337b7d80ef",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Anzahl",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload ? $count(payload) : \"Keine Geräte im Aktualisierungsstatus\"",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 1270,
                                 "y": 940,
                                 "wires": [
                                     [
                                         "1871f120aa223a8d"
                                     ]
                                 ]
                             },
                             {
                                 "id": "1871f120aa223a8d",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Anzahl aktiver Geräte",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1460,
                                 "y": 940,
                                 "wires": []
                             },
                             {
                                 "id": "d95e18df200eadee",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Namen",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload.phonetic_name",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 1260,
                                 "y": 1000,
                                 "wires": [
                                     [
                                         "ae2e5ba148bb399a"
                                     ]
                                 ]
                             },
                             {
                                 "id": "ae2e5ba148bb399a",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Namen aktiver Geräte (Phoenetic Name)",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1540,
                                 "y": 1040,
                                 "wires": []
                             },
                             {
                                 "id": "852a4580fa93381d",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Namen",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload.phonetic_name",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 1340,
                                 "y": 1240,
                                 "wires": [
                                     [
                                         "43f62f9f3bc5bc3d"
                                     ]
                                 ]
                             },
                             {
                                 "id": "43f62f9f3bc5bc3d",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Namen inaktiver Geräte (Phoenetic Name)",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1630,
                                 "y": 1240,
                                 "wires": []
                             },
                             {
                                 "id": "21b0ae03da03035d",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Namen",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload.phonetic_name",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 1360,
                                 "y": 1500,
                                 "wires": [
                                     [
                                         "02eb40a627f4e90d"
                                     ]
                                 ]
                             },
                             {
                                 "id": "02eb40a627f4e90d",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Namen aktualisierende Geräte (Phoenetic Name)",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1670,
                                 "y": 1500,
                                 "wires": []
                             },
                             {
                                 "id": "9ed44d883152b608",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Geräte ausschliessen",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload ~> $filter(function($value){$value.id in [-1] != true})",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 760,
                                 "y": 1180,
                                 "wires": [
                                     [
                                         "bc383b50669e8145"
                                     ]
                                 ]
                             },
                             {
                                 "id": "8295d28d57fdb5f9",
                                 "type": "inject",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Trigger Report",
                                 "props": [
                                     {
                                         "p": "payload"
                                     }
                                 ],
                                 "repeat": "",
                                 "crontab": "",
                                 "once": false,
                                 "onceDelay": 0.1,
                                 "topic": "",
                                 "payload": "",
                                 "payloadType": "date",
                                 "x": 210,
                                 "y": 1620,
                                 "wires": [
                                     [
                                         "bb70522cf511b632"
                                     ]
                                 ]
                             },
                             {
                                 "id": "bb70522cf511b632",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "homee",
                                         "tot": "flow"
                                     },
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "{\t   \"active\" : {\t       \"count\": payload.active ? $count(payload.active): 0,\t       \"names\" :  payload.active ?  $join(payload.active.phonetic_name,\"\\n\") : \"Keine aktiven Geräte vorhanden\"\t   },\t   \"inactive\" : {\t       \"count\": payload.inactive ? $count(payload.inactive): 0,\t        \"names\" :  payload.inactive ?  $join(payload.inactive.phonetic_name,\"\\n\") : \"Keine inaktiven Geräte vorhanden\"\t   },\t   \"updating\" : {\t       \"count\": payload.updating ? $count(payload.inactive): 0,\t        \"names\" :  payload.updating ?  $join(payload.updating.phonetic_name,\"\\n\") : \"Keine Geräte im Aktualisierungsstatus\"\t   },\t   \"summary\" : payload.updating or payload.inactive ? \"Nicht alle Geräte bereit!\" : \"Alle Geräte aktiv\"\t}",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 430,
                                 "y": 1680,
                                 "wires": [
                                     [
                                         "886c19b24989ed4d",
                                         "a76c7c09a28be0d6",
                                         "f422b5bcbb03ca87"
                                     ]
                                 ]
                             },
                             {
                                 "id": "886c19b24989ed4d",
                                 "type": "template",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "",
                                 "field": "payload",
                                 "fieldType": "msg",
                                 "format": "html",
                                 "syntax": "mustache",
                                 "template": "<!DOCTYPE html>\n<html>\n\n<body>\n<h1>Status der Geräte:</h1>\n\n<h3>aktive Geräte: {{payload.active.count}}\n<pre>{{payload.active.names}}</pre>\n\n<h3>inaktive Geräte: {{payload.inactive.count}}\n<pre>{{payload.inactive.names}}</pre>\n\n<h3>aktualisierende Geräte: {{payload.updating.count}}\n<pre>{{payload.updating.names}}</pre>\n\n<h3>{{payload.summary}}</h3>\n</body>\n</html>",
                                 "output": "str",
                                 "x": 660,
                                 "y": 1680,
                                 "wires": [
                                     [
                                         "e9df565834fa1f46"
                                     ]
                                 ]
                             },
                             {
                                 "id": "ea538b90d2d339e0",
                                 "type": "file",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "",
                                 "filename": "filename",
                                 "filenameType": "msg",
                                 "appendNewline": false,
                                 "createDir": false,
                                 "overwriteFile": "true",
                                 "encoding": "none",
                                 "x": 1080,
                                 "y": 1680,
                                 "wires": [
                                     []
                                 ]
                             },
                             {
                                 "id": "e9df565834fa1f46",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "filename",
                                         "pt": "msg",
                                         "to": "/home/iobroker/homee-report.html",
                                         "tot": "str"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 870,
                                 "y": 1680,
                                 "wires": [
                                     [
                                         "ea538b90d2d339e0"
                                     ]
                                 ]
                             },
                             {
                                 "id": "a76c7c09a28be0d6",
                                 "type": "switch",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "",
                                 "property": "payload.summary",
                                 "propertyType": "msg",
                                 "rules": [
                                     {
                                         "t": "neq",
                                         "v": "Alle Geräte aktiv",
                                         "vt": "str"
                                     }
                                 ],
                                 "checkall": "true",
                                 "repair": false,
                                 "outputs": 1,
                                 "x": 650,
                                 "y": 1760,
                                 "wires": [
                                     [
                                         "d8673a8fe1b1dfc2"
                                     ]
                                 ]
                             },
                             {
                                 "id": "48226cba37067157",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Warnung ausgeben - wenn nicht alle Geräte aktiv",
                                 "active": false,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1150,
                                 "y": 1760,
                                 "wires": []
                             },
                             {
                                 "id": "d8673a8fe1b1dfc2",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload.summary",
                                         "tot": "msg"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 830,
                                 "y": 1760,
                                 "wires": [
                                     [
                                         "48226cba37067157"
                                     ]
                                 ]
                             },
                             {
                                 "id": "f99cd78780beb8e7",
                                 "type": "ioBroker in",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "start",
                                 "topic": "0_userdata.0.System.homee.StartGeräteinfo",
                                 "payloadType": "value",
                                 "onlyack": "",
                                 "func": "all",
                                 "gap": "",
                                 "fireOnStart": "false",
                                 "outFormat": "MQTT",
                                 "x": 190,
                                 "y": 1680,
                                 "wires": [
                                     [
                                         "bb70522cf511b632"
                                     ]
                                 ]
                             },
                             {
                                 "id": "f422b5bcbb03ca87",
                                 "type": "change",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Anzahl nicht aktiver Geräte",
                                 "rules": [
                                     {
                                         "t": "set",
                                         "p": "payload",
                                         "pt": "msg",
                                         "to": "payload.inactive.count + payload.updating.count",
                                         "tot": "jsonata"
                                     }
                                 ],
                                 "action": "",
                                 "property": "",
                                 "from": "",
                                 "to": "",
                                 "reg": false,
                                 "x": 720,
                                 "y": 1840,
                                 "wires": [
                                     [
                                         "8b40e4fbe4ba993d"
                                     ]
                                 ]
                             },
                             {
                                 "id": "8b40e4fbe4ba993d",
                                 "type": "debug",
                                 "z": "9c280ddf049b2b4d",
                                 "name": "Nicht aktive Geräte (updating oder inaktiv)",
                                 "active": true,
                                 "tosidebar": true,
                                 "console": false,
                                 "tostatus": false,
                                 "complete": "payload",
                                 "targetType": "msg",
                                 "statusVal": "",
                                 "statusType": "auto",
                                 "x": 1060,
                                 "y": 1840,
                                 "wires": []
                             },
                             {
                                 "id": "bc383b50669e8145",
                                 "type": "junction",
                                 "z": "9c280ddf049b2b4d",
                                 "x": 880,
                                 "y": 1180,
                                 "wires": [
                                     [
                                         "43f88f1028d1af0a",
                                         "99528e0bbb0f2491",
                                         "139fe3d8efb20402"
                                     ]
                                 ]
                             }
                          ]
                          

                          Die Inject Node mit den Daten der 46 Geräte ist in diesem Export nicht enthalten - also den Dateninput musst Du halt liefern. 😉

                          Der Vorteil nicht alles in einer function Node zu verstecken ist halt auch, dass Du individuell Aktionen mit bestimmten Geräten ggf. anschließen kannst.

                          Und zum Schluss - Du hast so einen Flow dann selbst erarbeitet. Ich kann Dich nur ermuntern, das zu Probieren, anstelle im Netz nach fertigen Flows zu suchen. Es kann eine Anregung sein - man muss das Rad nicht neu erfinden. Der Mensch, der den Flow gemacht hat, ist zwar ein sehr fitter Javascript Programmierer (diese template Literals habe ich noch nie benutzt), aber er kapselt viel zu viel in der function Node und beschneidet deshalb die Möglichkeiten eines Flows.

                          O 1 Reply Last reply Reply Quote 0
                          • O
                            Oli last edited by

                            @mickym

                            wow, erstmal vielen Dank, dass muss ich mir heute nach dem aufstehen mal etwas genau anschauen, momentan erschlägt es mich erstmal.

                            Da werden bestimmt einige Fragen aufkommen, mit denen ich auf dich zukommen werde 😉

                            1 Reply Last reply Reply Quote 0
                            • O
                              Oli @mickym last edited by

                              @mickym
                              habe mir das ganze mal angesehen und versucht durch zu blicken, aber leider funktioniert es nicht.

                              Der Obere Teil sieht wie folgt aus:
                              bfcbffbd-8552-4268-b5d3-59950f73830d-image.png
                              Bei den Debug-Nodes der einzelnen Geräte kommt immer folgendes:
                              e998934d-4a0d-403c-8225-37bc566023ac-image.png

                              Bei der Debug-Node 5 schreibt er folgendes:

                              {"attribute":{"id":358,"node_id":56,"instance":0,"minimum":0,"maximum":20,"current_value":0.412,"target_value":0.412,"last_value":0.438,"unit":"A","step_value":1,"editable":0,"type":193,"state":1,"last_changed":1678519354,"changed_by":1,"changed_by_id":0,"based_on":1,"data":"","name":"","options":{"history":{"day":1,"week":26,"month":6}}}}
                              

                              Aber nach meinem Verständnis, sollte doch eigentlich die "node" abgefragt werden, nicht die "attribute"

                              {"node":{"id":29,"name":"EG%20%2F%20Wohnzimmer%20%2F%20Netatmo","profile":3014,"image":"default","favorite":0,"order":42,"protocol":9,"routing":0,"state":1,"state_changed":1678428037,"added":1607519624,"history":0,"cube_type":8,"note":"","services":5,"phonetic_name":"Klima%20Wohnzimmer","owner":1,"security":0,"attributes":[{"id":253,"node_id":29,"instance":0,"minimum":0,"maximum":50,"current_value":20.6,"target_value":20.6,"last_value":20.5,"unit":"%C2%B0C","step_value":0.5,"editable":0,"type":5,"state":1,"last_changed":1678519389,"changed_by":1,"changed_by_id":0,"based_on":4,"data":"","name":"","options":{"history":{"day":1,"week":26,"month":6}}},{"id":254,"node_id":29,"instance":0,"minimum":0,"maximum":100,"current_value":33,"target_value":33,"last_value":34,"unit":"%25","step_value":1,"editable":0,"type":7,"state":1,"last_changed":1678515784,"changed_by":1,"changed_by_id":0,"based_on":4,"data":"","name":"","options":{"history":{"day":1,"week":26,"month":6}}},{"id":255,"node_id":29,"instance":0,"minimum":0,"maximum":5000,"current_value":444,"target_value":444,"last_value":449,"unit":"ppm","step_value":50,"editable":0,"type":20,"state":1,"last_changed":1678519389,"changed_by":1,"changed_by_id":0,"based_on":4,"data":"","name":"","options":{"history":{"day":1,"week":26,"month":6}}},{"id":256,"node_id":29,"instance":0,"minimum":35,"maximum":120,"current_value":32,"target_value":32,"last_value":33,"unit":"dB","step_value":1,"editable":0,"type":93,"state":1,"last_changed":1678515183,"changed_by":1,"changed_by_id":0,"based_on":4,"data":"","name":"","options":{"history":{"day":1,"week":26,"month":6}}},{"id":257,"node_id":29,"instance":0,"minimum":260,"maximum":1160,"current_value":1003.7,"target_value":1003.7,"last_value":1003.6,"unit":"mBar","step_value":5,"editable":0,"type":94,"state":1,"last_changed":1678519389,"changed_by":1,"changed_by_id":0,"based_on":4,"data":"","name":"","options":{"history":{"day":1,"week":26,"month":6}}},{"id":258,"node_id":29,"instance":0,"minimum":0,"maximum":4,"current_value":4,"target_value":4,"last_value":2,"unit":"n%2Fa","step_value":1,"editable":0,"type":33,"state":1,"last_changed":1677083197,"changed_by":1,"changed_by_id":0,"based_on":4,"data":"","name":""},{"id":475,"node_id":29,"instance":0,"minimum":0,"maximum":1,"current_value":1,"target_value":1,"last_value":0,"unit":"","step_value":1,"editable":1,"type":385,"state":1,"last_changed":0,"changed_by":0,"changed_by_id":0,"based_on":0,"data":"","name":""}]}}
                              

                              Wenn dem so ist, wo kann ich das ändern?

                              mickym 1 Reply Last reply Reply Quote 0
                              • mickym
                                mickym Most Active @Oli last edited by mickym

                                @oli Nein dem ist nicht so - im Gegenteil die attribute werden entfernt. - Ich denke wir haben ggf. nicht mit der gleichen Datenbasis gearbeitet.

                                8efab0f7-1139-4609-b744-702482c38db8-image.png

                                Bei mir sind also in dem Input alle 46 Geräte zu sehen.

                                54841029-86ec-4ae8-afad-b7aba5758d2c-image.png

                                Mit der Change Node - werden im Gegenteil die einzelnen attribute weggenommen.

                                Also haben wir eine unterschiedliche Ausgangsbasis. Kommen denn die Geräte einzeln an? oder insgesamt?

                                8ee40a7e-5956-4eaf-8e9e-3319270301fe-image.png

                                Ich habe halt mit der Datenbasis gearbeitet, bei der alle Geräte aufeinmal ankommen. Also im Prinzip mit dem was Du mir in der Datei aus : https://forum.iobroker.net/post/960869 geschickt hast.

                                7567a92a-cb3d-48ab-aa49-6cba35e54d49-image.png

                                Deswegen heißt mein Array auch nodes und nicht node. 😉

                                Jetzt ist halt die Frage - kannst Du das auch so machen oder müssen wir die einzelnen Geräte mühsam sammeln? Wenn die Geräte einzeln ankommen - müssen wir den Flow umändern.

                                Also sag mir, ob die Geräte sich da nun einzeln melden oder ob Du die ganze Geräteliste als Input zur Verfügung stellen kannst?

                                Im Prinzip hat der wohl die Nodes global gesammelt, da dies in der 1. Zeile der function Node so steht:

                                const nodes = global.get('homee.nodes');
                                

                                Falls dem so ist, kannst Du mal in Deinem globalen Kontext schauen, ob da die vollständigen Nodeliste drin ist 😉 ?

                                Wenn ja dann - ignorieren wir nämlich den Input und setzen die payload am Anfang auf den globalen Kontext.

                                Also schau mal, was ggf. hier in Deinem globalen Kontext drin steht:

                                a1f6d18c-4671-452d-97b9-201f47ff72dd-image.png

                                Du musst rechts auf das Aktualisieren Icon drücken.

                                Falls dem so ist, wie ich vermute, dann ist das was rein kommt in Deinen Flow nur ein trigger - den wir später auch verfeinern können.

                                Du kannst die payload - wie in der function Node auf alle Nodes setzen, wenn Du vorher noch folgende Change Node dran machst:

                                d4632383-25d5-4298-a50b-ce4de054b10d-image.png

                                die Change Node muss folgenden Inhalt haben:
                                c057e3b5-fb79-45e9-966b-c7e730bb35af-image.png

                                [
                                    {
                                        "id": "4bb866d9e36a197e",
                                        "type": "change",
                                        "z": "9c280ddf049b2b4d",
                                        "name": "",
                                        "rules": [
                                            {
                                                "t": "set",
                                                "p": "payload.nodes",
                                                "pt": "msg",
                                                "to": "homee.nodes",
                                                "tot": "global"
                                            }
                                        ],
                                        "action": "",
                                        "property": "",
                                        "from": "",
                                        "to": "",
                                        "reg": false,
                                        "x": 390,
                                        "y": 460,
                                        "wires": [
                                            [
                                                "6f4c16eed7166074"
                                            ]
                                        ]
                                    }
                                ]
                                

                                Im Prinzip holen wir dann bei jedem Geräteupdate die vollständige Liste bzw. analysieren diese.

                                Im Prinzip filtert er aus, dass nur diese Ereignisse triggern:

                                if((msg.payload.node && ((msg.payload.node.state === 2)||(msg.payload.node.state === 12)))||msg.payload === true)
                                

                                das müssen wir halt nochmal schauen, ob das Sinn macht. Das bedeutet, dass momentan die Auswertung nur läuft wenn die payload nur true ist oder die payload eine Eigenschaft node hat, deren states 2 oder 12 ist.

                                Ich hoffe ich habe mich verständlich ausgedrückt. - Also setze mal die payload auf den globalen Kontext, mit der Change Node und mit den triggern überlegen wir uns noch.

                                =====================================================================================

                                So ich hab das jetzt nochmal simuliert:

                                Wenn bei Dir der globale Kontext so aussieht:

                                d1886a53-8e9d-4ba7-b1ae-9af7ac4e3abd-image.png

                                Dann sollte jetzt dieser ganze Flow funktionieren, indem Du einfach auf den trigger Knopf drückst oder auch von Deinem anderen Flow triggern lässt:

                                9f8dca57-cead-440d-aa51-e51cd450496a-image.png

                                [
                                   {
                                       "id": "1a49f3e7a72eeb98",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "inaktive Geräte",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1620,
                                       "y": 620,
                                       "wires": []
                                   },
                                   {
                                       "id": "6f4c16eed7166074",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "decodeUrlComponents",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload ~> |$.nodes|{\"name\":$decodeUrlComponent(name),\t\"note\":$decodeUrlComponent(note),\t\"phonetic_name\":$decodeUrlComponent(phonetic_name)},\"attributes\"|",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 580,
                                       "y": 680,
                                       "wires": [
                                           [
                                               "5c62dbd7992ee76d"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "5c62dbd7992ee76d",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Alle Geräte",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload.nodes",
                                               "tot": "msg"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 790,
                                       "y": 680,
                                       "wires": [
                                           [
                                               "9ed44d883152b608"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "99528e0bbb0f2491",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Alle inaktiven Geräte",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload[state = 2]",
                                               "tot": "jsonata"
                                           },
                                           {
                                               "t": "set",
                                               "p": "homee.inactive",
                                               "pt": "flow",
                                               "to": "payload",
                                               "tot": "msg"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1340,
                                       "y": 680,
                                       "wires": [
                                           [
                                               "1a49f3e7a72eeb98",
                                               "79c90e3a205144c8",
                                               "852a4580fa93381d"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "139fe3d8efb20402",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Alle aktiven Geräte",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload[state = 1]",
                                               "tot": "jsonata"
                                           },
                                           {
                                               "t": "set",
                                               "p": "homee.active",
                                               "pt": "flow",
                                               "to": "payload",
                                               "tot": "msg"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1330,
                                       "y": 440,
                                       "wires": [
                                           [
                                               "f8402a89bc3c1103",
                                               "b1946c337b7d80ef",
                                               "d95e18df200eadee"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "f8402a89bc3c1103",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "aktive Geräte",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1550,
                                       "y": 400,
                                       "wires": []
                                   },
                                   {
                                       "id": "43f88f1028d1af0a",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Geräte, die aktualisiert werden",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload[state = 12] ",
                                               "tot": "jsonata"
                                           },
                                           {
                                               "t": "set",
                                               "p": "homee.updating",
                                               "pt": "flow",
                                               "to": "payload",
                                               "tot": "msg"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1370,
                                       "y": 940,
                                       "wires": [
                                           [
                                               "ceb8932892417bf3",
                                               "4e3680fd1ba7cc1e",
                                               "21b0ae03da03035d"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "ceb8932892417bf3",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Geräte die aktualisiert werden",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1690,
                                       "y": 880,
                                       "wires": []
                                   },
                                   {
                                       "id": "4e3680fd1ba7cc1e",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Anzahl",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload ? $count(payload) : \"Keine Geräte im Aktualisierungsstatus\"",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1630,
                                       "y": 940,
                                       "wires": [
                                           [
                                               "d629bd7188fa7121"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "d629bd7188fa7121",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Anzahl Geräte im Aktualisierungsstatus",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1880,
                                       "y": 940,
                                       "wires": []
                                   },
                                   {
                                       "id": "79c90e3a205144c8",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Anzahl",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload ? $count(payload) : \"Keine Geräte im Aktualisierungsstatus\"",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1610,
                                       "y": 680,
                                       "wires": [
                                           [
                                               "6636132bd627fd5a"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "6636132bd627fd5a",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Anzahl inaktive Geräte",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1800,
                                       "y": 680,
                                       "wires": []
                                   },
                                   {
                                       "id": "b1946c337b7d80ef",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Anzahl",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload ? $count(payload) : \"Keine Geräte im Aktualisierungsstatus\"",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1550,
                                       "y": 440,
                                       "wires": [
                                           [
                                               "1871f120aa223a8d"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "1871f120aa223a8d",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Anzahl aktiver Geräte",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1740,
                                       "y": 440,
                                       "wires": []
                                   },
                                   {
                                       "id": "d95e18df200eadee",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Namen",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload.phonetic_name",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1540,
                                       "y": 500,
                                       "wires": [
                                           [
                                               "ae2e5ba148bb399a"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "ae2e5ba148bb399a",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Namen aktiver Geräte (Phoenetic Name)",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1820,
                                       "y": 540,
                                       "wires": []
                                   },
                                   {
                                       "id": "852a4580fa93381d",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Namen",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload.phonetic_name",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1620,
                                       "y": 740,
                                       "wires": [
                                           [
                                               "43f62f9f3bc5bc3d"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "43f62f9f3bc5bc3d",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Namen inaktiver Geräte (Phoenetic Name)",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1910,
                                       "y": 740,
                                       "wires": []
                                   },
                                   {
                                       "id": "21b0ae03da03035d",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Namen",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload.phonetic_name",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1640,
                                       "y": 1000,
                                       "wires": [
                                           [
                                               "02eb40a627f4e90d"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "02eb40a627f4e90d",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Namen aktualisierende Geräte (Phoenetic Name)",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1950,
                                       "y": 1000,
                                       "wires": []
                                   },
                                   {
                                       "id": "9ed44d883152b608",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Geräte ausschliessen",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload ~> $filter(function($value){$value.id in [-1] != true})",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 1000,
                                       "y": 680,
                                       "wires": [
                                           [
                                               "bc383b50669e8145"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "8295d28d57fdb5f9",
                                       "type": "inject",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Trigger Report",
                                       "props": [
                                           {
                                               "p": "payload"
                                           }
                                       ],
                                       "repeat": "",
                                       "crontab": "",
                                       "once": false,
                                       "onceDelay": 0.1,
                                       "topic": "",
                                       "payload": "",
                                       "payloadType": "date",
                                       "x": 250,
                                       "y": 1140,
                                       "wires": [
                                           [
                                               "bb70522cf511b632"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "bb70522cf511b632",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "homee",
                                               "tot": "flow"
                                           },
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "{\t   \"active\" : {\t       \"count\": payload.active ? $count(payload.active): 0,\t       \"names\" :  payload.active ?  $join(payload.active.phonetic_name,\"\\n\") : \"Keine aktiven Geräte vorhanden\"\t   },\t   \"inactive\" : {\t       \"count\": payload.inactive ? $count(payload.inactive): 0,\t        \"names\" :  payload.inactive ?  $join(payload.inactive.phonetic_name,\"\\n\") : \"Keine inaktiven Geräte vorhanden\"\t   },\t   \"updating\" : {\t       \"count\": payload.updating ? $count(payload.inactive): 0,\t        \"names\" :  payload.updating ?  $join(payload.updating.phonetic_name,\"\\n\") : \"Keine Geräte im Aktualisierungsstatus\"\t   },\t   \"summary\" : payload.updating or payload.inactive ? \"Nicht alle Geräte bereit!\" : \"Alle Geräte aktiv\"\t}",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 470,
                                       "y": 1200,
                                       "wires": [
                                           [
                                               "886c19b24989ed4d",
                                               "a76c7c09a28be0d6",
                                               "f422b5bcbb03ca87",
                                               "5ea7fcec46176042"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "886c19b24989ed4d",
                                       "type": "template",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "",
                                       "field": "payload",
                                       "fieldType": "msg",
                                       "format": "html",
                                       "syntax": "mustache",
                                       "template": "<!DOCTYPE html>\n<html>\n\n<body>\n<h1>Status der Geräte:</h1>\n\n<h3>aktive Geräte: {{payload.active.count}}\n<pre>{{payload.active.names}}</pre>\n\n<h3>inaktive Geräte: {{payload.inactive.count}}\n<pre>{{payload.inactive.names}}</pre>\n\n<h3>aktualisierende Geräte: {{payload.updating.count}}\n<pre>{{payload.updating.names}}</pre>\n\n<h3>{{payload.summary}}</h3>\n</body>\n</html>",
                                       "output": "str",
                                       "x": 700,
                                       "y": 1200,
                                       "wires": [
                                           [
                                               "e9df565834fa1f46"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "ea538b90d2d339e0",
                                       "type": "file",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "",
                                       "filename": "filename",
                                       "filenameType": "msg",
                                       "appendNewline": false,
                                       "createDir": false,
                                       "overwriteFile": "true",
                                       "encoding": "none",
                                       "x": 1120,
                                       "y": 1200,
                                       "wires": [
                                           []
                                       ]
                                   },
                                   {
                                       "id": "e9df565834fa1f46",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "filename",
                                               "pt": "msg",
                                               "to": "/home/iobroker/homee-report.html",
                                               "tot": "str"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 910,
                                       "y": 1200,
                                       "wires": [
                                           [
                                               "ea538b90d2d339e0"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "a76c7c09a28be0d6",
                                       "type": "switch",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "",
                                       "property": "payload.summary",
                                       "propertyType": "msg",
                                       "rules": [
                                           {
                                               "t": "neq",
                                               "v": "Alle Geräte aktiv",
                                               "vt": "str"
                                           }
                                       ],
                                       "checkall": "true",
                                       "repair": false,
                                       "outputs": 1,
                                       "x": 690,
                                       "y": 1280,
                                       "wires": [
                                           [
                                               "d8673a8fe1b1dfc2"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "48226cba37067157",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Warnung ausgeben - wenn nicht alle Geräte aktiv",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1190,
                                       "y": 1280,
                                       "wires": []
                                   },
                                   {
                                       "id": "d8673a8fe1b1dfc2",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload.summary",
                                               "tot": "msg"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 870,
                                       "y": 1280,
                                       "wires": [
                                           [
                                               "48226cba37067157"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "f99cd78780beb8e7",
                                       "type": "ioBroker in",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "start",
                                       "topic": "0_userdata.0.System.homee.StartGeräteinfo",
                                       "payloadType": "value",
                                       "onlyack": "",
                                       "func": "all",
                                       "gap": "",
                                       "fireOnStart": "false",
                                       "outFormat": "MQTT",
                                       "x": 230,
                                       "y": 1200,
                                       "wires": [
                                           [
                                               "bb70522cf511b632"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "f422b5bcbb03ca87",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Anzahl nicht aktiver Geräte",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "payload.inactive.count + payload.updating.count",
                                               "tot": "jsonata"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 760,
                                       "y": 1360,
                                       "wires": [
                                           [
                                               "8b40e4fbe4ba993d"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "8b40e4fbe4ba993d",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Nicht aktive Geräte (updating oder inaktiv)",
                                       "active": false,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 1100,
                                       "y": 1360,
                                       "wires": []
                                   },
                                   {
                                       "id": "4bb866d9e36a197e",
                                       "type": "change",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "hole alle Geräte",
                                       "rules": [
                                           {
                                               "t": "set",
                                               "p": "payload",
                                               "pt": "msg",
                                               "to": "homee",
                                               "tot": "global"
                                           }
                                       ],
                                       "action": "",
                                       "property": "",
                                       "from": "",
                                       "to": "",
                                       "reg": false,
                                       "x": 340,
                                       "y": 680,
                                       "wires": [
                                           [
                                               "6f4c16eed7166074"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "a48d4a225b9f0daa",
                                       "type": "inject",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "trigger",
                                       "props": [
                                           {
                                               "p": "payload"
                                           }
                                       ],
                                       "repeat": "",
                                       "crontab": "",
                                       "once": false,
                                       "onceDelay": 0.1,
                                       "topic": "",
                                       "payload": "true",
                                       "payloadType": "bool",
                                       "x": 170,
                                       "y": 680,
                                       "wires": [
                                           [
                                               "4bb866d9e36a197e"
                                           ]
                                       ]
                                   },
                                   {
                                       "id": "5ea7fcec46176042",
                                       "type": "debug",
                                       "z": "9c280ddf049b2b4d",
                                       "name": "Zusammenfassung",
                                       "active": true,
                                       "tosidebar": true,
                                       "console": false,
                                       "tostatus": false,
                                       "complete": "payload",
                                       "targetType": "msg",
                                       "statusVal": "",
                                       "statusType": "auto",
                                       "x": 730,
                                       "y": 1140,
                                       "wires": []
                                   },
                                   {
                                       "id": "bc383b50669e8145",
                                       "type": "junction",
                                       "z": "9c280ddf049b2b4d",
                                       "x": 1160,
                                       "y": 680,
                                       "wires": [
                                           [
                                               "43f88f1028d1af0a",
                                               "99528e0bbb0f2491",
                                               "139fe3d8efb20402"
                                           ]
                                       ]
                                   }
                                ]
                                

                                Wenn Du dann unten den Trigger Report anklickst - dann solltest Du im Debug Fenster folgende Daten erhalten:

                                {
                                  "active": {
                                    "count": 44,
                                    "names": "Bewegungsmelder Kirsten\nBewegungsmelder Oliver\nLuftreiniger\nNachtlicht TV\nNachtlicht Kirsten\n\nNachtlicht Oliver\nHeizung Wohnzimmer Balkon\nWaschmaschine\nMultimedia\nRauchmelder Flur Dachgeschoss\nRauchmelder Flur Erdgeschoss\nRauchmelder Flur Keller\nFenster Bad\nBalkontür Esszimmer\nBalkontür Wohnzimmer\nFenster Toilette\nFenster Büro Rechts\nFenster Büro Links\nSchlafzimmer Rauchmelder\nRauchmelder Schlafzimmer Keller\nHeizung Büro\nVitrine Wohnzimmer\nTemperatur Weinkühlschrank\nHeizung Wohnzimmer Links\nSchrank Wohnzimmer\nHeizung Esszimmer\nHeizung Toilette\nWeinschrank Wohnzimmer\nThermostat Wohnzimmer\nComputer\nKühlschrank\nGeschirrspüler\nWassersensor Küche\nHeizung Bad\nKlima Wohnzimmer\nKlima Balkon\nKlima Büro\nKlima Schlafzimmer\nKlimaanlage\nTablet\nStehlampe Wohnzimmer\nBar Wohnzimmer\nTemperatur Kühlschrank"
                                  },
                                  "inactive": {
                                    "count": 1,
                                    "names": "Licht Glasvitrine Flur"
                                  },
                                  "updating": {
                                    "count": 0,
                                    "names": "Keine Geräte im Aktualisierungsstatus"
                                  },
                                  "summary": "Nicht alle Geräte bereit!"
                                }
                                
                                O 1 Reply Last reply Reply Quote 0
                                • O
                                  Oli @mickym last edited by

                                  @mickym
                                  sieht bei mir so aus:
                                  8530fe35-e32b-4bb1-a6a2-fa6ab5dc4ca2-image.png

                                  mickym 2 Replies Last reply Reply Quote 0
                                  • mickym
                                    mickym Most Active @Oli last edited by

                                    @oli Ok - dann lass mich noch eine kleine Modifikation machen. 😉

                                    1 Reply Last reply Reply Quote 0
                                    • mickym
                                      mickym Most Active @Oli last edited by mickym

                                      @oli sagte in Benötige Hilfe mit Node-Red in Verbindung mit homee:

                                      @mickym
                                      sieht bei mir so aus:
                                      8530fe35-e32b-4bb1-a6a2-fa6ab5dc4ca2-image.png

                                      Wobei es jetzt eigentlich bei Dir schon gehen sollte, weil ich Deinen Flow Kontext sehe. 😉

                                      so hier nochmal der gesamte Flow:

                                      [
                                         {
                                             "id": "1a49f3e7a72eeb98",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "inaktive Geräte",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1620,
                                             "y": 620,
                                             "wires": []
                                         },
                                         {
                                             "id": "6f4c16eed7166074",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "decodeUrlComponents",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload ~> |$.nodes|{\"name\":$decodeUrlComponent(name),\t\"note\":$decodeUrlComponent(note),\t\"phonetic_name\":$decodeUrlComponent(phonetic_name)},\"attributes\"|",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 580,
                                             "y": 680,
                                             "wires": [
                                                 [
                                                     "5c62dbd7992ee76d"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "5c62dbd7992ee76d",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Alle Geräte",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload.nodes",
                                                     "tot": "msg"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 790,
                                             "y": 680,
                                             "wires": [
                                                 [
                                                     "9ed44d883152b608"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "99528e0bbb0f2491",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Alle inaktiven Geräte",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload[state = 2]",
                                                     "tot": "jsonata"
                                                 },
                                                 {
                                                     "t": "set",
                                                     "p": "homee.inactive",
                                                     "pt": "flow",
                                                     "to": "payload",
                                                     "tot": "msg"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1340,
                                             "y": 680,
                                             "wires": [
                                                 [
                                                     "1a49f3e7a72eeb98",
                                                     "79c90e3a205144c8",
                                                     "852a4580fa93381d"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "139fe3d8efb20402",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Alle aktiven Geräte",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload[state = 1]",
                                                     "tot": "jsonata"
                                                 },
                                                 {
                                                     "t": "set",
                                                     "p": "homee.active",
                                                     "pt": "flow",
                                                     "to": "payload",
                                                     "tot": "msg"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1330,
                                             "y": 440,
                                             "wires": [
                                                 [
                                                     "f8402a89bc3c1103",
                                                     "b1946c337b7d80ef",
                                                     "d95e18df200eadee"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "f8402a89bc3c1103",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "aktive Geräte",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1550,
                                             "y": 400,
                                             "wires": []
                                         },
                                         {
                                             "id": "43f88f1028d1af0a",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Geräte, die aktualisiert werden",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload[state = 12] ",
                                                     "tot": "jsonata"
                                                 },
                                                 {
                                                     "t": "set",
                                                     "p": "homee.updating",
                                                     "pt": "flow",
                                                     "to": "payload",
                                                     "tot": "msg"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1370,
                                             "y": 940,
                                             "wires": [
                                                 [
                                                     "ceb8932892417bf3",
                                                     "4e3680fd1ba7cc1e",
                                                     "21b0ae03da03035d"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "ceb8932892417bf3",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Geräte die aktualisiert werden",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1690,
                                             "y": 880,
                                             "wires": []
                                         },
                                         {
                                             "id": "4e3680fd1ba7cc1e",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Anzahl",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload ? $count(payload) : \"Keine Geräte im Aktualisierungsstatus\"",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1630,
                                             "y": 940,
                                             "wires": [
                                                 [
                                                     "d629bd7188fa7121"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "d629bd7188fa7121",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Anzahl Geräte im Aktualisierungsstatus",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1880,
                                             "y": 940,
                                             "wires": []
                                         },
                                         {
                                             "id": "79c90e3a205144c8",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Anzahl",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload ? $count(payload) : \"Keine Geräte im Aktualisierungsstatus\"",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1610,
                                             "y": 680,
                                             "wires": [
                                                 [
                                                     "6636132bd627fd5a"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "6636132bd627fd5a",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Anzahl inaktive Geräte",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1800,
                                             "y": 680,
                                             "wires": []
                                         },
                                         {
                                             "id": "b1946c337b7d80ef",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Anzahl",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload ? $count(payload) : \"Keine Geräte im Aktualisierungsstatus\"",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1550,
                                             "y": 440,
                                             "wires": [
                                                 [
                                                     "1871f120aa223a8d"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "1871f120aa223a8d",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Anzahl aktiver Geräte",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1740,
                                             "y": 440,
                                             "wires": []
                                         },
                                         {
                                             "id": "d95e18df200eadee",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Namen",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload.phonetic_name",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1540,
                                             "y": 500,
                                             "wires": [
                                                 [
                                                     "ae2e5ba148bb399a"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "ae2e5ba148bb399a",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Namen aktiver Geräte (Phoenetic Name)",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1820,
                                             "y": 540,
                                             "wires": []
                                         },
                                         {
                                             "id": "852a4580fa93381d",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Namen",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload.phonetic_name",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1620,
                                             "y": 740,
                                             "wires": [
                                                 [
                                                     "43f62f9f3bc5bc3d"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "43f62f9f3bc5bc3d",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Namen inaktiver Geräte (Phoenetic Name)",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1910,
                                             "y": 740,
                                             "wires": []
                                         },
                                         {
                                             "id": "21b0ae03da03035d",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Namen",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload.phonetic_name",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1640,
                                             "y": 1000,
                                             "wires": [
                                                 [
                                                     "02eb40a627f4e90d"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "02eb40a627f4e90d",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Namen aktualisierende Geräte (Phoenetic Name)",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1950,
                                             "y": 1000,
                                             "wires": []
                                         },
                                         {
                                             "id": "9ed44d883152b608",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Geräte ausschliessen",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload ~> $filter(function($value){$value.id in [-1] != true})",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 1000,
                                             "y": 680,
                                             "wires": [
                                                 [
                                                     "bc383b50669e8145"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "8295d28d57fdb5f9",
                                             "type": "inject",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Trigger Report",
                                             "props": [
                                                 {
                                                     "p": "payload"
                                                 }
                                             ],
                                             "repeat": "",
                                             "crontab": "",
                                             "once": false,
                                             "onceDelay": 0.1,
                                             "topic": "",
                                             "payload": "",
                                             "payloadType": "date",
                                             "x": 250,
                                             "y": 1140,
                                             "wires": [
                                                 [
                                                     "bb70522cf511b632"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "bb70522cf511b632",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "homee",
                                                     "tot": "flow"
                                                 },
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "{\t   \"active\" : {\t       \"count\": payload.active ? $count(payload.active): 0,\t       \"names\" :  payload.active ?  $join(payload.active.phonetic_name,\"\\n\") : \"Keine aktiven Geräte vorhanden\"\t   },\t   \"inactive\" : {\t       \"count\": payload.inactive ? $count(payload.inactive): 0,\t        \"names\" :  payload.inactive ?  $join(payload.inactive.phonetic_name,\"\\n\") : \"Keine inaktiven Geräte vorhanden\"\t   },\t   \"updating\" : {\t       \"count\": payload.updating ? $count(payload.inactive): 0,\t        \"names\" :  payload.updating ?  $join(payload.updating.phonetic_name,\"\\n\") : \"Keine Geräte im Aktualisierungsstatus\"\t   },\t   \"summary\" : payload.updating or payload.inactive ? \"Nicht alle Geräte bereit!\" : \"Alle Geräte aktiv\"\t}",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 470,
                                             "y": 1200,
                                             "wires": [
                                                 [
                                                     "886c19b24989ed4d",
                                                     "a76c7c09a28be0d6",
                                                     "f422b5bcbb03ca87",
                                                     "5ea7fcec46176042"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "886c19b24989ed4d",
                                             "type": "template",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "",
                                             "field": "payload",
                                             "fieldType": "msg",
                                             "format": "html",
                                             "syntax": "mustache",
                                             "template": "<!DOCTYPE html>\n<html>\n\n<body>\n<h1>Status der Geräte:</h1>\n\n<h3>aktive Geräte: {{payload.active.count}}\n<pre>{{payload.active.names}}</pre>\n\n<h3>inaktive Geräte: {{payload.inactive.count}}\n<pre>{{payload.inactive.names}}</pre>\n\n<h3>aktualisierende Geräte: {{payload.updating.count}}\n<pre>{{payload.updating.names}}</pre>\n\n<h3>{{payload.summary}}</h3>\n</body>\n</html>",
                                             "output": "str",
                                             "x": 700,
                                             "y": 1200,
                                             "wires": [
                                                 [
                                                     "e9df565834fa1f46"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "ea538b90d2d339e0",
                                             "type": "file",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "",
                                             "filename": "filename",
                                             "filenameType": "msg",
                                             "appendNewline": false,
                                             "createDir": false,
                                             "overwriteFile": "true",
                                             "encoding": "none",
                                             "x": 1120,
                                             "y": 1200,
                                             "wires": [
                                                 []
                                             ]
                                         },
                                         {
                                             "id": "e9df565834fa1f46",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "filename",
                                                     "pt": "msg",
                                                     "to": "/home/iobroker/homee-report.html",
                                                     "tot": "str"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 910,
                                             "y": 1200,
                                             "wires": [
                                                 [
                                                     "ea538b90d2d339e0"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "a76c7c09a28be0d6",
                                             "type": "switch",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "",
                                             "property": "payload.summary",
                                             "propertyType": "msg",
                                             "rules": [
                                                 {
                                                     "t": "neq",
                                                     "v": "Alle Geräte aktiv",
                                                     "vt": "str"
                                                 }
                                             ],
                                             "checkall": "true",
                                             "repair": false,
                                             "outputs": 1,
                                             "x": 690,
                                             "y": 1280,
                                             "wires": [
                                                 [
                                                     "d8673a8fe1b1dfc2"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "48226cba37067157",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Warnung ausgeben - wenn nicht alle Geräte aktiv",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1190,
                                             "y": 1280,
                                             "wires": []
                                         },
                                         {
                                             "id": "d8673a8fe1b1dfc2",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload.summary",
                                                     "tot": "msg"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 870,
                                             "y": 1280,
                                             "wires": [
                                                 [
                                                     "48226cba37067157"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "f99cd78780beb8e7",
                                             "type": "ioBroker in",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "start",
                                             "topic": "0_userdata.0.System.homee.StartGeräteinfo",
                                             "payloadType": "value",
                                             "onlyack": "",
                                             "func": "all",
                                             "gap": "",
                                             "fireOnStart": "false",
                                             "outFormat": "MQTT",
                                             "x": 230,
                                             "y": 1200,
                                             "wires": [
                                                 [
                                                     "bb70522cf511b632"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "f422b5bcbb03ca87",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Anzahl nicht aktiver Geräte",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "payload.inactive.count + payload.updating.count",
                                                     "tot": "jsonata"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 760,
                                             "y": 1360,
                                             "wires": [
                                                 [
                                                     "8b40e4fbe4ba993d"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "8b40e4fbe4ba993d",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Nicht aktive Geräte (updating oder inaktiv)",
                                             "active": false,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 1100,
                                             "y": 1360,
                                             "wires": []
                                         },
                                         {
                                             "id": "4bb866d9e36a197e",
                                             "type": "change",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "hole alle Geräte",
                                             "rules": [
                                                 {
                                                     "t": "set",
                                                     "p": "payload",
                                                     "pt": "msg",
                                                     "to": "{}",
                                                     "tot": "json"
                                                 },
                                                 {
                                                     "t": "set",
                                                     "p": "payload.nodes",
                                                     "pt": "msg",
                                                     "to": "homee.nodes",
                                                     "tot": "global"
                                                 }
                                             ],
                                             "action": "",
                                             "property": "",
                                             "from": "",
                                             "to": "",
                                             "reg": false,
                                             "x": 340,
                                             "y": 680,
                                             "wires": [
                                                 [
                                                     "6f4c16eed7166074"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "a48d4a225b9f0daa",
                                             "type": "inject",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "trigger",
                                             "props": [
                                                 {
                                                     "p": "payload"
                                                 }
                                             ],
                                             "repeat": "",
                                             "crontab": "",
                                             "once": false,
                                             "onceDelay": 0.1,
                                             "topic": "",
                                             "payload": "true",
                                             "payloadType": "bool",
                                             "x": 170,
                                             "y": 680,
                                             "wires": [
                                                 [
                                                     "4bb866d9e36a197e"
                                                 ]
                                             ]
                                         },
                                         {
                                             "id": "5ea7fcec46176042",
                                             "type": "debug",
                                             "z": "9c280ddf049b2b4d",
                                             "name": "Zusammenfassung",
                                             "active": true,
                                             "tosidebar": true,
                                             "console": false,
                                             "tostatus": false,
                                             "complete": "payload",
                                             "targetType": "msg",
                                             "statusVal": "",
                                             "statusType": "auto",
                                             "x": 730,
                                             "y": 1140,
                                             "wires": []
                                         },
                                         {
                                             "id": "bc383b50669e8145",
                                             "type": "junction",
                                             "z": "9c280ddf049b2b4d",
                                             "x": 1160,
                                             "y": 680,
                                             "wires": [
                                                 [
                                                     "43f88f1028d1af0a",
                                                     "99528e0bbb0f2491",
                                                     "139fe3d8efb20402"
                                                 ]
                                             ]
                                         }
                                      ]
                                      

                                      Im Wesentlichen holen wir nun nur aus dem globalen Kontext die gesamte Geräteliste:
                                      7491a10f-9221-446e-ae40-a11f4e7b8252-image.png

                                      Ist halt immer bissi schwierig, wenn man sich halt mit den Daten die Realität zusammensimulieren muss, aber sollte nun eigentlich passen.

                                      Wie gesagt wir müssen uns ggf. halt nur über den Trigger unterhalten. Vielleicht langt es da auch wenn Du mit deinem VIS Datenpunkt triggerst - da die globale Geräteliste ja bereits erstellt wird.

                                      O 1 Reply Last reply Reply Quote 1
                                      • O
                                        Oli @mickym last edited by

                                        @mickym
                                        super, jetzt funktioniert es 🙂

                                        mickym 1 Reply Last reply Reply Quote 0
                                        • mickym
                                          mickym Most Active @Oli last edited by mickym

                                          @oli sagte in Benötige Hilfe mit Node-Red in Verbindung mit homee:

                                          @mickym
                                          super, jetzt funktioniert es 🙂

                                          Sehr gut. Dann probier halt erst mal bissi aus. Ggf. brauchst Du den Report nur wenn Du ihn antriggerst oder keine Ahnung ob der mit jedem Geräteupdate ausgegeben werden muss. Ich würde es nicht als final bezeichnen, aber es ist eine Basis damit Du die Zusammenhänge verstehst und das nun Deinen Bedürfnissen anpassen kannst.

                                          Und wie gesagt: Hänge Dir so viele Debug-Nodes dran, wie Du willst, nur so verstehst Du wie die Befehle funktionieren.

                                          O 1 Reply Last reply Reply Quote 0
                                          • O
                                            Oli @mickym last edited by

                                            @mickym
                                            den Report bräuchte ich eigentlich nur, wenn sich am Gerätestatus was ändert,
                                            den oberen bräuchte ich ebenfalls nur wenn sich am Gerätestatus was ändert, oder ein neues gerät hinzukommt

                                            ist das möglich?

                                            mickym 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            764
                                            Online

                                            31.7k
                                            Users

                                            79.7k
                                            Topics

                                            1.3m
                                            Posts

                                            node-red
                                            3
                                            121
                                            7189
                                            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