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. obeject timestamp zugriff

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    obeject timestamp zugriff

    This topic has been deleted. Only users with topic management privileges can see it.
    • mickym
      mickym Most Active last edited by mickym

      So hier habe ich noch ein paar Zeitberechnung für Dich gemacht:

      9b0ac572-ead9-4949-8df9-c47ec7174dc8-image.png

      Das ist der DP vor zwei Zyklen - der Shelly sendet alle 30 sekunden.

      fafd6835-ddd8-4e0d-b6b4-e128983a9353-image.png

      [
         {
             "id": "dbcd5529ba0d5c7b",
             "type": "ioBroker in",
             "z": "517cd16e4d7e6ae4",
             "name": "",
             "topic": "mqtt.1.shellies.schalter.kueche.licht_abzug.input.1",
             "payloadType": "object",
             "onlyack": "",
             "func": "all",
             "gap": "",
             "fireOnStart": "true",
             "outFormat": "MQTT",
             "x": 390,
             "y": 2520,
             "wires": [
                 [
                     "d316f0114937ce32",
                     "8d269b025ec2773e",
                     "222b94a31e2786e4",
                     "fba96013c702fa2d",
                     "4fb9a428b5b72cd9",
                     "a0ded692dc3d8122"
                 ]
             ]
         },
         {
             "id": "d316f0114937ce32",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "object raw mit lc und ts",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 800,
             "y": 2480,
             "wires": []
         },
         {
             "id": "8d269b025ec2773e",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "Last change (lc)",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "$moment(payload.lc,'x').format('DD.MM.YYYY HH:mm:ss')",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 780,
             "y": 2520,
             "wires": [
                 [
                     "e0512cc34b016986"
                 ]
             ]
         },
         {
             "id": "e0512cc34b016986",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "last Change in lesbarem Format",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1070,
             "y": 2520,
             "wires": []
         },
         {
             "id": "222b94a31e2786e4",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "Last update (ts)",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "$moment(payload.ts,'x').format('DD.MM.YYYY HH:mm:ss')",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 780,
             "y": 2580,
             "wires": [
                 [
                     "57d036183b88161a"
                 ]
             ]
         },
         {
             "id": "57d036183b88161a",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "last Change in lesbarem Format",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1070,
             "y": 2580,
             "wires": []
         },
         {
             "id": "fba96013c702fa2d",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "now",
                     "pt": "msg",
                     "to": "",
                     "tot": "date"
                 },
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "now - payload.lc",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 770,
             "y": 2640,
             "wires": [
                 [
                     "2b9d1fb43e248aea"
                 ]
             ]
         },
         {
             "id": "2b9d1fb43e248aea",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "millissekunden seit last change",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1090,
             "y": 2640,
             "wires": []
         },
         {
             "id": "4fb9a428b5b72cd9",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": " {}",
                     "tot": "json"
                 },
                 {
                     "t": "set",
                     "p": "payload.jsonata",
                     "pt": "msg",
                     "to": "$toMillis($now())",
                     "tot": "jsonata"
                 },
                 {
                     "t": "set",
                     "p": "payload.aktuell",
                     "pt": "msg",
                     "to": "",
                     "tot": "date"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 790,
             "y": 2700,
             "wires": [
                 [
                     "113d606106a0a2c6"
                 ]
             ]
         },
         {
             "id": "113d606106a0a2c6",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "now mit Jsonata oder ts",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1070,
             "y": 2700,
             "wires": []
         },
         {
             "id": "a0ded692dc3d8122",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "$moment(payload.lc,'x').locale('de').fromNow()",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 770,
             "y": 2760,
             "wires": [
                 [
                     "4809cc077d800a4e"
                 ]
             ]
         },
         {
             "id": "4809cc077d800a4e",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "Zeit seit last Change",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1020,
             "y": 2760,
             "wires": []
         }
      ]
      

      Das der payload.ts - immer nur ein paar Millisekunden nach dem Triggern kommt, ist doch klar - da Du der Trigger ja den Zeitstempel selbst aktualisiert. Wenn Du prüfen willst, wann ein DP zuletzt getriggert hat (und nicht aufs triggern wartest, musst Du halt mit Get das Objekt holen.

      Wenn Du also mit einen state aktiv auslesen willst OHNE, dass dieser getriggert wurde - hier ein Beipsiel mit GET

      09fff289-a88d-43dc-bd85-27d31c7036dd-image.png

      Wenn man die Zeit nur im lesbaren Format braucht und nicht auf die genaue Zeitspanne angewiesen ist, dann kann man auch die Durationsangaben verwenden.

      c1b45c1b-b975-40ae-a17f-6ac8c22a3c93-image.png

      [
         {
             "id": "d316f0114937ce32",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "object raw mit lc und ts",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1100,
             "y": 2520,
             "wires": []
         },
         {
             "id": "8d269b025ec2773e",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "Last change (lc)",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "$moment(payload.lc,'x').format('DD.MM.YYYY HH:mm:ss')",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 1080,
             "y": 2560,
             "wires": [
                 [
                     "e0512cc34b016986"
                 ]
             ]
         },
         {
             "id": "e0512cc34b016986",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "last Change in lesbarem Format",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1370,
             "y": 2560,
             "wires": []
         },
         {
             "id": "222b94a31e2786e4",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "Last update (ts)",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "$moment(payload.ts,'x').format('DD.MM.YYYY HH:mm:ss')",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 1080,
             "y": 2620,
             "wires": [
                 [
                     "57d036183b88161a"
                 ]
             ]
         },
         {
             "id": "57d036183b88161a",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "last Change in lesbarem Format",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1370,
             "y": 2620,
             "wires": []
         },
         {
             "id": "fba96013c702fa2d",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "now",
                     "pt": "msg",
                     "to": "",
                     "tot": "date"
                 },
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "now - payload.lc",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 1090,
             "y": 2680,
             "wires": [
                 [
                     "2b9d1fb43e248aea"
                 ]
             ]
         },
         {
             "id": "2b9d1fb43e248aea",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "millissekunden seit last change",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1390,
             "y": 2680,
             "wires": []
         },
         {
             "id": "4fb9a428b5b72cd9",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": " {}",
                     "tot": "json"
                 },
                 {
                     "t": "set",
                     "p": "payload.jsonata",
                     "pt": "msg",
                     "to": "$toMillis($now())",
                     "tot": "jsonata"
                 },
                 {
                     "t": "set",
                     "p": "payload.aktuell",
                     "pt": "msg",
                     "to": "",
                     "tot": "date"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 1090,
             "y": 2740,
             "wires": [
                 [
                     "113d606106a0a2c6"
                 ]
             ]
         },
         {
             "id": "113d606106a0a2c6",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "now mit Jsonata oder ts",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1370,
             "y": 2740,
             "wires": []
         },
         {
             "id": "a0ded692dc3d8122",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "$moment(payload.lc,'x').locale('de').fromNow()",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 1090,
             "y": 2800,
             "wires": [
                 [
                     "4809cc077d800a4e"
                 ]
             ]
         },
         {
             "id": "4809cc077d800a4e",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "Zeit seit last Change",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1320,
             "y": 2800,
             "wires": []
         },
         {
             "id": "959d979af54b9ff7",
             "type": "inject",
             "z": "517cd16e4d7e6ae4",
             "name": "check",
             "props": [
                 {
                     "p": "payload"
                 }
             ],
             "repeat": "",
             "crontab": "",
             "once": false,
             "onceDelay": 0.1,
             "topic": "",
             "payload": "",
             "payloadType": "date",
             "x": 170,
             "y": 2600,
             "wires": [
                 [
                     "10735f323a8fce9d"
                 ]
             ]
         },
         {
             "id": "10735f323a8fce9d",
             "type": "ioBroker get",
             "z": "517cd16e4d7e6ae4",
             "name": "",
             "topic": "0_userdata.0.accuWeather.home.daily.DailyForecasts.0.Temperature.Maximum.Unit",
             "attrname": "payload",
             "payloadType": "object",
             "errOnInvalidState": "nothing",
             "x": 570,
             "y": 2600,
             "wires": [
                 [
                     "1866de0bbbcf7827"
                 ]
             ]
         },
         {
             "id": "ec17c988ee1cc7ec",
             "type": "change",
             "z": "517cd16e4d7e6ae4",
             "name": "",
             "rules": [
                 {
                     "t": "set",
                     "p": "payload",
                     "pt": "msg",
                     "to": "$moment(payload.ts,'x').locale('de').fromNow()",
                     "tot": "jsonata"
                 }
             ],
             "action": "",
             "property": "",
             "from": "",
             "to": "",
             "reg": false,
             "x": 1090,
             "y": 2860,
             "wires": [
                 [
                     "bf8f77c03e5daadb"
                 ]
             ]
         },
         {
             "id": "bf8f77c03e5daadb",
             "type": "debug",
             "z": "517cd16e4d7e6ae4",
             "name": "Zeit seit letzter Aktualisierung",
             "active": true,
             "tosidebar": true,
             "console": false,
             "tostatus": false,
             "complete": "payload",
             "targetType": "msg",
             "statusVal": "",
             "statusType": "auto",
             "x": 1360,
             "y": 2860,
             "wires": []
         },
         {
             "id": "1866de0bbbcf7827",
             "type": "junction",
             "z": "517cd16e4d7e6ae4",
             "x": 940,
             "y": 2600,
             "wires": [
                 [
                     "a0ded692dc3d8122",
                     "4fb9a428b5b72cd9",
                     "222b94a31e2786e4",
                     "8d269b025ec2773e",
                     "d316f0114937ce32",
                     "fba96013c702fa2d",
                     "ec17c988ee1cc7ec"
                 ]
             ]
         }
      ]
      

      AUCH hier geht es mir wieder darum zu zeigen, dass man für solche Aufgaben nicht mit Javascript rumhantieren muss und function Nodes schreiben muss!!! -

      Fred Freund 1 Reply Last reply Reply Quote 0
      • Fred Freund
        Fred Freund @mickym last edited by Fred Freund

        @mickym Danke fuer deine Muehe!!!

        Das mit dem moment hab ich mir auch schon ueberlegt.

        time now ist auch meine Frage gewesen...wie bekommst bei der Injekt node den Zeitpunkt am abgefragten Object vorbei 🙂 dh. du Fragst das Objekt ab und bekommst Objekt zurueck aber nicht den Zeitpunkt/Zeitstempel...wenn dieser aber viel laenger weil nicht upgedated also Alt ist , ist das egal ob das nur ein paar millis sind!!
        Das heb ich mir alles auf !!

        aber es laeuft mit der Trigger node! super einfach!

        Danke nochmal und schoenen Abend...

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

          So ich habe noch einen Flow für Dich gebastelt mit dem Du gleich einen ganzen Objektbaum grob untersuchen kannst.

          Die Zaubernode ist die iobroker list node. Allerdings hat die Node einen BUG - wenn Du die Werte nicht ausliest, dann kommt anscheinend das Erstellungsdatum als ts und nicht der aktuelle Timestamp.

          Ggf. kann man ja ein Issue aufmachen - allerdings die Umgehung ist wohl immer die values auszulesen.

          a27fa9ae-6447-4ed6-b54b-86b607c3f725-image.png

          Das ist also wichtig - wenn man aktuelle Timestamps haben will, auch wenn man an den Werten gar nicht interessiert ist.

          So kannst Du wie gesagt komplette Bäume aufeinmal durchsuchen und Dir die verschiedene Arrays ausgeben lassen, je nachdem wann ein Wert angefähr zuletzt aktualisiert wurde (also wie aktuell ein Wert ist, ob im Sekunden, Minuten etc. Bereich.
          f8e52821-4914-4dfc-9b12-9016112b11e4-image.png

          An dem folgenden Screenshot kannst Du dann anhand der Anzahl Elemente in den Array auf einmal sehen, welche Objekte in welchem ungefähren Zeitraum aktualisiert wurden.

          e367372b-5326-4cec-98cb-de138affd981-image.png

          Du siehst also von insgesamt 110 Objekten im mqtt Zigbee Bereich wurden:

          2 innerhalb von Sekunden
          21 innerhalb von Minuten
          3 innerhalb von Stunden
          43 innerhalb von Tagen
          11 innerhalb von Monaten
          und
          30 innerhalb von Jahren das letzte Mal aktualisiert.

          Über reguläre Ausdrücke kann man den ganzen Baum auch filtern. Will man also IDs haben, die nur die Küche betreffen, aber die Ordner die Küche alleine als Ordner haben, dann sieht die iobroker.list Node so aus:

          1df7cfa3-276e-40af-9696-5e7a8443c461-image.png

          Aus den 110 Objekten wurden also 7 Objekte selektiert. Davon wurden 3 innerhalb von Minuten, 4 innerhalb von Tagen das letzte Mal aktualisiert.

          [
             {
                 "id": "c4f17d8302b83fa6",
                 "type": "ioBroker list",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "topic": "mqtt.1.zigbee2mqtt.*",
                 "objType": "",
                 "regex": "",
                 "asArray": "true",
                 "onlyIDs": "false",
                 "withValues": "true",
                 "x": 560,
                 "y": 2640,
                 "wires": [
                     [
                         "bf3a117f8df1b5d6",
                         "8910edbe4f6cd8d5"
                     ]
                 ]
             },
             {
                 "id": "12c1ab80c14ac534",
                 "type": "inject",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Check alle Zigbees",
                 "props": [
                     {
                         "p": "payload"
                     }
                 ],
                 "repeat": "",
                 "crontab": "",
                 "once": false,
                 "onceDelay": 0.1,
                 "topic": "",
                 "payload": "",
                 "payloadType": "date",
                 "x": 330,
                 "y": 2640,
                 "wires": [
                     [
                         "c4f17d8302b83fa6"
                     ]
                 ]
             },
             {
                 "id": "bf3a117f8df1b5d6",
                 "type": "debug",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Alle Zigbees",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 790,
                 "y": 2580,
                 "wires": []
             },
             {
                 "id": "781af463cda7f8a6",
                 "type": "switch",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "property": "$moment(payload.ts,'x').locale('de').fromNow()",
                 "propertyType": "jsonata",
                 "rules": [
                     {
                         "t": "cont",
                         "v": "Sekunden",
                         "vt": "str"
                     },
                     {
                         "t": "cont",
                         "v": "Minute",
                         "vt": "str"
                     },
                     {
                         "t": "cont",
                         "v": "Stunde",
                         "vt": "str"
                     },
                     {
                         "t": "cont",
                         "v": "Tag",
                         "vt": "str"
                     },
                     {
                         "t": "cont",
                         "v": "Woche",
                         "vt": "str"
                     },
                     {
                         "t": "cont",
                         "v": "Monat",
                         "vt": "str"
                     },
                     {
                         "t": "cont",
                         "v": "Jahr",
                         "vt": "str"
                     },
                     {
                         "t": "else"
                     }
                 ],
                 "checkall": "true",
                 "repair": true,
                 "outputs": 8,
                 "x": 950,
                 "y": 2640,
                 "wires": [
                     [
                         "6cd56ac7ab7dce87"
                     ],
                     [
                         "5fa6eb083d46122c"
                     ],
                     [
                         "08f16a1626cf06cd"
                     ],
                     [
                         "6fc58185a311d026"
                     ],
                     [
                         "6432ac719be6bcc0"
                     ],
                     [
                         "f741845d91b9f6be"
                     ],
                     [
                         "6ba28c02c4ebf67b"
                     ],
                     [
                         "e13771b884dd8076"
                     ]
                 ]
             },
             {
                 "id": "8910edbe4f6cd8d5",
                 "type": "split",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "splt": "\\n",
                 "spltType": "str",
                 "arraySplt": 1,
                 "arraySpltType": "len",
                 "stream": false,
                 "addname": "",
                 "x": 790,
                 "y": 2640,
                 "wires": [
                     [
                         "781af463cda7f8a6"
                     ]
                 ]
             },
             {
                 "id": "873f60158caf4c69",
                 "type": "debug",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Check Timestamp Jahr",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1520,
                 "y": 2740,
                 "wires": []
             },
             {
                 "id": "6ba28c02c4ebf67b",
                 "type": "change",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Create New Object",
                 "rules": [
                     {
                         "t": "set",
                         "p": "new_payload.ts",
                         "pt": "msg",
                         "to": "payload.ts",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.since",
                         "pt": "msg",
                         "to": "$moment(payload.ts,'x').locale('de').fromNow()",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.id",
                         "pt": "msg",
                         "to": "payload._id",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.val",
                         "pt": "msg",
                         "to": "$exists(payload.val) ? $eval(payload.val)\t",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "new_payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1150,
                 "y": 2740,
                 "wires": [
                     [
                         "f42853bb676f9112"
                     ]
                 ]
             },
             {
                 "id": "f42853bb676f9112",
                 "type": "join",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "mode": "auto",
                 "build": "object",
                 "property": "payload",
                 "propertyType": "msg",
                 "key": "topic",
                 "joiner": "\\n",
                 "joinerType": "str",
                 "accumulate": "false",
                 "timeout": "",
                 "count": "",
                 "reduceRight": false,
                 "x": 1330,
                 "y": 2740,
                 "wires": [
                     [
                         "873f60158caf4c69"
                     ]
                 ]
             },
             {
                 "id": "c955ae5137de646c",
                 "type": "debug",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Check Timestamp Monat",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1530,
                 "y": 2700,
                 "wires": []
             },
             {
                 "id": "28cc51d1a286e25b",
                 "type": "join",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "mode": "auto",
                 "build": "object",
                 "property": "payload",
                 "propertyType": "msg",
                 "key": "topic",
                 "joiner": "\\n",
                 "joinerType": "str",
                 "accumulate": "false",
                 "timeout": "",
                 "count": "",
                 "reduceRight": false,
                 "x": 1330,
                 "y": 2700,
                 "wires": [
                     [
                         "c955ae5137de646c"
                     ]
                 ]
             },
             {
                 "id": "78a38beef0454f0e",
                 "type": "debug",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Check Timestamp  Woche",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1530,
                 "y": 2660,
                 "wires": []
             },
             {
                 "id": "bc7b7df4eb3ca0d2",
                 "type": "join",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "mode": "auto",
                 "build": "object",
                 "property": "payload",
                 "propertyType": "msg",
                 "key": "topic",
                 "joiner": "\\n",
                 "joinerType": "str",
                 "accumulate": "false",
                 "timeout": "",
                 "count": "",
                 "reduceRight": false,
                 "x": 1330,
                 "y": 2660,
                 "wires": [
                     [
                         "78a38beef0454f0e"
                     ]
                 ]
             },
             {
                 "id": "3054dd6f89f95828",
                 "type": "debug",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Check Timestamp Tag",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1520,
                 "y": 2620,
                 "wires": []
             },
             {
                 "id": "cd888096d9b8c78f",
                 "type": "join",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "mode": "auto",
                 "build": "object",
                 "property": "payload",
                 "propertyType": "msg",
                 "key": "topic",
                 "joiner": "\\n",
                 "joinerType": "str",
                 "accumulate": "false",
                 "timeout": "",
                 "count": "",
                 "reduceRight": false,
                 "x": 1330,
                 "y": 2620,
                 "wires": [
                     [
                         "3054dd6f89f95828"
                     ]
                 ]
             },
             {
                 "id": "751348d1971f8884",
                 "type": "debug",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Check Timestamp Stunde",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1530,
                 "y": 2580,
                 "wires": []
             },
             {
                 "id": "a519c55337cb5938",
                 "type": "join",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "mode": "auto",
                 "build": "object",
                 "property": "payload",
                 "propertyType": "msg",
                 "key": "topic",
                 "joiner": "\\n",
                 "joinerType": "str",
                 "accumulate": "false",
                 "timeout": "",
                 "count": "",
                 "reduceRight": false,
                 "x": 1330,
                 "y": 2580,
                 "wires": [
                     [
                         "751348d1971f8884"
                     ]
                 ]
             },
             {
                 "id": "ca1edc9ab2b833d1",
                 "type": "debug",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Check Timestamp Minute",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1530,
                 "y": 2540,
                 "wires": []
             },
             {
                 "id": "155b9f349a5fee3d",
                 "type": "join",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "mode": "auto",
                 "build": "object",
                 "property": "payload",
                 "propertyType": "msg",
                 "key": "topic",
                 "joiner": "\\n",
                 "joinerType": "str",
                 "accumulate": "false",
                 "timeout": "",
                 "count": "",
                 "reduceRight": false,
                 "x": 1330,
                 "y": 2540,
                 "wires": [
                     [
                         "ca1edc9ab2b833d1"
                     ]
                 ]
             },
             {
                 "id": "765c617aa7f048b9",
                 "type": "debug",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Check Timestamp Sekunde",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1540,
                 "y": 2500,
                 "wires": []
             },
             {
                 "id": "f5dddee5c7767d21",
                 "type": "join",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "mode": "auto",
                 "build": "object",
                 "property": "payload",
                 "propertyType": "msg",
                 "key": "topic",
                 "joiner": "\\n",
                 "joinerType": "str",
                 "accumulate": "false",
                 "timeout": "",
                 "count": "",
                 "reduceRight": false,
                 "x": 1330,
                 "y": 2500,
                 "wires": [
                     [
                         "765c617aa7f048b9"
                     ]
                 ]
             },
             {
                 "id": "f741845d91b9f6be",
                 "type": "change",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Create New Object",
                 "rules": [
                     {
                         "t": "set",
                         "p": "new_payload.ts",
                         "pt": "msg",
                         "to": "payload.ts",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.since",
                         "pt": "msg",
                         "to": "$moment(payload.ts,'x').locale('de').fromNow()",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.id",
                         "pt": "msg",
                         "to": "payload._id",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.val",
                         "pt": "msg",
                         "to": "$exists(payload.val) ? $eval(payload.val)\t",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "new_payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1150,
                 "y": 2700,
                 "wires": [
                     [
                         "28cc51d1a286e25b"
                     ]
                 ]
             },
             {
                 "id": "6432ac719be6bcc0",
                 "type": "change",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Create New Object",
                 "rules": [
                     {
                         "t": "set",
                         "p": "new_payload.ts",
                         "pt": "msg",
                         "to": "payload.ts",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.since",
                         "pt": "msg",
                         "to": "$moment(payload.ts,'x').locale('de').fromNow()",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.id",
                         "pt": "msg",
                         "to": "payload._id",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.val",
                         "pt": "msg",
                         "to": "$exists(payload.val) ? $eval(payload.val)\t",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "new_payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1150,
                 "y": 2660,
                 "wires": [
                     [
                         "bc7b7df4eb3ca0d2"
                     ]
                 ]
             },
             {
                 "id": "6fc58185a311d026",
                 "type": "change",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Create New Object",
                 "rules": [
                     {
                         "t": "set",
                         "p": "new_payload.ts",
                         "pt": "msg",
                         "to": "payload.ts",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.since",
                         "pt": "msg",
                         "to": "$moment(payload.ts,'x').locale('de').fromNow()",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.id",
                         "pt": "msg",
                         "to": "payload._id",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.val",
                         "pt": "msg",
                         "to": "$exists(payload.val) ? $eval(payload.val)\t",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "new_payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1150,
                 "y": 2620,
                 "wires": [
                     [
                         "cd888096d9b8c78f"
                     ]
                 ]
             },
             {
                 "id": "08f16a1626cf06cd",
                 "type": "change",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Create New Object",
                 "rules": [
                     {
                         "t": "set",
                         "p": "new_payload.ts",
                         "pt": "msg",
                         "to": "payload.ts",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.since",
                         "pt": "msg",
                         "to": "$moment(payload.ts,'x').locale('de').fromNow()",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.id",
                         "pt": "msg",
                         "to": "payload._id",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.val",
                         "pt": "msg",
                         "to": "$exists(payload.val) ? $eval(payload.val)\t",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "new_payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1150,
                 "y": 2580,
                 "wires": [
                     [
                         "a519c55337cb5938"
                     ]
                 ]
             },
             {
                 "id": "5fa6eb083d46122c",
                 "type": "change",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Create New Object",
                 "rules": [
                     {
                         "t": "set",
                         "p": "new_payload.ts",
                         "pt": "msg",
                         "to": "payload.ts",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.since",
                         "pt": "msg",
                         "to": "$moment(payload.ts,'x').locale('de').fromNow()",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.id",
                         "pt": "msg",
                         "to": "payload._id",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.val",
                         "pt": "msg",
                         "to": "$exists(payload.val) ? $eval(payload.val)\t",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "new_payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1150,
                 "y": 2540,
                 "wires": [
                     [
                         "155b9f349a5fee3d"
                     ]
                 ]
             },
             {
                 "id": "6cd56ac7ab7dce87",
                 "type": "change",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Create New Object",
                 "rules": [
                     {
                         "t": "set",
                         "p": "new_payload.ts",
                         "pt": "msg",
                         "to": "payload.ts",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.since",
                         "pt": "msg",
                         "to": "$moment(payload.ts,'x').locale('de').fromNow()",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.id",
                         "pt": "msg",
                         "to": "payload._id",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.val",
                         "pt": "msg",
                         "to": "$exists(payload.val) ? $eval(payload.val)\t",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "new_payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1150,
                 "y": 2500,
                 "wires": [
                     [
                         "f5dddee5c7767d21"
                     ]
                 ]
             },
             {
                 "id": "af4f85ad15e25226",
                 "type": "debug",
                 "z": "517cd16e4d7e6ae4",
                 "name": "ansonsten",
                 "active": true,
                 "tosidebar": true,
                 "console": false,
                 "tostatus": false,
                 "complete": "payload",
                 "targetType": "msg",
                 "statusVal": "",
                 "statusType": "auto",
                 "x": 1490,
                 "y": 2800,
                 "wires": []
             },
             {
                 "id": "e13771b884dd8076",
                 "type": "change",
                 "z": "517cd16e4d7e6ae4",
                 "name": "Create New Object",
                 "rules": [
                     {
                         "t": "set",
                         "p": "new_payload.ts",
                         "pt": "msg",
                         "to": "payload.ts",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.since",
                         "pt": "msg",
                         "to": "$moment(payload.ts,'x').locale('de').fromNow()",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.id",
                         "pt": "msg",
                         "to": "payload._id",
                         "tot": "msg"
                     },
                     {
                         "t": "set",
                         "p": "new_payload.val",
                         "pt": "msg",
                         "to": "$exists(payload.val) ? $eval(payload.val)\t",
                         "tot": "jsonata"
                     },
                     {
                         "t": "set",
                         "p": "payload",
                         "pt": "msg",
                         "to": "new_payload",
                         "tot": "msg"
                     }
                 ],
                 "action": "",
                 "property": "",
                 "from": "",
                 "to": "",
                 "reg": false,
                 "x": 1150,
                 "y": 2800,
                 "wires": [
                     [
                         "ecd28452cd5b75a3"
                     ]
                 ]
             },
             {
                 "id": "ecd28452cd5b75a3",
                 "type": "join",
                 "z": "517cd16e4d7e6ae4",
                 "name": "",
                 "mode": "auto",
                 "build": "object",
                 "property": "payload",
                 "propertyType": "msg",
                 "key": "topic",
                 "joiner": "\\n",
                 "joinerType": "str",
                 "accumulate": "false",
                 "timeout": "",
                 "count": "",
                 "reduceRight": false,
                 "x": 1330,
                 "y": 2800,
                 "wires": [
                     [
                         "af4f85ad15e25226"
                     ]
                 ]
             }
          ]
          

          Auch wieder mal ein Beispiel, wie man im Vergleich zu den Puzzlefreunden solche Dinge relativ einfach ermitteln kann.

          Fred Freund 1 Reply Last reply Reply Quote 1
          • Fred Freund
            Fred Freund @mickym last edited by

            @mickym Danke nochmal das hat mir viel geholfen...bezueglich zigbee2mqtt ich habe schon versucht umzusteigen aber wie ich dort Werte bekomme und setze war mir nicht klar...das bekommen sehe ich schon mal ..
            Wie ich die states setze muss ich mir ansehen.

            zigbee2mqtt hat bei mir auch keine Sensoren angelernt..und die Datenbank und ids, keys die ich eingetragen habe haben die Geraete erkannt aber keine Verbindung zum Coordinator hergestellt.

            Jedenfalls vielen Dank fuer deine Hilfe.

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

              @fred-freund Ich benutze das Zigbee2mqtt halt ohne Adapter - sondern nur mit reinem mqtt. Das zigbee2mqtt kann man von Haus aus programmieren, dass es dei Objekte auseinenander nimmt, aber ich bleibe bei den Objekten. Man kann auch Objekte und diskrete Datenpunkte verwenden.

              Fred Freund 1 Reply Last reply Reply Quote 0
              • Fred Freund
                Fred Freund @mickym last edited by

                @mickym Ja das hatte ich auch, einen eigenen Container fuer Zigbee2mqtt auf Debian 12.

                Irgendwie will ich auf einen gemeinsamen Nenner. welches fuer mich MQTT ist zurueck.
                Zwave2 Mqtt hat funktioniert ...aber meine Node Red Flows umzubauen auf MQTT war mir jetzt zuviel habe 1 Woche umgebaut vom Raspi auf Proxmox.

                Andererseits die Objekte das funktioniert so gut...

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

                  @fred-freund Ja ich zieh auch auf Proxmox um - und überarbeite aber alle Flows - ich hab ja Zeit. 😉 - Auch wenn alles noch auf den alten Flows läuft und das ganz gut - so ist vieles was ich vor 4 Jahren gemacht habe - halt überaltert und versuche das modularer aufzubauen.

                  Fred Freund 1 Reply Last reply Reply Quote 0
                  • Fred Freund
                    Fred Freund @mickym last edited by Fred Freund

                    @mickym ich habe das Problem das ich vor einiger Zeit gemacht habe nicht mehr Weiss wie das ging...vieles hab ich wieder vergessen .😂

                    1 Reply Last reply Reply Quote 0
                    • P
                      Peter666666 last edited by Peter666666

                      Ich möchte gerne einen DP auf false setzen wenn sich ein Timestamp nicht mehr ändert für x Sekunden, ansonsten soll dieser true sein. Wie mach ich das am Besten? Der DP 170 ist vom Volkszähler

                      flows.json

                      Bild 17.01.24 um 20.25.jpeg

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

                        @peter666666

                        Änder die trigger Node wie folgt:

                        856aee39-0445-4dfb-99d6-abfbe00999c4-image.png

                        Am Anfang true setzten ,den Haken für Verzögerung bei eingehender Nachricht, dann false. So wird ein Alarm gesetzt wenn der Datenpunkt nicht aktualisiert wird. Wenn Du wirklich auf Änderung triggern willst, musst das halt bei der iobroker-In Node festlegen. Ich würde aber lieber die Aktualisierung und nicht Änderung nutzen.

                        P 1 Reply Last reply Reply Quote 2
                        • P
                          Peter666666 @mickym last edited by

                          @mickym Vielen Dank!!! Es funktioniert. Wie mach ich es wenn ich auf Aktualisierung prüfen will?

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

                            @peter666666

                            @peter666666 sagte in obeject timestamp zugriff:

                            @mickym Vielen Dank!!! Es funktioniert. Wie mach ich es wenn ich auf Aktualisierung prüfen will?

                            Na so ist ja mit Aktualisierung. Änderung würde ich Dir nicht empfehlen. Das legst du in der iobroker-In Node fest, dass dann halt nur Änderungen Nachrichten erzeugen.

                            Solange die iobroker-IN Node aber alle Events sendet

                            7f9b4ad9-98b2-4fe7-af6a-b93ae484be03-image.png

                            prüfst Du auf Aktualisierung.

                            1 Reply Last reply Reply Quote 2
                            • mickym
                              mickym Most Active last edited by mickym

                              Und wieder mal ein Beispiel - wie einfach NodeRed es einem macht. So kannst Du übrigens alle Zustände in einem Objekt sammeln, wenn Du willst und diese dann in Summe überprüfen. Habe ich aber schon x-Mal gezeigt. Aber wenn Bedarf ist, kann ich das gerne immer wieder zeigen.

                              1 Reply Last reply Reply Quote 2
                              • First post
                                Last post

                              Support us

                              ioBroker
                              Community Adapters
                              Donate

                              780
                              Online

                              31.7k
                              Users

                              79.9k
                              Topics

                              1.3m
                              Posts

                              3
                              23
                              944
                              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